/* 1. CONFIGURAÇÕES GLOBAIS */
:root {
  --cor-fundo: #F8F9FA;
  --cor-primaria: #1A3356;
  --cor-secundaria: #343A40;
  --cor-destaque: #007BFF;
  --cor-sucesso: #28A745;
  --cor-perigo: #DC3545;
  --cor-texto: #212529;
  --cor-texto-suave: #6C757D;
  --cor-branco: #FFFFFF;
  --sombra-suave: 0 4px 15px rgba(0, 0, 0, 0.07);
  --raio-borda: 8px;
  --facebook-blue: #1877F2;
  --instagram-color: #E1306C;
  --instagram-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Roboto', sans-serif; }

/* TRAVA DE SEGURANÇA TOTAL */
html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    background-color: var(--cor-fundo); 
    color: var(--cor-texto); 
    line-height: 1.6;
}
html { scroll-behavior: smooth; }

h1, h2, h3, h4, h5, h6 { font-family: 'Montserrat', sans-serif; font-weight: 700; color: var(--cor-primaria); }

/* Container Principal */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 1rem; 
    width: 100%; 
    box-sizing: border-box; 
}

.page { animation: fadeInPage 0.5s ease-in-out; }
@keyframes fadeInPage { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 2. HEADER (CABEÇALHO) */
#main-header {
  background-color: var(--cor-branco);
  padding: 0 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 110px; /* MANTIDA A ALTURA ATUAL */
}
.logo-link { line-height: 0; display: flex; align-items: center; }

#main-header .logo { 
    height: 105px; /* AUMENTADA PARA OCUPAR QUASE TODO O ESPAÇO DISPONÍVEL */
    width: auto; 
    object-fit: contain; /* Garante que não distorça */
    transition: all 0.3s ease;
}

.desktop-nav { margin: 0 auto; }
.desktop-nav ul { display: flex; list-style: none; gap: 2rem; align-items: center; padding-left: 0; }
.desktop-nav ul li a { text-decoration: none; color: var(--cor-secundaria); font-weight: 600; font-size: 1rem; padding: 10px 0; border-bottom: 2px solid transparent; transition: all 0.3s ease; }
.desktop-nav ul li a:hover, .desktop-nav ul li a.active { color: var(--cor-destaque); border-bottom-color: var(--cor-destaque); }

.header-actions { display: flex; align-items: center; gap: 1.5rem; }

.user-menu { position: relative; }
.user-menu-btn { background: none; border: none; cursor: pointer; padding: 5px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.user-menu-btn svg { width: 28px; height: 28px; color: var(--cor-secundaria); }

.dropdown-content {
  display: none; position: absolute; right: 0; top: 120%;
  background-color: var(--cor-branco); min-width: 220px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1); border-radius: var(--raio-borda);
  z-index: 1001; overflow: hidden; border: 1px solid #eee;
}
.dropdown-content.show { display: block; }
.dropdown-content a { color: var(--cor-secundaria); padding: 12px 16px; text-decoration: none; display: block; font-weight: 500; }
.dropdown-content a:hover { background-color: #f1f1f1; }
.dropdown-content hr { border: 0; border-top: 1px solid #eee; margin: 5px 0; }

.nav-toggle { display: none; }
.mobile-nav { display: none; }

/* 3. HERO SECTION */
.hero-section {
  position: relative;
  height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--cor-branco);
  overflow: hidden;
  background-color: #1A3356;
}

.hero-background-swiper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.hero-background-swiper .swiper-slide { width: 100%; height: 100%; }
.hero-background-swiper .swiper-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center center; }

.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(26, 51, 86, 0.7); z-index: 2; }

