:root {
    --bg-color: #ffffff;
    --text-color: #111111;
    --primary-accent: #f0f0f0;
    --secondary-accent: #e5e5e5;
    --header-bg: rgba(255, 255, 255, 0.8);
    --card-bg: #ffffff;
    --border-color: #e5e5e5;
    --font-family: 'Inter', sans-serif;
    --header-height: 70px;
    --whatsapp-color: #25D366;
    --whatsapp-hover: #20bd5a;
    --error-color: #d32f2f;
    --error-bg: #ffebee;
    --gray-light: #666;
    --gray-dark: #333;
    --shadow-light: rgba(0,0,0,0.1);
    --shadow-medium: rgba(0,0,0,0.2);
    --shadow-dark: rgba(0,0,0,0.3);
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --primary-accent: #2a2a2a;
    --secondary-accent: #3a3a3a;
    --header-bg: rgba(26, 26, 26, 0.8);
    --card-bg: #242424;
    --border-color: #3a3a3a;
    --gray-light: #a0a0a0;
    --gray-dark: #cccccc;
    --shadow-light: rgba(0,0,0,0.3);
    --shadow-medium: rgba(0,0,0,0.5);
    --shadow-dark: rgba(0,0,0,0.7);
}

/* Reset y Estilos Base */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

img { 
    max-width: 100%; 
    height: auto; 
    display: block; 
}

a { 
    text-decoration: none; 
    color: inherit; 
}

button {
    font-family: inherit;
}

/* Encabezado y Navegación */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: var(--header-height);
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--primary-accent);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo { 
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.header-actions { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
    background-color: var(--primary-accent);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    fill: var(--text-color);
    transition: transform var(--transition-fast);
}

.theme-toggle:hover svg {
    transform: rotate(180deg);
}

.theme-toggle .moon-icon {
    display: block;
}

.theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

/* Language Dropdown */
.language-dropdown {
    position: relative;
}

.language-current {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background-color: var(--primary-accent);
    border: 1px solid var(--secondary-accent);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-normal);
    -webkit-tap-highlight-color: transparent;
}

.language-current:hover {
    background-color: var(--secondary-accent);
}

.flag-icon {
    width: 20px;
    height: 14px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 2px;
}

.flag-es { background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA5MDAgNjAwIj48cmVjdCB3aWR0aD0iOTAwIiBoZWlnaHQ9IjYwMCIgZmlsbD0iI2MwMDUxNiIvPjxyZWN0IHk9IjE1MCIgd2lkdGg9IjkwMCIgaGVpZ2h0PSIzMDAiIGZpbGw9IiNmYWJkMDAiLz48L3N2Zz4='); }
.flag-en { background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2MCA0MCI+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBkPSJNMzAgMjBoMzB2MjBIMzB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PHBhdGggZmlsbD0iIzAxMjE2OSIgZD0iTTAgMGg2MHY0MEgweiIvPjxwYXRoIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSI2IiBkPSJNMCAwbDYwIDQwbTAtNDBMMCA0MCIvPjxwYXRoIHN0cm9rZT0iI2MzMTIzMCIgc3Ryb2tlLXdpZHRoPSI0IiBkPSJNMCAwbDYwIDQwbTAtNDBMMCA0MCIgY2xpcC1wYXRoPSJ1cmwoI2EpIi8+PHBhdGggc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEwIiBkPSJNMzAgMHYzME0wIDE1aDYwIi8+PHBhdGggc3Ryb2tlPSIjYzMxMjMwIiBzdHJva2Utd2lkdGg9IjYiIGQ9Ik0zMCAwdjQwTTAgMjBoNjAiLz48L3N2Zz4='); }
.flag-fr { background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA5MDAgNjAwIj48cmVjdCB3aWR0aD0iOTAwIiBoZWlnaHQ9IjYwMCIgZmlsbD0iI2VkMjkzOSIvPjxyZWN0IHdpZHRoPSI2MDAiIGhlaWdodD0iNjAwIiBmaWxsPSIjZmZmIi8+PHJlY3Qgd2lkdGg9IjMwMCIgaGVpZ2h0PSI2MDAiIGZpbGw9IiMwMDIzOTUiLz48L3N2Zz4='); }

.language-current svg {
    width: 12px;
    height: 12px;
    transition: transform var(--transition-normal);
}

.language-dropdown.open .language-current svg {
    transform: rotate(180deg);
}

.language-options {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background-color: var(--card-bg);
    border: 1px solid var(--secondary-accent);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-light);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    min-width: 120px;
    overflow: hidden;
}

.language-dropdown.open .language-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.language-option:hover {
    background-color: var(--primary-accent);
}

.language-option span {
    font-size: 0.9em;
}

.cart-icon { 
    position: relative; 
    cursor: pointer;
    transition: transform var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    padding: 4px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--text-color);
    color: var(--bg-color);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7em;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
}

/* Estilos del carrusel principal */
.hero-carousel { 
    position: relative; 
    height: 60vh; 
    overflow: hidden; 
    background-color: var(--primary-accent);
}

.carousel-container {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.carousel-slider { 
    display: flex; 
    height: 100%; 
    transition: transform var(--transition-slow) ease-in-out;
    will-change: transform;
}

.carousel-slider.dragging {
    transition: none;
}

.carousel-slide { 
    flex: 1 0 100%; 
    height: 100%; 
    position: relative;
    user-select: none;
}

.carousel-slide img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
}

.carousel-slide::after { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: var(--shadow-dark); 
}

.hero-title { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    color: white; 
    font-size: 2.5em; 
    font-weight: 700; 
    text-align: center; 
    z-index: 10; 
    text-shadow: 0px 2px 5px rgba(0,0,0,0.5); 
    width: 90%; 
    pointer-events: none; 
}

/* Controles del carrusel */
.carousel-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 15;
}

