/* ================================================================= */
/* 1. CONFIGURACIÓN BASE, PALETA DE COLORES Y TIPOGRAFÍAS DE RAÍZ */
/* ================================================================= */
:root {
  --primary-color: #2b6cb0;
  --primary-hover: #2c5282;
  --secondary-color: #319795;
  --dark-color: #2d3748;
  --light-color: #f7fafc;
  --border-color: #e2e8f0;
  --text-muted: #718096;
  --success-color: #48bb78;
  --danger-color: #f56565;
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --transition-fast: all 0.2s ease;
  --transition-normal: all 0.3s ease;
  --box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--light-color);
  color: var(--dark-color);
  line-height: 1.5;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

li {
  list-style: none;
}
/* ================================================================= */
/* 2. BARRA DE NAVEGACIÓN SUPERIOR (NAVBAR) Y SUBMENÚ MULTIPÁGINA */
/* ================================================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 999;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  height: 45px;
  width: 45px;
  border-radius: 50%;
  object-fit: cover;
}

.brand-name {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--dark-color);
  white-space: nowrap;
}

/* Enlaces de Navegación */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--dark-color);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.nav-links li a:hover {
  background-color: var(--light-color);
  color: var(--primary-color);
}

.svg-icon {
  color: var(--text-muted);
}

/* Controles del Lado Derecho */
.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cart-toggle-btn {
  background: none;
  border: none;
  position: relative;
  cursor: pointer;
  color: var(--dark-color);
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.cart-toggle-btn:hover {
  background-color: var(--light-color);
  color: var(--primary-color);
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--success-color);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 4px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-color);
}

/* ================================================================= */
/* CONFIGURACIÓN EXCLUSIVA PARA EL SUBMENÚ EN ESCRITORIO (MIN-WIDTH: 1025px) */
/* ================================================================= */
@media (min-width: 1025px) {
  .branch-products-item {
    position: relative;
  }
  
  .branch-products-item:hover .multipage-submenu {
    display: block !important;
    opacity: 1;
    visibility: visible;
  }

  .multipage-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    background-color: #ffffff;
    min-width: 260px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 0 0 8px 8px;
    padding: 0.5rem 0;
    z-index: 1000;
    border: 1px solid var(--border-color);
  }
  
  .multipage-submenu li {
    width: 100%;
  }

  .multipage-submenu li a {
    white-space: nowrap !important;
    text-align: left !important;
    justify-content: flex-start !important;
    padding: 0.8rem 1.5rem !important;
    border-radius: 0 !important;
  }

  .multipage-submenu li a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
  }
}

/* DISPOSITIVOS MÓVILES Y TABLETS (MAX-WIDTH: 1024px) */
@media (max-width: 1024px) {
  .nav-toggle {
    display: block;
  }

  .nav-container {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-top: 1px solid var(--border-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
  }

  .nav-container.active {
    max-height: 500px;
  }

  .nav-links {
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links li a {
    justify-content: center;
    padding: 0.75rem 0;
  }

  .branch-products-item.open .multipage-submenu {
    display: block !important;
  }
  
  .multipage-submenu {
    display: none;
    background-color: var(--light-color) !important;
    width: 100%;
    padding: 0;
    list-style: none;
    border-radius: 6px;
    margin-top: 0.25rem;
  }
  
  .multipage-submenu li a {
    justify-content: center !important;
    padding: 1rem 0 !important;
    font-weight: 500;
  }
}
/* ================================================================= */
/* 3. CONTENIDO CENTRAL, HERO BANNER Y GRILLA DE PRODUCTOS */
/* ================================================================= */
.content {
  margin-top: 70px;
  min-height: calc(100vh - 70px);
}

/* Hero Section - Proporción Panorámica con Enfoque 100% en la Cara del Abuelo */
.hero-section {
  position: relative;
  max-width: 1200px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
}

.hero-banner {
  width: 100%;
  /* Define una proporción de aspecto limpia y alargada (tipo banner de alta gama) */
  aspect-ratio: 21 / 9; 
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background-color: #ffffff;
}

/* Hero Section - Réplica de Proporción con Rostro y Barba Completa al 100% */
.hero-section {
  position: relative;
  max-width: 1200px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
}

.hero-banner {
  width: 100%;
  height: 400px; /* Estructura rectangular estirada idéntica a tu foto */
  position: relative;
  border-radius: 20px; /* Curvatura perfecta de las esquinas */
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Rellena el marco de forma limpia */
  /* Ajuste de Precisión: Cámara al 35% para centrar perfectamente su gorro, anteojos y barba completa */
  object-position: center 35% !important; 
  display: block;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent; /* Imagen limpia y brillante sin capas oscuras */
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Alinea los textos en la base de la foto */
  align-items: flex-start; /* Alinea los textos hacia la izquierda */
  text-align: left;
  padding: 3rem; /* Separación desde los bordes del marco */
}

.hero-overlay h2 {
  font-size: 3rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.5rem;
  /* Sombra de contorno de alta definición para leer sobre los colores del kiosco */
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.9), -1px -1px 0 rgba(0,0,0,0.4);
}

.hero-overlay p {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.9);
}

