/* ==========================================================
  style_final.css
  Auditoría + optimización (sin perder reglas):
  - Selectores duplicados fusionados (último valor gana)
  - Selectores con declaraciones idénticas agrupados
  - Reorganizado por secciones lógicas
========================================================== */

/* --- Variables / Root --- */

:root {
  --primary: #1B4D3E;
  --accent: #D4A373;
  --bg-body: #F9F7F2;
  --chat-bg: rgba(255, 255, 255, 0.2);
  --blur-level: 20px;
  --overlay-opacity: 0.3;
}

/* --- Reset / Global --- */

html {
  scroll-behavior: smooth;
}
img {
  animation: fadeIn 0.8s ease-in;
}
body:not(.night-mode) .glass-card {
  background: rgba(255, 255, 255, 0.95);
  color: #1B4D3E;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
body:not(.night-mode) .glass-card h3 {
  color: #1B4D3E;
  font-weight: 800;
}
body:not(.night-mode) .glass-card p {
  color: #333333;
  opacity: 1 !important;
}
body:not(.night-mode) .section-title {
  color: #1B4D3E;
  text-shadow: none;
}
body.night-mode footer {
  background: #0f0a06;
  border-top-color: #ffcc80;
}
body.light-mode {
  background-color: #f0f0f0;
}
body.light-mode .hero-section {
  background-image: none !important;
  background-color: var(--primary);
}
body.light-mode #chat-wrapper {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: none;
}
body {
  margin: 0;
  padding: 0;
  font-family: "Lato", sans-serif;
  background-color: var(--bg-body);
  overflow-x: hidden;
  transition: background-color 0.8s ease, color 0.8s ease, filter 1.2s ease-in-out;
}
body.night-mode {
  background-color: #1a120b;
}
body.night-mode .hero-section {
  filter: sepia(0.5) brightness(0.6) contrast(1.1);
}
body.night-mode #chat-wrapper {
  background: rgba(30, 20, 10, 0.8);
  border-color: rgba(212, 163, 115, 0.2);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
body.night-mode #chat-header {
  background: rgba(45, 30, 15, 0.95);
  border-bottom: 1px solid rgba(212, 163, 115, 0.3);
}
body.night-mode .bot {
  background: #2d1e0f;
  color: #ffcc80;
  border: 1px solid rgba(255, 204, 128, 0.2);
}
body.night-mode .user {
  background: #d4a373;
  color: #1a120b;
}
body.night-mode .chip {
  background: rgba(255, 204, 128, 0.1);
  color: #ffcc80;
  border: 1px solid rgba(255, 204, 128, 0.3);
}
body.night-mode .section-title {
  color: #ffcc80;
  text-shadow: 0 2px 15px rgba(255, 140, 0, 0.4);
}
body.night-mode .glass-card p {
  color: #d4a373;
}
body.night-mode #aproposito div[style*="border-left"] {
  background: rgba(255, 204, 128, 0.1) !important;
  border-left-color: #ffcc80 !important;
}
body.night-mode #aproposito div[style*="border-left"] span {
  color: #ffcc80 !important;
  font-weight: 600;
}
body.night-mode #aproposito p {
  color: #f5e6d3 !important;
}
body.night-mode #aproposito h3 {
  color: #ffcc80 !important;
}
body.night-mode .chat-product-card {
  background: #2d1e0f;
  border: 1px solid rgba(255, 204, 128, 0.2);
}
body.night-mode .chat-product-card a[style*="background: #33CCFF"] {
  color: #000 !important;
  font-weight: bold;
}
body.night-mode .footer-col h4,
body.night-mode .footer-col h3 span,
body.night-mode .chat-product-card h4 {
  color: #ffcc80;
}
body.night-mode .modal-content {
  background: #1a120b;
  color: #f5e6d3;
  border: 1px solid var(--accent);
}
body.night-mode .chat-product-card p,
body.night-mode .blog-render {
  color: #f5e6d3;
}
body.night-mode .close-btn,
body.night-mode .modal-text h4,
body.night-mode .blog-render h1, body.night-mode .blog-render h2 {
  color: var(--accent);
}
body.night-mode .glass-card {
  color: #f5e6d3;
  background: rgba(13, 38, 31, 0.8) !important;
  border: 1px solid rgba(212, 163, 115, 0.2);
}