.carousel-control {
    background-color: rgba(255,255,255,0.3);
    backdrop-filter: blur(5px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    pointer-events: all;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.carousel-control:hover {
    background-color: rgba(255,255,255,0.5);
    transform: scale(1.1);
}

.carousel-control svg {
    width: 20px;
    height: 20px;
    stroke: white;
    stroke-width: 3;
}

/* Secciones */
.section { 
    padding: 50px 20px; 
}

.section-title { 
    font-size: 2.2em; 
    font-weight: 700; 
    text-align: center; 
    margin-bottom: 40px; 
}

/* Grid de productos */
.product-grid { 
    display: grid; 
    /* MEJORA: Se cambia a 2 columnas por defecto para la vista móvil */
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px; 
}

.product-card { 
    background-color: var(--card-bg); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column;
    transition: box-shadow var(--transition-normal);
}

.product-card:hover {
    box-shadow: 0 4px 12px var(--shadow-light);
}

.product-card .product-image { 
    position: relative; 
    overflow: hidden; 
}

.product-card .product-image img { 
    width: 100%; 
    height: 250px;  /* Ajustado para una mejor proporción en 2 columnas */
    object-fit: cover; 
    background-color: #f0f0f0; 
    transition: opacity var(--transition-normal) ease; 
}

/* Galería de imágenes para productos */
.product-gallery { 
    position: relative; 
    height: 250px;  /* Ajustado para una mejor proporción en 2 columnas */
    overflow: hidden;
}

.gallery-images { 
    position: relative; 
    height: 100%;
    display: flex;
    transition: transform var(--transition-slow) ease;
    will-change: transform;
}

.gallery-images.dragging {
    transition: none;
}

.gallery-image { 
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    user-select: none;
}

.gallery-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Controles de la galería de productos */
.gallery-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
    z-index: 15;
}

.product-gallery:hover .gallery-controls {
    opacity: 1;
}

.gallery-control {
    background-color: rgba(0,0,0,0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    pointer-events: all;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.gallery-control:hover {
    background-color: rgba(0,0,0,0.7);
    transform: scale(1.1);
}

.gallery-control svg {
    width: 16px;
    height: 16px;
    stroke: white;
    stroke-width: 3;
}

.gallery-control.disabled {
    opacity: 0.3;
    cursor: default;
}

.gallery-control.disabled:hover {
    background-color: rgba(0,0,0,0.5);
    transform: none;
}

.gallery-dots { 
    position: absolute; 
    bottom: 10px; 
    left: 50%; 
    transform: translateX(-50%); 
    display: flex; 
    gap: 5px;
    z-index: 10;
}

.gallery-dot { 
    width: 8px; 
    height: 8px; 
    border-radius: 50%; 
    background-color: rgba(255,255,255,0.5); 
    cursor: pointer; 
    transition: background-color var(--transition-normal);
}

.gallery-dot.active { 
    background-color: white; 
}

/* Información del producto */
.product-info { 
    padding: 15px; /* Ligeramente reducido para móviles */
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
}

.product-name { 
    font-size: 1.1em; 
    font-weight: 700; 
    margin-bottom: 8px; 
}

.product-brand { 
    font-size: 0.9em; 
    color: var(--gray-light); 
    margin-bottom: 5px; 
}

.product-price { 
    font-size: 1em; 
    font-weight: 500; 
    margin-bottom: 15px; 
    color: var(--gray-dark); 
}

/* Botones de acción */
.product-actions { 
    display: flex; 
    flex-direction: column; /* Apilados para mejor uso del espacio */
    gap: 8px; 
    margin-top: auto; 
}

.add-to-cart-btn, 
.whatsapp-btn { 
    flex: 1;
    padding: 12px; 
    border: none; 
    border-radius: 5px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: all var(--transition-fast); 
    text-align: center; 
    font-size: 0.9em;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.add-to-cart-btn { 
    background-color: var(--text-color); 
    color: var(--bg-color); 
}

.add-to-cart-btn:hover { 
    opacity: 0.8; 
}

.whatsapp-btn { 
    background-color: var(--whatsapp-color); 
    color: white; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.whatsapp-btn:hover { 
    background-color: var(--whatsapp-hover); 
}

.whatsapp-btn svg { 
    width: 16px; 
    height: 16px; 
    fill: white; 
}

/* Carrito lateral */
.cart-sidebar {
    position: fixed;
    right: -100%;
    top: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--card-bg);
    box-shadow: -2px 0 10px var(--shadow-light);
    transition: right var(--transition-normal) ease;
    z-index: 1002;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open { 
    right: 0; 
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--primary-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title { 
    font-size: 1.4em; 
    font-weight: 700; 
}

.close-cart { 
    background: none; 
    border: none; 
    font-size: 1.5em; 
    cursor: pointer; 
}

.cart-items { 
    flex: 1; 
    overflow-y: auto; 
    padding: 20px; 
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--primary-accent);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img { 
    width: 80px; 
    height: 80px; 
    object-fit: cover; 
    border-radius: 5px; 
}

.cart-item-info { 
    flex: 1; 
}

.cart-item-name { 
    font-weight: 600; 
    margin-bottom: 5px; 
}

.cart-item-actions { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-top: 10px; 
}

.quantity-btn { 
    width: 30px; 
    height: 30px; 
    border: 1px solid var(--border-color); 
    background: var(--card-bg); 
    cursor: pointer;
    border-radius: 3px;
    transition: background-color var(--transition-fast);
}

.quantity-btn:hover {
    background-color: var(--primary-accent);
}

.quantity { 
    margin: 0 10px;
    min-width: 20px;
    text-align: center;
}

.remove-item { 
    color: var(--error-color); 
    cursor: pointer; 
    font-size: 0.9em;
    margin-left: auto;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--primary-accent);
}

.cart-total { 
    font-size: 1.2em; 
    font-weight: 700; 
    margin-bottom: 15px; 
    text-align: right; 
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--whatsapp-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color var(--transition-fast);
}

.checkout-btn:hover { 
    background-color: var(--whatsapp-hover); 
}

.empty-cart { 
    text-align: center; 
    color: var(--gray-light); 
}

/* Footer */
.footer { 
    background-color: var(--primary-accent); 
    padding: 40px 20px; 
    text-align: center; 
}

/* WhatsApp Bubble */
.whatsapp-bubble { 
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    background-color: var(--whatsapp-color); 
    width: 60px; 
    height: 60px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 4px 12px var(--shadow-medium); 
    z-index: 1001; 
    transition: transform var(--transition-fast); 
}

.whatsapp-bubble:hover { 
    transform: scale(1.1); 
}

.whatsapp-bubble svg { 
    width: 36px; 
    height: 36px; 
    fill: white; 
}

/* Mensaje de error */
.error-message { 
    color: var(--error-color); 
    text-align: center; 
    padding: 20px; 
    background-color: var(--error-bg); 
    border-radius: 8px; 
    margin: 20px; 
    grid-column: 1 / -1; /* Ocupa todo el ancho del grid */
}

/* Tablet (768px+) */
@media (min-width: 768px) {
    .product-actions { 
        flex-direction: row; /* Botones en fila en tablet */
    }

    .product-card .product-image img,
    .product-gallery { 
        height: 320px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .section {
        padding: 80px 40px;
    }

    .product-card .product-image img,
    .product-gallery { 
        height: 350px;
    }
}

@media (max-width: 768px) {
  /* Apuntamos a los contenedores por su ID para máxima especificidad */
  #product-grid-hombre,
  #product-grid-mujer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px; 
  }
}