.hero-content { position: relative; z-index: 3; max-width: 800px; margin: 0 auto; padding: 2rem; display: flex; flex-direction: column; align-items: center; }
.hero-content h1 { font-size: 3rem; margin-bottom: 1rem; color: #ffffff !important; text-shadow: 2px 2px 4px rgba(0,0,0,0.7); }
.hero-content p { font-size: 1.2rem; margin-bottom: 2rem; text-shadow: 1px 1px 2px rgba(0,0,0,0.7); color: #fff; }

.search-box {
  background-color: rgba(255, 255, 255, 0.95); padding: 1.5rem; border-radius: var(--raio-borda);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2); display: flex; gap: 1rem; width: 100%; max-width: 600px;
}
.search-box input { flex: 1; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; }
.search-box button { background-color: var(--cor-destaque); color: white; border: none; padding: 0 25px; border-radius: 4px; cursor: pointer; font-weight: bold; transition: background 0.3s; }
.search-box button:hover { background-color: #0056b3; }

/* 4. TRUST SECTION */
.trust-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; padding: 4rem 10%; background: var(--cor-branco); text-align: center; border-bottom: 1px solid #eee; }
.trust-item h3 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.trust-item p { color: var(--cor-texto-suave); font-size: 0.95rem; }

/* 5. CARDS */
.stock-section { padding: 4rem 0; background-color: var(--cor-fundo); }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 2.2rem; position: relative; display: inline-block; padding-bottom: 10px; }
.section-header h2::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 4px; background-color: var(--cor-destaque); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; margin-bottom: 3rem; }
.card { background: var(--cor-branco); border-radius: var(--raio-borda); box-shadow: var(--sombra-suave); overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }

.card-image-container { height: 280px; width: 100%; position: relative; overflow: hidden; background-color: #eee; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #eee; }
.card-image-container img { width: 100%; height: 100%; object-fit: cover; object-position: center center; transition: transform 0.5s ease; }
.card:hover .card-image-container img { transform: scale(1.05); }

.out-of-stock-badge { position: absolute; top: 10px; right: 10px; background-color: var(--cor-perigo); color: white; padding: 5px 10px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.card-info { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.card-info h3 { margin-bottom: 1rem; font-size: 1.2rem; color: var(--cor-primaria); }
.card-specs-grid { display: flex; gap: 1rem; margin-bottom: 1rem; color: var(--cor-texto-suave); font-size: 0.9rem; }
.spec-item { display: flex; align-items: center; gap: 5px; background: #f8f9fa; padding: 4px 8px; border-radius: 4px; }
.card-price { font-size: 1.4rem; font-weight: 700; color: var(--cor-destaque); margin-top: auto; margin-bottom: 1rem; }
.btn { display: inline-block; padding: 0.8rem 1.5rem; background-color: var(--cor-destaque); color: white; text-align: center; border-radius: var(--raio-borda); font-weight: 600; cursor: pointer; border: none; transition: background 0.3s ease; text-decoration: none; }
.btn:hover { background-color: #0056b3; }
.btn-disabled { background-color: #ccc; cursor: not-allowed; }
.view-all-btn-container { text-align: center; margin-top: 2rem; }

/* 6. PÁGINA DE DETALHES */
.product-detail-container { 
    background: #fff; 
    padding: 2rem; 
    border-radius: var(--raio-borda); 
    box-shadow: var(--sombra-suave); 
    width: 100%; 
    box-sizing: border-box; 
    max-width: 1200px;
}
.product-detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; }
.product-gallery-container { position: relative; width: 100%; }

.main-image-container { 
  position: relative; 
  width: 100%; 
  height: 500px; 
  border-radius: var(--raio-borda); 
  overflow: hidden; 
  margin-bottom: 1rem; 
  background-color: #fff; 
  border: 1px solid #eee;
  display: flex; 
  align-items: center; 
  justify-content: center;
}
.main-image-container img { width: 100%; height: 100%; object-fit: cover; object-position: center center; }

.thumbnail-gallery { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.thumbnail-img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: 0.6; transition: 0.3s; border: 2px solid transparent; flex-shrink: 0; }
.thumbnail-img:hover, .thumbnail-img.active { opacity: 1; border-color: var(--cor-destaque); }

/* ZOOM OFF */
.img-zoom-loupe, .img-zoom-result { display: none !important; }

.product-info h1 { font-size: 2.5rem; margin-bottom: 0.5rem; word-wrap: break-word; }
.product-info .price { font-size: 2rem; color: var(--cor-destaque); font-weight: bold; margin-bottom: 2rem; }
.specs-list { list-style: none; margin-bottom: 2rem; background: #f8f9fa; padding: 1.5rem; border-radius: var(--raio-borda); }
.specs-list li { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #eee; }
.specs-list li:last-child { border-bottom: none; }

/* ESTILO DA DESCRIÇÃO (COM FUNDO CINZA) */
.product-description h3 {
    margin-bottom: 0.5rem;
    color: var(--cor-primaria);
    font-size: 1.2rem;
}
.product-description p {
    background-color: #f8f9fa;
    padding: 1.5rem; 
    border-radius: var(--raio-borda); 
    color: var(--cor-texto);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    white-space: pre-wrap; 
    word-wrap: break-word; 
    font-family: 'Roboto', sans-serif;
}

/* Botão Whatsapp (Seguro para Mobile) */
.whatsapp-tracker { 
    background-color: var(--cor-sucesso); 
    width: 100%; 
    display: flex; 
    justify-content: center;
    align-items: center;
    text-align: center; 
    font-size: 1.1rem; 
    white-space: normal;
    padding: 15px 10px;
    height: auto; 
    line-height: 1.3;
    box-sizing: border-box;
    max-width: 100%; 
    border-radius: var(--raio-borda);
    text-decoration: none;
    color: white;
    font-weight: bold;
}
.whatsapp-tracker:hover { background-color: #218838; }

/* 7. ADMIN */
.form-container { max-width: 800px; margin: 2rem auto; background: #fff; padding: 2rem; border-radius: var(--raio-borda); box-shadow: var(--sombra-suave); width: 100%; box-sizing: border-box; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; box-sizing: border-box; }
.form-group input:focus { border-color: var(--cor-destaque); outline: none; }
.admin-table-container { overflow-x: auto; background: #fff; border-radius: var(--raio-borda); box-shadow: var(--sombra-suave); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.admin-table th, .admin-table td { padding: 1rem; text-align: left; border-bottom: 1px solid #eee; }
.admin-table th { background-color: #f8f9fa; font-weight: 600; color: var(--cor-primaria); }
.btn-secondary { background-color: #6c757d; font-size: 0.9rem; padding: 0.5rem 1rem; }
.btn-secondary:hover { background-color: #5a6268; }
.btn-danger { background-color: var(--cor-perigo); font-size: 0.9rem; padding: 0.5rem 1rem; }
.btn-danger:hover { background-color: #c82333; }

/* GERENCIADOR DE IMAGENS */
#image-edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; margin-top: 1rem; padding: 1rem; background-color: var(--cor-fundo); border-radius: var(--raio-borda); }
.image-edit-thumbnail { position: relative; border: 2px solid #ddd; border-radius: var(--raio-borda); overflow: hidden; height: 100px; background-color: #fff; cursor: grab; }
.image-edit-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.image-edit-thumbnail.is-primary { border-color: var(--cor-destaque); box-shadow: 0 0 10px rgba(0, 123, 255, 0.5); }
.image-edit-thumbnail.is-primary::before { content: 'Capa'; position: absolute; top: 0; left: 0; background: var(--cor-destaque); color: white; font-size: 0.7rem; padding: 2px 6px; z-index: 2; }
.image-edit-thumbnail .actions { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; opacity: 0; transition: opacity 0.3s ease; }
.image-edit-thumbnail:hover .actions { opacity: 1; }
.image-edit-thumbnail .actions button { background: white; border: none; color: #333; cursor: pointer; width: 25px; height: 25px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; border-radius: 4px; font-weight: bold; }
.image-edit-thumbnail .actions button:hover { background-color: var(--cor-destaque); color: white; }
.image-edit-thumbnail .actions button.delete-btn:hover { background-color: var(--cor-perigo); color: white; }

/* 8. TOAST */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast { min-width: 250px; margin-bottom: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 15px; border-radius: 5px; color: #fff; }
.whatsapp-float { position: fixed; bottom: 25px; right: 25px; background-color: #25D366; color: white; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 2px 2px 10px rgba(0,0,0,0.2); z-index: 100; transition: transform 0.3s ease; }
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { width: 30px; height: 30px; }

/* 9. RODAPÉ */
#main-footer { background-color: #0B1C33; color: #fff; padding: 4rem 0 0 0; margin-top: auto; font-family: 'Roboto', sans-serif; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 3rem; padding-bottom: 3rem; align-items: start; text-align: left; }
.footer-col h4 { color: #fff; margin-bottom: 1.5rem; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; border-bottom: 3px solid var(--cor-destaque); display: inline-block; padding-bottom: 5px; }
.footer-links, .contact-list { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.8rem; }
.footer-links a { color: #ccc; text-decoration: none; transition: 0.3s; font-size: 0.95rem; }
.footer-links a:hover { color: #fff; padding-left: 5px; color: var(--cor-destaque); }
.footer-logo { width: 160px; height: auto; margin-bottom: 1rem; }
.footer-desc { color: #ccc; font-size: 0.9rem; line-height: 1.6; max-width: 300px; }
.contact-list li { margin-bottom: 1rem; color: #ccc; font-size: 0.95rem; display: flex; align-items: center; gap: 10px; }
.social-links { display: flex; gap: 15px; margin-top: 1.5rem; }
.social-btn { display: flex; align-items: center; justify-content: center; width: 45px; height: 45px; background: transparent; border: 1px solid rgba(255,255,255,0.2); border-radius: 50%; color: #fff; text-decoration: none; font-size: 0; transition: 0.3s; }
.social-btn:hover { background: var(--cor-destaque); border-color: var(--cor-destaque); transform: translateY(-3px); }
.footer-bottom { background-color: #081424; text-align: center; padding: 1.5rem 0; font-size: 0.85rem; color: #777; margin-top: 0; border-top: 1px solid rgba(255,255,255,0.05); }

/* --- SEÇÃO SOBRE NÓS --- */
.about-container { background-color: var(--cor-branco); padding: 3rem; border-radius: var(--raio-borda); box-shadow: var(--sombra-suave); margin-top: 2rem; max-width: 1000px; margin-left: auto; margin-right: auto; width: 100%; box-sizing: border-box; }
.about-container p { margin-bottom: 1.5rem; color: var(--cor-texto-suave); font-size: 1.1rem; line-height: 1.8; }

/* --- BOTÕES PÁGINA DE CONTATO --- */
.contact-buttons-container { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.contact-social-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 30px; border-radius: 50px; text-decoration: none; font-weight: 600; font-size: 1rem; transition: all 0.3s ease; border: 2px solid transparent; min-width: 160px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.contact-social-btn svg { width: 24px; height: 24px; fill: currentColor; }
.contact-social-btn.facebook { background-color: #fff; border-color: #1877F2; color: #1877F2; }
.contact-social-btn.facebook:hover { background-color: #1877F2; color: #fff; box-shadow: 0 5px 15px rgba(24, 119, 242, 0.3); transform: translateY(-2px); }
.contact-social-btn.instagram { background-color: #fff; border-color: #E1306C; color: #E1306C; }
.contact-social-btn.instagram:hover { background: var(--instagram-gradient); color: #fff; border-color: transparent; box-shadow: 0 5px 15px rgba(225, 48, 108, 0.3); transform: translateY(-2px); }

/* 10. RESPONSIVIDADE E CORREÇÕES MOBILE */
@media (max-width: 768px) {
  /* HEADER FLEXÍVEL E SEGURO NO MOBILE */
  #main-header { 
      padding: 0 1rem; 
      justify-content: space-between;
      align-items: center;
      height: 80px; /* Mantém o tamanho original no celular */
      display: flex;
  }
  
  /* FORÇA A LOGO A DIMINUIR NO CELULAR */
  #main-header .logo { height: 60px; }

  .desktop-nav { display: none; }
  .header-actions { display: none !important; }
  
  .nav-toggle { 
      display: block; 
      background: none; 
      border: none; 
      font-size: 1.8rem; 
      color: var(--cor-primaria); 
      cursor: pointer; 
      position: static; 
      margin-left: auto;
      z-index: 1002;
  }
  
  .mobile-nav { 
      display: none; 
      position: absolute; 
      top: 80px; 
      left: 0;
      width: 100%; 
      background: #fff; 
      border-top: 1px solid #eee; 
      box-shadow: 0 4px 6px rgba(0,0,0,0.1);
      z-index: 2000;
  }
  
  .mobile-menu-open .mobile-nav { display: block; animation: slideDown 0.3s ease; }
  @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
  
  .mobile-nav ul { list-style: none; padding: 0; margin: 0; }
  .mobile-nav li { border-bottom: 1px solid #f0f0f0; }
  .mobile-nav a { display: block; padding: 1.2rem; color: var(--cor-primaria); text-decoration: none; font-weight: 600; text-align: center; }
  .mobile-nav a:hover { background-color: #f8f9fa; }

  .hero-content h1 { font-size: 2rem; }
  .search-box { flex-direction: column; }
  .search-box button { padding: 15px; }
  
  /* --- CORREÇÃO AGRESSIVA E SEGURA PARA O CONTEÚDO --- */
  
  /* Força a página a respeitar as bordas laterais */
  .container { 
      padding: 0 15px !important; 
      width: 100% !important;
      box-sizing: border-box !important;
  } 
  
  /* O CARTÃO DE INFORMAÇÕES */
  .product-detail-container { 
      padding: 1.5rem 0 !important; /* Sem padding lateral */
      margin: 1rem 0 !important; 
      width: 100% !important;
      border-radius: 0;
      box-shadow: none; 
      border-top: 1px solid #eee;
      border-bottom: 1px solid #eee;
      box-sizing: border-box !important;
  }
  
  .product-detail-grid { display: block; } 
  
  .main-image-container { 
      height: 400px; 
      max-height: 55vh; 
      width: 100%;
      border-radius: 0;
      border: none;
      margin-bottom: 1rem;
  }
  
  /* O TEXTO DENTRO DO CARTÃO */
  .product-info, .thumbnail-gallery { 
      padding: 0; 
      width: 100% !important;
      box-sizing: border-box !important;
  }
  
  .product-info h1 { font-size: 1.8rem; }

  /* CORREÇÃO DO BOTÃO "TENHO INTERESSE" */
  /* Forçamos uma largura menor que 100% da tela para criar margem física */
  .whatsapp-tracker {
      display: block !important;
      width: 100% !important;
      max-width: 90vw !important; /* SEGURANÇA MÁXIMA: Nunca passa de 90% da tela */
      margin-left: auto !important;
      margin-right: auto !important;
      font-size: 0.95rem !important; 
      padding: 15px 10px !important; 
      margin-top: 15px;
      white-space: normal !important; 
      word-wrap: break-word !important; 
      box-sizing: border-box !important; 
  }
  
  .img-zoom-result { display: none !important; }
  .grid { grid-template-columns: 1fr; }
  .card-image-container { height: 250px; }
  
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-col h4 { border-bottom: none; border-top: 2px solid var(--cor-destaque); padding-top: 10px; margin-top: 20px; display: block; }
  .contact-list li { justify-content: center; }
  .social-links { justify-content: center; }
  .footer-desc { margin: 0 auto; }
  
  .about-container { padding: 1.5rem; }
  .contact-buttons-container { flex-direction: column; align-items: center; }
  .contact-social-btn { width: 100%; max-width: 300px; margin-right: 0; }
}