body.night-mode .glass-card h3 {
  color: #D4A373 !important;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}




/* --- Animations --- */

@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
  }

/* --- Layout --- */

.main-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  box-sizing: border-box;
  z-index: 20;
}


.nav-logo {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 50; /* Asegura que esté por encima del fondo pero no tape modales */
  width: auto; /* Que se ajuste al contenido, no a la pantalla */
  display: block;
}


.nav-logo img {
  height: 200px !important; /* Tamaño para PC */
  width: auto !important;   /* Mantiene la proporción, evita estiramientos */
  max-width: none;
  display: block;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
}



.nav-burger {
  position: fixed;
  top: 20px;
  right: 20px;
  color: #28B463;
  font-size: 2.2rem;
  cursor: pointer;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}
.nav-burger:hover {
  transform: scale(1.1);
  background: white;
}
.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: var(--primary);
  color: white;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 30;
  padding: 80px 30px 30px 30px;
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 15px rgba(0,0,0,0.2);
}
.side-menu.open {
  transform: translateX(0);
}
.hero-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-image: url("/fondo-finca.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 60px;
}
#chat-wrapper {
  position: relative;
  z-index: 10;
  width: 95%;
  max-width: 500px;
  height: 75vh;
  background: var(--chat-bg);
  backdrop-filter: blur(var(--blur-level));
  -webkit-backdrop-filter: blur(var(--blur-level));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: height 0.3s ease;
}
.glass-section {
  padding: 80px 20px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--primary);
  position: relative;
}
.section-content {
  max-width: 1000px;
  margin: 0 auto;
}
footer {
  background: var(--primary);
  color: white;
  padding: 60px 20px 20px;
  border-top: 5px solid var(--accent);
}
.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 {
color: #FFFFFF !important;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
}
.footer-col a {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.3s;
}
.footer-col a:hover {
  color: var(--accent);
  padding-left: 5px;
}
.footer-col p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85em;
  opacity: 0.7;
}
#aproposito img {
  width: 100%;
  height: auto !important;
  max-height: 500px;
  object-fit: cover;
  border-radius: 15px;
  display: block;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
#aproposito .glass-card div[style*="flex: 1.5"] {
  padding-right: 25px;
  box-sizing: border-box;
}
#chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
  padding-bottom: 110px !important;
  overflow-y: auto;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
  min-height: 300px;
  contain: content;
}
#chat-window::-webkit-scrollbar {
  display: none;
}
#historias {
  padding: 60px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  max-width: 1100px;
  margin: 0 auto;
}
.section-title {
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  text-align: center;
  font-family: "Merriweather", serif;
  font-size: 2.2em;
  color: var(--primary);
  margin-bottom: 40px;
}
#input-area {
  padding: 12px 15px !important;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(15px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
}

/* --- Componentes --- */

.menu-list a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-family: "Merriweather", serif;
  font-size: 1.2em;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: block;
}
#order-bar {
  position: absolute;
  bottom: 115px;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  background: #25D366;
  color: white;
  padding: 10px 20px;
  border-radius: 50px;
  display: none;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  z-index: 100;
  cursor: pointer;
  animation: pulse-green 2s infinite;
  min-height: 65px;
  box-sizing: border-box;
  overflow: hidden;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--primary);
  background: white;
  color: var(--primary);
  font-weight: bold;
  cursor: pointer;
}
.qty-btn.plus {
  background: var(--primary);
  color: white;
}
.message {
  max-width: 85%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 0.95em;
  line-height: 1.5;
}
.bot {
  align-self: flex-start;
  background: #FFFFFF;
}
.user {
  align-self: flex-end;
  background: var(--primary);
  color: white;
}
.chip {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  color: #1B4D3E;
  border: none;
  padding: 12px 5px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}
.legal-links {
  margin-top: 10px;
}
.legal-links a {
  color: white;
  text-decoration: none;
  margin: 0 5px;
}
.glass-input {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 12px;
  font-family: "Lato", sans-serif;
  outline: none;
  box-sizing: border-box;
  display: block;
}
.glass-input:focus {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--primary);
}
.btn-submit {
  background: var(--primary);
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 50px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  transition: 0.3s;
}
.btn-submit:hover {
  transform: scale(1.02);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
#contact-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: var(--primary);
  font-size: 0.9em;
}
.chat-card-container {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding: 10px 5px;
  cursor: grab;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chat-card-container:active {
  cursor: grabbing;
}
.chat-card-container::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}
.chat-product-card {
  flex-shrink: 0;
  min-width: 260px;
  max-width: 260px;
  background: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}