/* Adaptación Proporcional para Pantallas de Celulares */
@media (max-width: 768px) {
  .hero-section {
    margin: 1rem auto;
  }
  .hero-banner {
    height: 220px; /* Altura ideal en móviles para mantener la misma proporción */
    border-radius: 12px;
  }
  .hero-img {
    object-position: center 32% !important; /* Mantiene la barba y rostro del abuelo en smartphones */
  }
  .hero-overlay {
    padding: 1.5rem;
  }
  .hero-overlay h2 {
    font-size: 1.8rem;
  }
  .hero-overlay p {
    font-size: 0.95rem;
  }
}

/* Sección Catálogo */
.catalog-section {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.category-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Grilla Responsiva de Tarjetas */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

/* Tarjeta del Producto */
.product-card {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: var(--box-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border-color);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.img-container {
  width: 100%;
  height: 250px;
  background-color: #ffffff;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border-color);
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
  padding: 1rem;
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.product-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-info h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
  line-height: 1.4;
}

.price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.stock {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.stock.disponible {
  background-color: #e6fffa;
  color: #234e52;
}

.stock.no-disponible {
  background-color: #fff5f5;
  color: #742a2a;
}

.card-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1.25rem;
}

.btn-detail, .btn-add {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-detail {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--dark-color);
}

.btn-detail:hover {
  background-color: var(--light-color);
  border-color: var(--text-muted);
}

.btn-add {
  background-color: var(--primary-color);
  border: none;
  color: #ffffff;
}

.btn-add:hover {
  background-color: var(--primary-hover);
}

.btn-add:disabled {
  background-color: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Sección de Contacto */
.contact-section {
  background-color: #ffffff;
  padding: 3rem 2rem;
  max-width: 700px;
  margin: 4rem auto;
  border-radius: 12px;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
}

.contact-section h3 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(43,108,176,0.1);
}

.btn-submit {
  width: 100%;
  padding: 0.85rem;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-submit:hover {
  background-color: #287a78;
}

@media (max-width: 480px) {
  .catalog-section { padding: 1rem; }
  .hero-overlay h2 { font-size: 1.8rem; }
  .card-buttons { flex-direction: column; }
}
/* ================================================================= */
/* 4. BARRA LATERAL DESLIZANTE DEL CARRITO DE COMPRAS */
/* ================================================================= */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background-color: #ffffff;
  box-shadow: -5px 0 25px rgba(0,0,0,0.15);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease-in-out;
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--light-color);
}

.cart-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.cart-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark-color);
  padding: 0.25rem;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-fast);
}

.cart-close-btn:hover {
  background-color: var(--border-color);
  color: var(--danger-color);
}

.cart-items-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Fila de Producto dentro del Carrito */
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.cart-item-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.25rem;
  background-color: #ffffff;
}

.cart-item-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cart-item-details h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark-color);
  padding-right: 1.5rem;
}

.cart-item-price {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 700;
}

.cart-quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.btn-qty-minus, .btn-qty-plus {
  background-color: var(--light-color);
  border: 1px solid var(--border-color);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-fast);
}

.btn-qty-minus:hover, .btn-qty-plus:hover {
  background-color: var(--border-color);
  border-color: var(--text-muted);
}

.cart-item-remove {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  position: absolute;
  top: 0;
  right: 0;
  line-height: 1;
  transition: var(--transition-fast);
}

