@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&family=Playfair+Display:wght@700&display=swap");

:root {
  /* 60% Neutro (Fondo) */
  --background-color: #f8f9fa; /* Gris muy claro, casi blanco, para el fondo general */
  --card-bg: #ffffff;        /* Blanco puro para tarjetas */
  --text-color: #2d3436;     /* Gris oscuro para texto (alto contraste) */

  /* 30% Violeta (Estructura/Secundario) */
  --secondary-color: #6c5ce7; /* Violeta principal para iconos y detalles */
  --header-text-color: #6c5ce7; /* Mismo violeta para algunos títulos */
  --nav-link-color: #4a4a4a; /* Gris para navegación normal, hover violeta */

  /* 10% Fucsia (Acento/Acción) */
  --primary-color: #e84393;   /* Fucsia vibrante para botones de COMPRA/ACCIÓN */
  --accent-color: #ff7675;    /* Color auxiliar */

  /* Utilidades */
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.05); /* Sombra suave moderna */
}

/* Image Modal (Lightbox) */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.active {
    display: flex; /* Use flex to center */
    opacity: 1;
}

/* Ensure no other display overrides from bad CSS cascading */
div#image-modal {
    display: none;
}
div#image-modal.active {
    display: flex;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s;
    object-fit: contain;
}

.image-modal.active .image-modal-content {
    transform: scale(1);
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 10001;
}

/* Cursor pointer for main image */
/* Cursor pointer for main image */
.main-image {
    cursor: zoom-in;
}

:root {
  /* ... Previous variables are defined above ... */
  /* Re-adding variables that were orphaned */
  --radius: 12px;

  /* Gradients */
  --btn-gradient: linear-gradient(135deg, #e84393 0%, #d63031 100%);
  --bg-gradient: #f8f9fa; /* Fondo sólido limpio */
}


html {
  font-size: 16px; /* Force base size to override external resets */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Quicksand", sans-serif;
}

body {
  background: var(--background-color); /* Neutral */
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
}

/* --- ESTILOS HEADER HÍBRIDO (Index y Producto) --- */
header,
header.mobile-header {
  background-color: var(--secondary-color);
  color: white;
  padding: 1rem 2rem;
  display: flex; /* Flex por defecto */
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Logo */
.logo-text,
header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 150px;
}
.logo-text a {
  text-decoration: none;
  color: inherit;
}

/* Nav Central Desktop */
nav,
nav#main-nav {
  display: block;
  flex: 1; /* Ocupa espacio central */
}

nav ul,
nav#main-nav ul {
  display: flex;
  justify-content: center; /* Centrado */
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

nav a,
nav#main-nav a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.3s;
}

nav a:hover,
nav#main-nav a:hover {
  color: white;
  opacity: 1;
}

.desktop-search-item {
  display: block;
}

/* Actions Right */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 50px;
  justify-content: flex-end;
}

.action-icon {
  font-size: 1.2rem;
  color: white;
  text-decoration: none;
  position: relative;
  display: inline-block;
}

/* Elementos Mobiles ocultos en Desktop */
.menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
}

.search-icon-mobile {
  display: none !important;
}

.cart-icon-mobile {
  display: none !important;
  cursor: pointer;
}

.mobile-cart-badge {
  position: absolute;
  top: -5px;
  right: -8px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-menu-btn {
  display: none;
}

/* --- MEDIA QUERY MOBILE (<768px) --- */
@media (max-width: 768px) {
  header,
  header.mobile-header {
    padding: 1rem 1.5rem;
    justify-content: space-between;
  }

  .menu-toggle-btn {
    display: block;
    order: 1;
  }

  .logo-text,
  header h1 {
    font-size: 1.4rem;
    margin: 0 0.5rem;
    text-align: left;
    flex: 1;
    order: 2;
  }

  .header-actions {
    order: 3;
    gap: 15px;
    min-width: auto;
  }

  .search-icon-mobile {
    display: block !important;
  }

  .cart-icon-mobile {
    display: block !important;
  }

  /* Nav Sidebar Mobile */
  nav,
  nav#main-nav {
    position: fixed;
    top: 0;
    left: -100%; /* Oculto */
    width: 250px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    order: unset;
    margin-top: 0;
  }

  nav.active,
  nav#main-nav.active {
    left: 0;
  }

  nav ul,
  nav#main-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
  }

  .desktop-search-item {
    display: none;
  }

  .close-menu-btn {
    display: block;
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #555;
  }

  /* RESTAURADO: Botón Flotante Carrito en Mobile */
  /* El usuario pidió explícitamente corregir que se eliminó el botón flotante.
       Así que nos aseguramos de que .cart-toggle sea visible. */
  .cart-toggle {
    display: flex !important; /* Forzamos visibilidad */
  }


}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Hero Seccion */
.hero-section {
  background: #ffffff; /* White clean hero */
  border-radius: 30px;
  padding: 4rem;
  margin-bottom: 4rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  text-align: left;
}