.chat-product-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
}
.chat-product-card .info {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.chat-product-card h4 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  color: var(--primary);
}
.chat-product-card p {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  display: flex;
  opacity: 1;
}
.modal-content {
  background: #fff;
  color: #333;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  padding-top: 40px;
}
.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
  cursor: pointer;
  line-height: 1;
}
.modal-text h4 {
  margin-top: 20px;
  color: var(--primary);
}
.ami-icon {
  font-size: 1.3rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}
.ami-icon:hover {
  color: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}
.ami-icon.active#btn-light {
  color: #FFD700;
  text-shadow: 0 0 10px #FFD700;
}
.ami-icon.active#btn-night {
  color: #82CFFD;
  text-shadow: 0 0 10px #82CFFD;
}
.ami-icon.active#btn-auto {
  color: #00E676;
  text-shadow: 0 0 10px #00E676;
}
.blog-render {
  line-height: 1.8;
  color: #333;
  font-size: 1.1rem;
}
.blog-render img {
  max-width: 100%;
  height: auto;
  border-radius: 15px;
  margin: 20px 0;
}
.blog-render h1, .blog-render h2 {
  font-family: "Merriweather", serif;
  color: var(--primary);
  margin-top: 30px;
}
.blog-contenido-render p {
  margin-bottom: 1.5em;
  font-size: 1.1rem;
  line-height: 1.8;
}
.blog-contenido-render h2 {
  margin-top: 2em;
  color: var(--primary);
  font-family: "Merriweather", serif;
}
.glass-card {
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}
.glass-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.glass-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 15px;
}
#top-row-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}
.chip-small {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}
.chip-special {
  flex: 1;
  background: var(--accent);
  color: #000000 !important;
  border: none;
  border-radius: 50px;
  padding: 4px 15px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(212, 163, 115, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s;
  white-space: nowrap;
}
.chip-special:active {
  transform: scale(0.96);
}
#chips-scroll-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.chat-card-container::-webkit-scrollbar,
#chips-scroll-row::-webkit-scrollbar {
  display: none;
}
.chip-carousel {
  flex: none;
  background: white;
  color: #1B4D3E;
  border: none;
  padding: 10px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
#chips-interface {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 5px 0;
}

/* --- Media Queries / Responsive --- */

@media (max-width: 768px) {

  #aproposito .glass-card {
    flex-direction: column !important;
    align-items: center !important;
    padding: 25px 20px !important;
  }

  #aproposito .glass-card > div {
    width: 100% !important;
    min-width: 100% !important;
    flex: none !important;
    padding-right: 0 !important;
  }

  #aproposito img {
    margin-bottom: 25px;
    max-height: none !important;
  }

  #aproposito h3 {
    text-align: center;
    margin-top: 0;
  }

  #aproposito .glass-card div[style*="flex: 1.5"] {
    padding-right: 0;
    padding-top: 15px;
  }

  .section-title {
    font-size: 1.8em;
  }

  .grid-cards {
    gap: 15px;
  }

.nav-logo img {
    height: 90px !important; /* <--- ESTO ES LA CLAVE PARA EL CELULAR */
  }
  
  .nav-logo {
    top: 10px;
    left: 10px;
  }
}

/* 4. Aseguramos que la barra de navegación no estorbe */
.main-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0; /* Truco: altura 0 para que no empuje nada */
  padding: 0;
  margin: 0;
  z-index: 49;
}

    
}




@media (max-height: 500px) and (orientation: landscape) {

  #chat-wrapper {
    height: 95vh;
    margin-top: 5px;
  }

  .hero-section {
    padding-top: 10px;
  }

  .nav-logo img {
    height: 60px;
  }

  #chat-header {
    padding: 8px 15px;
  }

}


/* Refuerzo para botones sociales */
.btn-submit[href*="instagram"], 
.btn-submit[href*="facebook"],
.btn-submit[href*="tiktok"] {
  font-weight: 900 !important; /* Letra extra gruesa */
  text-shadow: 0 1px 2px rgba(0,0,0,0.2); /* Sombra para separar del fondo */
}