.cart-item-remove:hover {
  color: var(--danger-color);
}

/* Footer del Carrito */
.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--light-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
}

#cartTotalPrice {
  color: var(--primary-color);
}

.btn-checkout {
  width: 100%;
  padding: 0.85rem;
  background-color: var(--success-color);
  color: #ffffff;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-normal);
  text-align: center;
  box-shadow: 0 4px 10px rgba(72,187,120,0.2);
}

.btn-checkout:hover {
  background-color: #38a169;
  transform: translateY(-2px);
}
/* ================================================================= */
/* 5. MODALES EMERGENTES (BIENVENIDA Y DETALLE TÉCNICO DE PRODUCTO) */
/* ================================================================= */
/* Modal de Bienvenida (Estilo Inicial - Intacto) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none; /* Oculto por defecto */
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-box {
  background-color: #ffffff;
  padding: 2.5rem;
  border-radius: 12px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
}

.modal-box h2 {
  font-size: 1.6rem;
  color: var(--dark-color);
  margin-bottom: 1rem;
}

.shipping-alert {
  margin-top: 1rem;
  background-color: var(--light-color);
  padding: 0.5rem;
  border-radius: 6px;
  font-weight: 600;
}

.modal-btn {
  margin-top: 1.5rem;
  padding: 0.75rem 2rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-btn:hover {
  background-color: var(--primary-hover);
}

/* Modal de Especificaciones del Producto */
.product-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none; /* Soluciona la superposición visual */
  justify-content: center;
  align-items: center;
  z-index: 2500;
  padding: 1rem;
}

.product-modal-overlay.active {
  display: flex !important;
}

.product-modal-box {
  background-color: #ffffff;
  width: 100%;
  max-width: 800px;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.product-modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  z-index: 10;
  transition: var(--transition-fast);
}

.product-modal-close:hover {
  color: var(--danger-color);
}

.product-modal-content {
  display: flex;
  flex-direction: row;
}

.modal-left-img {
  flex: 1;
  background-color: #ffffff;
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-right: 1px solid var(--border-color);
}

.modal-left-img img {
  max-height: 350px;
  object-fit: contain;
}

.modal-right-info {
  flex: 1.2;
  padding: 2.5rem 2rem 2rem 2rem;
  display: flex;
  flex-direction: column;
}

.modal-right-info h3 {
  font-size: 1.5rem;
  color: var(--dark-color);
  margin-bottom: 0.5rem;
}

.modal-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.modal-specs {
  background-color: var(--light-color);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.modal-specs p {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.25rem;
}

.modal-specs p span {
  font-weight: 600;
  color: var(--dark-color);
}

.modal-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.btn-add-modal {
  width: 100%;
  padding: 0.85rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
  margin-top: auto;
}

.btn-add-modal:hover {
  background-color: var(--primary-hover);
}

/* Adaptación responsive para pantallas pequeñas */
@media (max-width: 768px) {
  .product-modal-content {
    flex-direction: column;
    max-height: 85vh;
    overflow-y: auto;
  }
  .modal-left-img {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
  }
  .modal-left-img img {
    max-height: 200px;
  }
  .modal-right-info {
    padding: 1.5rem;
  }
}
/* ================================================================= */
/* 6. FORMULARIO STARKEN, PIE DE PÁGINA Y COMPONENTES FLOTANTES */
/* ================================================================= */
/* Formulario Starken */
.starken-section {
  background-color: #ffffff;
  padding: 3rem 2rem;
  max-width: 800px;
  margin: 4rem auto;
  border-radius: 12px;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
}

.starken-container h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--dark-color);
  text-align: center;
}

.btn-back-cart {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition-fast);
}

.btn-back-cart:hover {
  color: var(--primary-color);
}

.form-row {
  display: flex;
  gap: 1.5rem;
}

.form-row .form-group {
  flex: 1;
}

.btn-pay-submit {
  width: 100%;
  padding: 1rem;
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-normal);
  margin-top: 1rem;
  box-shadow: 0 4px 12px rgba(43,108,176,0.2);
}

.btn-pay-submit:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