.hero-content {
  flex: 1;
  max-width: 500px;
}

.hero-section h1 {
  font-family: "Playfair Display", serif;
  font-size: 3.5rem;
  color: #333;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.hero-section p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 2.5rem;
  font-weight: 400;
}

.btn-hero {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-size: 1.1rem;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.btn-hero:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
  background-color: var(--accent-color);
}

.hero-image-container {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
}

.hero-image-container img {
  max-width: 100%;
  height: auto;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; /* Organic shape */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  transition: all 0.5s ease;
}

.hero-image-container img:hover {
  border-radius: 50%;
  transform: scale(1.02);
}

@media (max-width: 968px) {
  .hero-section {
    flex-direction: column-reverse;
    text-align: center;
    padding: 3rem 1.5rem;
    gap: 2rem;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-section h1 {
    font-size: 2.5rem;
  }
}

/* Features Section */
.features-section {
  text-align: center;
  margin-bottom: 4rem;
}

.features-section h2 {
  font-size: 2rem;
  color: var(--header-text-color);
  margin-bottom: 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: inline-block;
}

.feature-card h3 {
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

/* Product Grid */
.section-title {
  text-align: center;
  font-size: 2rem;
  color: var(--header-text-color);
  margin-bottom: 2rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  border: 2px solid transparent;
  position: relative; /* Needed for absolute positioning of offer badge */
}

.product-card:hover {
  transform: translateY(-10px);
  border-color: var(--secondary-color);
}

.offer-tag {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: var(--primary-color);
  color: white;
  padding: 0.25rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  border-radius: 15px;
  margin-bottom: 1rem;
}

.product-card h3 {
  margin-bottom: 0.5rem;
  color: var(--text-color);
  font-size: 1.2rem;
}

.product-card .price {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.original-price {
    text-decoration: line-through;
    color: #aaa;
    font-size: 0.9rem;
    margin-right: 5px;
}

.offer-price {
    color: var(--primary-color); /* Red vibrant moved to Fuchsia/Pink */
    font-weight: bold;
    font-size: 1.4rem;
}

.product-card .description {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.add-to-cart-btn {
    width: 100%;
    padding: 0.5rem;
    background: var(--btn-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: auto; /* Push to bottom if flex column */
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: var(--btn-gradient);
  color: white;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-danger {
  background-color: #ffdac1;
  color: #555;
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 350px;
  height: 100%;
  background: white;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  border-top-left-radius: 30px;
  border-bottom-left-radius: 30px;
}

.cart-sidebar.open {
  right: 0;
}

.cart-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--btn-gradient);
  color: white;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 999;
  transition: transform 0.3s;
}

.cart-toggle:hover {
  transform: rotate(10deg) scale(1.1);
}

.cart-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid white;
}

/* Admin Specific Overrides */
.admin-table th {
  background-color: var(--secondary-color);
  color: white;
}

/* Admin Button in Header */
.admin-header-btn {
  color: white;
  font-size: 1.2rem;
  opacity: 0.7;
  text-decoration: none;
  transition: opacity 0.3s;
  margin-left: 1rem;
}

.admin-header-btn:hover {
  color: var(--primary-color);
}

/* Mobile Responsive Header OLD OVERRIDES REMOVED since we integrated them above */

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #6b7c93;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid #ffe5ec; /* Light pink border */
  border-radius: 12px;
  font-size: 1rem;
  color: #555;
  background-color: #fff;
  transition: all 0.3s ease;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(255, 154, 162, 0.1);
}

.form-group input[type="file"] {
  padding: 0.5rem;
  background-color: #f9f9f9;
  border: 2px dashed #b5ead7;
  cursor: pointer;
}

.form-group input[type="file"]:hover {
  background-color: #f0fff4;
}

/* Admin Specific Styles */
.admin-card {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.admin-card h2 {
  color: #9d8189;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 0.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

.admin-table th,
.admin-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.admin-table th {
  background-color: var(--secondary-color);
  color: #555;
  font-weight: 700;
}

.admin-table tr:hover {
  background-color: #f9f9f9;
}

.admin-table img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.admin-table td {
  vertical-align: middle;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Search Bar */
.search-container {
  max-width: 600px;
  margin: 0 auto 2rem;
  text-align: center;
}

.search-container input {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 2px solid #ffe5ec;
  border-radius: 50px;
  font-size: 1.1rem;
  outline: none;
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.search-container input:focus {
  border-color: var(--primary-color);
  transform: scale(1.02);
}

/* Footer */
footer {
  background-color: var(--secondary-color); /* Violeta */
  color: #ffffff;
  padding: 3rem 2rem 1rem;
  margin-top: 4rem;
  border-top-left-radius: 50px;
  border-top-right-radius: 50px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  text-align: center;
}

.footer-section h3 {
  color: #ffffff;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-section p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.social-links a {
  color: #ffffff;
  font-size: 1.5rem;
  transition: color 0.3s, transform 0.3s;
}

.social-links a:hover {
  color: var(--primary-color);
  transform: translateY(-3px);
}

/* Product Details Page */
.product-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  background: white;
  padding: 2rem;
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.gallery-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.main-image {
  width: 100%;
  height: 400px;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}

.main-image:hover {
  transform: scale(1.02);
}

.thumbnails {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.thumbnail:hover,
.thumbnail.active {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.product-info h2 {
  font-size: 1.8rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.product-category {
  display: inline-block;
  background: #b5ead7;
  color: #555;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.product-full-description {
  grid-column: 1 / -1;
  margin-top: 2rem;
  border-top: 1px solid #eee;
  padding-top: 2rem;
}

.description-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.description-tab {
  padding: 0.5rem 2rem;
  font-size: 1.1rem;
  color: #555;
  border-bottom: 3px solid var(--primary-color);
  font-weight: bold;
  cursor: default;
}

.description-content {
  color: #666;
  line-height: 1.8;
  font-size: 1rem;
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
  margin-bottom: 1.5rem;
}

.product-price {
  font-size: 2rem;
  color: var(--primary-color);
  font-weight: bold;
  margin-bottom: 1.5rem;
}

.product-description {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #666;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .product-details-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem;
  }

  .main-image {
    height: 300px;
  }

  .product-info h2 {
    font-size: 1.5rem;
  }
}

/* Fix Footer Alignment */
.footer-bottom {
  text-align: center !important;
  width: 100%;
  display: block;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.9rem;
}

.footer-bottom p {
  margin: 0;
  text-align: center;
  width: 100%;
}

/* Contact Section */
.contact-section {
  margin-bottom: 4rem;
}

.contact-container {
  display: flex;
  gap: 2rem;
  background: white;
  padding: 2rem;
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.contact-form-wrapper {
  flex: 1;
}

.contact-map-wrapper {
  flex: 1;
  border-radius: 20px;
  overflow: hidden;
  min-height: 350px;
}

/* --- MODAL UTILS STYLES (Alert & Confirm) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000; /* Asegurar que esté encima de todo */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: white;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
  width: 90%;
  transform: scale(0.8);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-box.active {
  transform: scale(1);
}

.modal-content {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: #555;
  font-weight: 600;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.modal-buttons .btn {
  min-width: 100px;
}

/* --- DROPDOWN MENU STYLES --- */
/* Parent container in Nav */
.nav-item-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-item-dropdown > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
}

/* Level 1 Menu (Marcas) */
.dropdown-menu {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 240px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); /* Sombra más dramática */
    z-index: 1000;
    border-radius: 16px;
    padding: 1.5rem 0; /* Más padding vertical al contenedor */
    list-style: none;
    flex-direction: column;
    gap: 0 !important;
    border: 1px solid rgba(0,0,0,0.05);
}

.dropdown-header {
    padding: 1rem 2rem; /* Mucho padding para el titulo */
    color: #AAB7C4;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    pointer-events: none;
    margin-bottom: 0.2rem;
}

/* Solo mostrar con hover o clase explicita */
.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown.show .dropdown-menu {
    display: block !important;
}

/* Items Styles (Restoring missing styles) */
.dropdown-menu li {
    width: 100%;
    position: relative;
}

.dropdown-menu li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem; /* Mucho más aire horizontal */
    color: #555;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, padding-left 0.2s;
}

.dropdown-menu li a:hover {
    background-color: #FFF0F3;
    color: var(--primary-color);
    padding-left: 2.5rem; /* Efecto slide adaptado */
}

/* Level 2 Menu (Tallas) */
/* Level 2 Menu (Tallas) */
.dropdown-submenu .submenu {
    display: none !important;
    position: absolute;
    top: -10px;
    left: 100%;
    margin-left: 15px; /* Más separación del padre */
    background-color: white;
    min-width: 220px; /* Mucho más ancho */
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 1.5rem 0; /* Más padding vertical */
    list-style: none;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Solo mostrar submenu si se hace hover directametne sobre SU li padre */
.dropdown-submenu:hover > .submenu {
    display: block !important;
}

/* Mobile Adjustments (Sidebar) */
@media (max-width: 768px) {
    .nav-item-dropdown {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .nav-item-dropdown:hover .dropdown-menu {
        display: none; /* Disable hover on mobile */
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        padding-left: 1rem;
        display: none; /* Hidden by default */
        width: 100%;
        background: #f9f9f9;
        margin-top: 0.5rem;
    }

    /* Logic for Click to Open in Mobile would require JS to toggle 'active' class on .nav-item-dropdown */
    .nav-item-dropdown.active-mobile > .dropdown-menu {
        display: flex;
    }
    
    .dropdown-submenu .submenu {
        position: static;
        display: none;
        box-shadow: none;
        padding-left: 1rem;
        background: #f0f0f0;
    }

    .dropdown-submenu.active-mobile > .submenu {
        display: block;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- FIX: SCROLL MARGINS (Header Overlap) --- */
.search-container,
.products-section,
.product-grid,
#productos {
    scroll-margin-top: 180px; /* Zona de respeto para que el header fijo no tape el contenido al hacer scroll */
}

/* --- MOBILE FIX: 2 Column Product Grid --- */
/* Placed at the end to ensure it overrides the default grid styles */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem;
  }
}

/* --- MOBILE FIX: Contact Section Stack --- */
@media (max-width: 768px) {
  .contact-container {
    flex-direction: column;
  }
  
  .contact-map-wrapper {
    min-height: 300px; /* Adjust height if needed */
  }
}

/* --- LOGIN PAGE STYLES --- */
.auth-container {
    background-color: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px; /* Ancho máximo controlado */
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.05);
}

.login-image {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.login-image img {
    max-width: 180px; /* Reducir imagen drásticamente */
    height: auto;
    object-fit: contain;
}

.login-form-wrapper {
    width: 100%;
}

.login-form-wrapper h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color); /* Violeta */
    margin-bottom: 1.5rem;
    text-align: center !important; /* Force center */
}

.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.auth-container .btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* --- ADMIN MOBILE HEADER FIXES --- */
@media (max-width: 768px) {
    .admin-greeting {
        display: none !important;
    }
    
    .logout-text {
        display: none !important;
    }

    .admin-header-actions {
        order: 3 !important;
    }
    
    header h1 {
        font-size: 1.2rem; /* Make title smaller to fit */
    }

    #logout-btn {
        padding: 0.5rem 0.8rem; /* Compact button */
    }
}

/* --- RESPONSIVE FORM ROW (PRODUCT) --- */
.form-row-responsive {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* --- MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {
    .form-row-responsive {
        grid-template-columns: 1fr; /* Stack vertically on mobile */
    }
    
    /* Sales Filter Form Compact */
    .filters-controls {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .filters-controls .form-group {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .filters-controls label {
        font-size: 0.85rem !important;
    }

    .filters-controls input {
        font-size: 0.9rem !important;
        padding: 0.4rem !important;
    }

    .filter-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .filter-actions button {
        flex: 1; /* Buttons share width */
        font-size: 0.9rem;
    }
    
    /* Sales Table Compact View */
    #sales-view .admin-table th, 
    #sales-view .admin-table td {
        font-size: 1.0rem !important; 
        padding: 0.4rem 0.2rem !important;
    }
}

/* --- ADMIN TABLE HEADERS --- */
.admin-table th {
    color: white !important; /* Force white text for better visibility */
}

/* --- SALES VIEW DETAILS BUTTON FIX --- */
.view-details-btn {
    padding: 2px 6px !important; /* Smaller padding */
    font-size: 0.8rem !important; /* Smaller icon */
    line-height: 1; /* Tighter line height */
}

/* --- ESTILOS DEFINITIVOS HEADER (Unified) --- */

/* 1. Base Styles (Desktop Default) */
header.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Logo Left, Nav Center, Actions Right */
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    background: var(--secondary-color); /* Violeta */
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Logo */
.logo-text {
    font-size: 1.8rem;
    color: white;
    min-width: 150px;
}

/* Nav Central */
nav#main-nav {
    display: block;
    flex: 1; /* Ocupa el espacio central */
}

nav#main-nav ul {
    display: flex;
    justify-content: center; /* Centrar items */
    align-items: center;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

nav#main-nav a {
    text-decoration: none;
    color: white; /* Color blanco para nav principal */
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s;
}

/* Override para submenus: Texto NEGRO */
nav#main-nav .dropdown-menu a,
nav#main-nav .submenu a {
    color: #333 !important; /* Negro para submenus sobre fondo blanco */
    font-size: 1rem; /* Ajuste opcional para submenus */
}

nav#main-nav a:hover {
    color: #FF9AA2;
}

.desktop-search-item {
    display: block;
}

/* Actions Right */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 50px;
    justify-content: flex-end;
}

.action-icon {
    font-size: 1.3rem; 
    color: white;
    text-decoration: none;
    position: relative;
}

.search-icon-mobile {
    display: none !important; /* Oculto en desktop, usamos el del nav */
}

.cart-icon-mobile {
    display: none !important; /* Oculto en desktop */
}

.menu-toggle-btn {
    display: none; /* Oculto en desktop */
}

.mobile-cart-badge {
    position: absolute; top: -5px; right: -8px; 
    background: #FF6B6B; color: white; border-radius: 50%; 
    width:16px; height:16px; font-size:0.7rem; display:flex; 
    align-items:center; justify-content:center;
}

.close-menu-btn { display: none; }


/* 2. Media Query (Mobile) */
@media (max-width: 768px) {
    header.mobile-header {
        padding: 1rem 1.5rem;
        justify-content: space-between;
    }

    .menu-toggle-btn {
        display: block;
        background: none; border: none; font-size: 1.6rem; color: white;
        order: 1;
    }

    .logo-text {
        font-size: 1.4rem;
        margin: 0 0.5rem;
        text-align: left; /* O center si prefiere */
        flex: 1;
        order: 2;
    }

    .header-actions {
        order: 3;
        gap: 15px;
        min-width: auto;
    }

    .search-icon-mobile {
        display: block !important; /* Visible mobile */
    }

    .cart-icon-mobile {
        display: block !important; /* Visible mobile */
    }

    /* Nav se oculta y convierte en Sidebar */
    nav#main-nav {
        position: fixed; top: 0; left: -100%;
        width: 250px; height: 100vh;
        background: white;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        z-index: 2000;
        transition: left 0.3s ease;
        display: flex; flex-direction: column;
        padding: 2rem;
    }

    nav#main-nav.active { left: 0; }

    nav#main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }
    
    nav#main-nav a { 
        font-size: 1.2rem; 
        color: #6B7C93; /* Restaurar color oscuro en menu movil sidebar */
    }

    .desktop-search-item {
        display: none; /* Ocultar Lupa del menu sidebar, ya esta en header */
    }

    .close-menu-btn {
        display: block;
        align-self: flex-end;
        background: none; border: none; 
        font-size: 2rem; margin-bottom: 1rem; color: #555;
    }
    
    .cart-toggle { display: none; } /* Ocultar flotante */
}

