/* ===== VARIAVEIS ===== */
:root {
  --azul-midea: #2094D2;
  --azul-escuro: #1A7AB5;
  --azul-claro: #E8F4FD;
  --cinza-bg: #F5F5F5;
  --cinza-texto: #666;
  --cinza-borda: #DDD;
  --branco: #FFFFFF;
  --verde-download: #28A745;
  --verde-hover: #218838;
  --vermelho: #DC3545;
  --sombra: 0 2px 8px rgba(0,0,0,0.1);
  --sombra-hover: 0 4px 16px rgba(0,0,0,0.15);
  --radius: 8px;
  --max-width: 1200px;
  --transition: 0.3s ease;
}

/* ===== RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--cinza-bg);
  color: #333;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== HEADER ===== */
.header {
  background: var(--branco);
  box-shadow: var(--sombra);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-logos {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-logos img {
  height: 42px;
  width: auto;
}

/* ===== BUSCA ===== */
.search-container {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 2px solid var(--cinza-borda);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.search-input:focus {
  border-color: var(--azul-midea);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cinza-texto);
  font-size: 18px;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--branco);
  border-radius: var(--radius);
  box-shadow: var(--sombra-hover);
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--cinza-bg);
  transition: background var(--transition);
}

.search-result-item:hover {
  background: var(--azul-claro);
}

.search-result-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.search-result-item .info {
  flex: 1;
}

.search-result-item .info .name {
  font-size: 14px;
  font-weight: 600;
}

.search-result-item .info .sku {
  font-size: 12px;
  color: var(--cinza-texto);
}

/* ===== HERO / TITULO ===== */
.hero {
  background: linear-gradient(135deg, var(--azul-midea), var(--azul-escuro));
  color: var(--branco);
  text-align: center;
  padding: 40px 20px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero p {
  font-size: 16px;
  opacity: 0.9;
}

/* ===== TABS FAMILIAS ===== */
.family-tabs {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 20px 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.family-tab {
  padding: 10px 20px;
  background: var(--branco);
  border: 2px solid var(--cinza-borda);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--cinza-texto);
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}

.family-tab:hover {
  color: var(--azul-midea);
  border-color: var(--azul-midea);
}

.family-tab.active {
  background: var(--azul-midea);
  color: var(--branco);
  border-color: var(--azul-midea);
}

/* ===== SECAO FAMILIA ===== */
.family-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 30px;
  display: none;
}

.family-section.active {
  display: block;
}

.subfamily-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--azul-escuro);
  margin: 24px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--azul-midea);
}

/* ===== CARROSSEL ===== */
.carousel-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 8px 4px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--branco);
  border: 2px solid var(--cinza-borda);
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sombra);
  transition: all var(--transition);
}

.carousel-btn:hover {
  background: var(--azul-midea);
  color: var(--branco);
  border-color: var(--azul-midea);
}

.carousel-btn.prev {
  left: -8px;
}

.carousel-btn.next {
  right: -8px;
}

/* ===== CARD PRODUTO ===== */
.product-card {
  min-width: 220px;
  max-width: 220px;
  background: var(--branco);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-hover);
}

.product-card .card-image {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--branco);
  padding: 16px;
  border-bottom: 1px solid var(--cinza-bg);
}

.product-card .card-image img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.product-card .card-body {
  padding: 12px;
  flex: 1;
}

.product-card .card-body h3 {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .card-body .specs {
  font-size: 12px;
  color: var(--cinza-texto);
  margin-bottom: 8px;
}

.product-card .card-body .sku {
  font-size: 11px;
  color: var(--azul-midea);
  font-weight: 600;
}

.btn-materiais {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: auto;
  background: var(--verde-download);
  color: var(--branco);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-materiais:hover {
  background: var(--verde-hover);
}

/* ===== MAIS BAIXADOS ===== */
.top-downloads {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 20px;
}

.top-downloads h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--azul-escuro);
  margin-bottom: 16px;
  text-align: center;
}

.top-downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--cinza-texto);
}

.loading .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--cinza-borda);
  border-top-color: var(--azul-midea);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== MENSAGEM VAZIA ===== */
.empty-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--cinza-texto);
  font-size: 16px;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--azul-escuro);
  color: var(--branco);
  text-align: center;
  padding: 20px;
  font-size: 13px;
  margin-top: 40px;
}

/* ===== PAGINA PRODUTO ===== */
.produto-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 20px;
}

.produto-voltar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--azul-midea);
  font-weight: 600;
  margin-bottom: 20px;
  cursor: pointer;
  font-size: 14px;
}

.produto-voltar:hover {
  text-decoration: underline;
}

.produto-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: var(--branco);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 30px;
}

.produto-imagem {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cinza-bg);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 300px;
}

.produto-imagem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.produto-info h1 {
  font-size: 24px;
  color: var(--azul-escuro);
  margin-bottom: 8px;
}

.produto-info .sku-label {
  font-size: 14px;
  color: var(--azul-midea);
  font-weight: 600;
  margin-bottom: 16px;
}

.produto-info .familia-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--azul-claro);
  color: var(--azul-midea);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.produto-info .descricao {
  color: var(--cinza-texto);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.produto-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}

.produto-specs .spec-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--cinza-bg);
  border-radius: var(--radius);
  font-size: 13px;
}

.produto-specs .spec-item .label {
  color: var(--cinza-texto);
}

.produto-specs .spec-item .value {
  font-weight: 600;
}

/* ===== BOTOES DOWNLOAD ===== */
.download-section h2 {
  font-size: 18px;
  color: var(--azul-escuro);
  margin-bottom: 12px;
}

.download-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 2px solid var(--azul-midea);
  background: var(--branco);
  color: var(--azul-midea);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-download:hover {
  background: var(--azul-midea);
  color: var(--branco);
}

.btn-download .icon {
  font-size: 18px;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 12px;
  }

  .search-container {
    max-width: 100%;
    width: 100%;
  }

  .hero h1 {
    font-size: 22px;
  }

  .family-tabs {
    padding: 12px 12px 0;
  }

  .family-tab {
    padding: 8px 14px;
    font-size: 13px;
  }

  .family-section {
    padding: 0 12px 20px;
  }

  .product-card {
    min-width: 170px;
    max-width: 170px;
  }

  .product-card .card-image {
    height: 140px;
  }

  .carousel-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .carousel-btn.prev {
    left: -4px;
  }

  .carousel-btn.next {
    right: -4px;
  }

  /* Produto */
  .produto-content {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }

  .produto-imagem {
    min-height: 200px;
  }

  .produto-specs {
    grid-template-columns: 1fr;
  }

  .download-buttons {
    grid-template-columns: 1fr;
  }

  .top-downloads-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 480px) {
  .product-card {
    min-width: 150px;
    max-width: 150px;
  }

  .product-card .card-image {
    height: 120px;
  }

  .hero {
    padding: 24px 16px;
  }

  .hero h1 {
    font-size: 18px;
  }
}