/* Pie de Página (Footer) */
.footer {
  background-color: var(--dark-color);
  color: #ffffff;
  padding: 3rem 2rem;
  margin-top: 5rem;
  border-top: 5px solid var(--secondary-color);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-info, .footer-map {
  flex: 1;
  min-width: 280px;
}

.footer-info h4, .footer-map h4 {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
  color: #ffffff;
  font-weight: 600;
}

.footer-info p {
  color: #cbd5e0;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.footer-legal {
  margin-top: 1.5rem;
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
}

.map-responsive {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* Botones de Acción Flotantes Periféricos Rápidos */
.floating-actions {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1500;
}

.btn-whatsapp-float {
  background-color: #25d366;
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
}

.btn-whatsapp-float:hover {
  transform: scale(1.1);
  background-color: #128c7e;
}

.btn-scroll-top {
  background-color: var(--dark-color);
  color: white;
  border: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.btn-scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.btn-scroll-top:hover {
  background-color: var(--primary-color);
  transform: translateY(-3px);
}

@media (max-width: 768px) {
  .form-row { flex-direction: column; gap: 0; }
  .footer-container { flex-direction: column; gap: 2rem; }
  .floating-actions { bottom: 1.5rem; right: 1.5rem; }
}
/* ================================================================= */
/* NUEVOS AJUSTES PARA PRODUCTOS AGOTADOS Y LIMPIEZA DE CARRITO */
/* ================================================================= */

/* Botón "No Disponible" en color rojo vibrante */
.btn-add:disabled, .btn-add-modal:disabled {
  background-color: var(--danger-color, #f56565) !important;
  color: #ffffff !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

/* Botón Limpiar Carrito - Actualizado a Fondo Rojo Sólido y Texto Blanco */
.btn-clear-cart {
  width: 100%;
  padding: 0.85rem;
  background-color: var(--danger-color, #f56565) !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-normal);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 10px rgba(245, 101, 101, 0.2);
}

.btn-clear-cart:hover {
  background-color: #e53e3e !important;
  transform: translateY(-2px);
}

/* Fuerza a que el ícono SVG de su interior sea blanco */
.btn-clear-cart svg {
  stroke: #ffffff !important;
}

/* Ajuste fino para el ícono del basurero */
.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
}

.cart-item-remove:hover {
  color: var(--danger-color, #f56565);
}

/* ================================================================= */
/* AJUSTE INTEGRAL: UNIFICACIÓN RECTANGULAR DEL FORMULARIO STARKEN */
/* ================================================================= */

/* Fuerza a que todos los selectores y cajas tengan el mismo marco del RUT */
.starken-section input[type="text"],
.starken-section input[type="tel"],
.starken-section input[type="email"],
.starken-section select {
  width: 100%;
  padding: 0.75rem 1rem !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: 6px !important; /* Esquinas sutiles idénticas al RUT */
  font-family: inherit !important;
  font-size: 1rem !important;
  background-color: #ffffff !important;
  color: var(--dark-color, #2d3748) !important;
  height: 46px !important; /* Altura idéntica estandarizada */
  outline: none !important;
  transition: var(--transition-fast) !important;
  box-sizing: border-box !important;
}

/* Efecto de enfoque azul homogéneo para todos los campos al hacer clic */
.starken-section input:focus,
.starken-section select:focus {
  border-color: var(--primary-color, #2b6cb0) !important;
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1) !important;
}

/* Alineación rectangular del bloque telefónico */
.starken-section .form-group div {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important; /* Une el prefijo con la caja de entrada */
  width: 100% !important;
}

/* Transforma el prefijo +56 9 en una extensión integrada al rectángulo */
.starken-section .form-group div span {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: #edf2f7 !important; /* Color gris suave de pestaña */
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-right: none !important; /* Elimina la línea divisoria interna */
  border-radius: 6px 0 0 6px !important; /* Redondea solo las esquinas izquierdas */
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  color: #4a5568 !important;
  height: 46px !important;
  padding: 0 1rem !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* Ajusta la caja del número de teléfono para que complete el rectángulo */
.starken-section #starkenTelefono {
  border-radius: 0 6px 6px 0 !important; /* Redondea solo las esquinas derechas */
  flex: 1 !important;
}

/* ================================================================= */
/* CONFIGURACIÓN RESPONSIVA TOTAL: CELULARES, TABLETS Y PCS          */
/* ================================================================= */

/* CAPA 1: CELULARES (¡Aquí arreglamos la cabecera, el modal y el footer!) */
@media (max-width: 768px) {
  body {
    padding-top: 75px !important; /* REPARO: Calibración exacta para que suba la página en celulares */
  }

  /* REPARO: Subida controlada del home y banner principal para pegarse de forma premium al menú sin tocarlo */
  .hero-section, 
  .main-banner, 
  .image-principal-contenedor,
  #welcomeModal + div,
  main {
    margin-top: 5px !important;
    padding-top: 0 !important;
  }

  .navbar {
    height: 75px !important;
    padding: 0 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    box-sizing: border-box !important;
  }

  .logo-container {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    max-width: 72% !important;
  }

  .logo {
    height: 35px !important;
    width: 35px !important;
    flex-shrink: 0 !important;
  }

  /* REPARO 1b: Tu marca se leerá COMPLETA y sin cortes en el iPhone */
  .brand-name {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    white-space: normal !important; /* Permite usar 2 líneas compactas si falta espacio */
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.15 !important;
  }

  .header-controls {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }

  /* REPARO 1b: Le da la máxima prioridad al modal para que no choque con la navbar */
  #detailModal, .modal {
    z-index: 100000 !important;
  }

  .modal-content {
    width: 92% !important;
    max-width: 92% !important;
    margin: 20px auto !important;
    padding: 1.5rem !important;
    border-radius: 12px !important;
  }

  /* REPARO 1a: Orden lógico vertical hacia abajo y centrado total del pie de página */
  .footer, footer {
    padding: 2.5rem 1rem !important;
    text-align: center !important;
  }

  .footer p, 
  .footer span, 
  .footer-address,
  .footer-container div {
    display: block !important; /* Cada texto toma su propia línea exclusiva */
    text-align: center !important;
    margin: 0 auto 0.5rem auto !important; /* Espaciado limpio hacia abajo */
    width: 100% !important;
    white-space: normal !important;
  }

  .products-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 1rem !important;
  }

  .cart-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: 200000 !important;
  }
}

/* CAPA 2: TABLETS MEDIANAS (Mantiene tu optimización de iPads y balancea la distancia del home) */
@media (min-width: 769px) and (max-width: 1024px) {
  body {
    padding-top: 90px !important; /* REPARO: Calibración intermedia para que el home baje en tablets */
  }
  .hero-section, 
  .main-banner, 
  .image-principal-contenedor,
  main {
    margin-top: 15px !important;
    padding-top: 0 !important;
  }
  .navbar { padding: 0 2rem !important; }
  .brand-name { font-size: 1.4rem !important; }
  .cart-sidebar { width: 400px !important; }
}

/* CAPA 3: COMPUTADORES Y NOTEBOOKS (Mantiene tu optimización de Escritorio y baja el contenido central) */
@media (min-width: 1025px) {
  body {
    padding-top: 95px !important; /* REPARO: Espacio de aire limpio para que baje el home en PC */
  }
  .hero-section, 
  .main-banner, 
  .image-principal-contenedor,
  main {
    margin-top: 25px !important; /* REPARO: Distancia exacta para replicar la simetría del celular */
    padding-top: 0 !important;
  }
  .brand-name { font-size: 1.8rem !important; }
  .cart-sidebar { width: 450px !important; }
}

/* Estilo premium para los separadores de sección dentro de la pizarra del carro */
.cart-section-header {
  width: 100% !important;
  padding: 0.5rem 0.25rem !important;
  margin-top: 1rem !important;
  margin-bottom: 0.5rem !important;
  border-bottom: 2px dashed #e2e8f0 !important; /* Línea discontinua divisoria muy fina */
  box-sizing: border-box !important;
}

.cart-section-header h5 {
  margin: 0 !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  color: var(--primary-color, #2b6cb0) !important; /* Color destacado de tu marca */
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* =========================================================================
 REPARO DE ALTA GAMA: COMPORTAMIENTO PARA CONTENEDOR FLOATING-ACTIONS
 ========================================================================= */
@media (max-width: 768px) {
    .floating-actions {
        z-index: 99999 !important;
        transition: bottom 0.2s ease-in-out;
    }

    /* Clase de control que se activará cuando el cliente roce el pie de página */
    .floating-actions.frenar-contenedor {
        position: absolute !important;
        bottom: auto !important;
    }
}