/* 
   -------------------------------------------------------------------------
   MEJORAS DISEÑO MÓVIL (Compacto y Profesional) 
   Solicitud: Cards más cuadradas, menos altura, ajustes de fuentes y botones.
   -------------------------------------------------------------------------
*/
@media (max-width: 768px) {
    /* Forzar grid de 2 columnas con espacio reducido */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.8rem !important;
        padding: 0 0.5rem; /* Pequeño margen lateral */
    }

    /* Tarjeta compacta */
    .product-card {
        padding: 0.8rem !important;
        min-height: auto;
        border-radius: 10px;
        display: flex;
        flex-direction: column;
    }

    /* Imagen más pequeña y ajustada */
    .product-card img {
        height: 120px !important;
        margin-bottom: 0.5rem !important;
        border-radius: 8px;
        object-fit: contain; /* Mejor para ver producto completo sin corte */
        background: #f9f9f9; /* Fondo suave si la img es png */
    }

    /* Título más pequeño y truncado si es muy largo */
    .product-card h3 {
        font-size: 0.9rem !important;
        margin-bottom: 0.2rem !important;
        line-height: 1.2;
        /* Limitar a 2 líneas */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        height: 2.2rem;
    }

    /* Ocultar descripción y otros textos secundarios, EXCEPTO TALLA */
    .product-card .description, 
    .product-card p:not(.price):not(.product-size) {
        display: none !important;
    }
    
    .product-size {
        font-size: 0.85rem !important;
        margin-bottom: 0.3rem !important;
    }
      
    /* Precio Compacto */
    .product-card .price {
        font-size: 1.1rem !important;
        margin-bottom: 0.4rem !important;
        margin-top: auto; 
    }
    
    /* Botón más pequeño */
    .add-to-cart-btn {
        padding: 0.5rem !important;
        font-size: 0.85rem !important;
        border-radius: 8px;
    }
    
    /* Ajustar badge de oferta */
    .offer-tag {
        top: 8px;
        right: 8px;
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
    }
}



/* --- HERO CAROUSEL STYLES --- */
.hero-section.has-carousel {
    padding: 0 !important;
    overflow: hidden;
    position: relative;
    display: block !important;
    min-height: auto; 
}

.hero-slider-container {
    position: relative;
    width: 100%;
}

.hero-slide {
    width: 100%;
    top: 0;
    left: 0;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Static Slide (Text) - Defines Height */
.hero-slide-static {
    position: relative;
    z-index: 1;
    opacity: 1; /* Always holds space */
}

/* Overlay Slide (Banner) - Sits on top */
.hero-slide-overlay {
    position: absolute;
    height: 100%;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    background: white; /* Prevent transparent background issues */
}

.hero-slide-overlay.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* Slide 1 Content Wrapper matches original flex layout */
.hero-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 4rem; 
    gap: 4rem;
}

/* Ensure images in banner slide fit */
.promo-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Keeps container filled */
    border-radius: 30px; 
}

/* Dots Navigation */
.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 20;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active {
    background-color: var(--primary-color);
}

/* Ensure images in banner slide fit */
.promo-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px; 
}



/* 
   -------------------------------------------------------------------------
   ADMIN TABS HORIZONTAL SCROLL (MOBILE)
   -------------------------------------------------------------------------
*/
.admin-tabs-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

@media (max-width: 768px) {
    .admin-tabs-container {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px; /* Space for scrollbar */
        -webkit-overflow-scrolling: touch;
        
        /* Optional: Hide scrollbar for cleaner look */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none;  /* IE 10+ */
    }
    
    .admin-tabs-container::-webkit-scrollbar { 
        display: none; /* Chrome/Safari */
    }

    .admin-tabs-container .btn {
        flex-shrink: 0; /* Prevent buttons from shrinking */
    }
}

/* 
   -------------------------------------------------------------------------
   PAGINATION CONTROLS
   -------------------------------------------------------------------------
*/
.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    align-items: center;
}

.pagination-controls .pagination-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1rem;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: var(--primary-color);
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.pagination-controls .pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.pagination-controls .pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9f9f9;
    color: #ccc;
    box-shadow: none;
}
