.product-page-container { background-color: #fff; padding: 2rem; border-radius: 20px; box-shadow: 0 8px 30px rgba(0,0,0,0.07); margin-bottom: 3rem; }
.product-detail-container { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: flex-start; }
@media (min-width: 1150px) { .product-detail-container { grid-template-columns: 1fr 1fr; } }

/* Contenedor principal: ahora actúa como una caja con "aire" dentro */
.main-image-container { 
    overflow: hidden; 
    border-radius: 16px; 
    border: 1px solid #eee; 
    cursor: zoom-in; 
    background-color: #fff;
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
    
    /* El truco para centrar la imagen más pequeña */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Esto da margen interior para que el zoom no choque */
    aspect-ratio: 1 / 1; /* Movemos la proporción al contenedor */
}

/* Efecto de sombra al pasar el ratón */
.main-image-container:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

/* La imagen: ahora más pequeña por defecto */
.main-image-container img { 
    width: 80%; /* ¡Aquí está la clave! No ocupa toda la caja */
    max-height: 100%; 
    display: block; 
    object-fit: contain; 
    transition: opacity 0.3s ease, transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
    transform-origin: center center;
    will-change: transform;
}

/* El Zoom (Scale) */
.main-image-container:hover img {
    transform: scale(1.15); /* Puede crecer un poco más porque tiene espacio libre */
}
.thumbnail-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); gap: 0.75rem; }
.thumbnail { cursor: pointer; border: 2px solid transparent; border-radius: 6px; overflow: hidden; transition: border-color 0.3s; display: block; }
.thumbnail img { width: 100%; display: block; aspect-ratio: 1 / 1; object-fit: contain; }
.thumbnail:hover, .thumbnail.active { border-color: var(--primary-color, #6a0dad); }

.product-detail-info h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.75rem; line-height: 1.2; text-align: center;}
.product-detail-info .price { font-size: 2.5rem; font-weight: 300; font-weight: bold; color: var(--primary-color, #6a0dad); margin-bottom: 1.5rem; }
.product-detail-info .description { color: #444; line-height: 1.7; margin-bottom: 2rem; margin-top: 2rem; font-size: 1rem; }
.product-actions { display: flex; gap: 1rem; align-items: center; background-color: #f9f9f9; padding: 1rem; border-radius: 20px; margin-top: 1.5rem; margin-bottom: 1.5rem; }

/* Selector de cantidad: cápsula y controles circulares. */
.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgba(94, 114, 228, .14);
    border-radius: 50px;
    padding: 5px;
    background: linear-gradient(145deg, #f3f6fa, #e9eef5);
    box-shadow: inset 0 1px 2px rgba(38, 51, 77, .06);
    width: fit-content;
    box-sizing: border-box;
}

.quantity-selector input[type="number"] {
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    width: 40px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
    margin: 0 2px;
    padding: 0;
    appearance: textfield;
    -moz-appearance: textfield;
}

/* Eliminar flechas (spinners) en Chrome/Safari/Edge */
.quantity-selector input[type="number"]::-webkit-inner-spin-button, 
.quantity-selector input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

.quantity-selector .quantity-btn,
.product-actions .quantity-btn {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    border: 1px solid rgba(94, 114, 228, .2);
    background: linear-gradient(145deg, #ffffff, #edf1f7);
    color: #3d4a63;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(39, 55, 79, .13), inset 0 1px 0 rgba(255,255,255,.9);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.quantity-selector .quantity-btn:hover:not(:disabled),
.product-actions .quantity-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #6f7fff, #4f65e8);
    border-color: transparent;
    color: #fff;
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 7px 14px rgba(79, 101, 232, .28);
}

.quantity-selector .quantity-btn:active:not(:disabled),
.product-actions .quantity-btn:active:not(:disabled) {
    transform: scale(.94);
}

.quantity-selector .quantity-btn:focus-visible,
.product-actions .quantity-btn:focus-visible {
    outline: 3px solid rgba(79, 101, 232, .22);
    outline-offset: 2px;
}

.quantity-selector .quantity-btn:disabled,
.product-actions .quantity-btn:disabled {
    cursor: not-allowed;
    color: #a8b0be;
    border-color: #e2e6ec;
    background: #eef1f5;
    box-shadow: inset 0 1px 2px rgba(34, 45, 66, .06);
    transform: none;
}

.quantity-selector .quantity-btn i,
.product-actions .quantity-btn i {
    font-size: .72rem;
    pointer-events: none;
}
.product-detail-info .add-to-cart-btn { flex-grow: 1; height: 50px; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
/* --- Breadcrumbs (Modo Claro) --- */
.breadcrumbs { margin-bottom: 1.5rem; font-size: 0.9rem; color: #ffffff !important; /* Nombre del producto en verde */ }
.breadcrumbs a { text-decoration: none; color: #242323 !important; /* Enlaces oscuros */ }
.breadcrumbs a:hover { color: #f0f0f0 !important; }
.breadcrumbs span { color: #ffffff !important; /* Barra separadora gris visible */ margin: 0 5px; }
.out-of-stock-message {     
    min-height: 42px;
    margin-top: 1rem;    
    width: 100%;
    padding: 1rem;
    text-align: center;
    background: #fee2e2;
    color: #ef4444;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    padding: 12px;
    border-radius: 50px;
}

.main-image-wrapper { position: relative; margin-bottom: 1rem; }
.gallery-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(255, 255, 255, 0.7); border: none; color: #333; width: 40px; height: 40px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; transition: background-color 0.3s, color 0.3s; display: flex; align-items: center; justify-content: center; z-index: 10; }
.gallery-nav-btn:hover { background-color: var(--primary-color, #6a0dad); color: #fff; }
#gallery-prev-btn { left: 10px; }
#gallery-next-btn { right: 10px; }
.mystyle { border-radius: 50px; background-color: #ffffff00; color: #04cc5e; font-weight: bold; font-size: 16px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); text-align: center; }

.my-custom-alert {
    border-radius: 25px;
    border: 2px solid #fcac19ff;
}
.my-custom-title { font-size: 1.5rem !important; }
.my-custom-button {
    border-radius: 50px !important;
    font-weight: bold !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}

/* --- STYL DLA PRZYCISKU ULUBIONE (NOWY) --- */
.toggle-fav-btn {
    width: 50px; height: 50px; 
    border-radius: 50%; 
    border: 2px solid #e0e0e0; 
    background: #fff; 
    color: #ccc; 
    font-size: 1.4rem; 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; /* Zapobiega spłaszczaniu */
}
.toggle-fav-btn:hover { border-color: #ff4757; color: #ff4757; }
.toggle-fav-btn.active { background: #ff4757; border-color: #ff4757; color: #fff; }
.toggle-fav-btn.active i { animation: popHeart 0.3s forwards; }

@keyframes popHeart { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Estilo base para las pastillas */
.status-tax-pill {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    cursor: default;
    border: 1px solid transparent;
    text-align: center;
    min-width: 140px; /* Evita que la pastilla cambie de tamaño al cambiar el texto */
}

.pill-tax.active .pill-content {
    font-size: 0.55rem; 
}

.status-stock-pill {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: not-allowed;
    border: 1px solid transparent;
    text-align: center;
    min-width: 100%; 
}

/* Específico para Agotado */
.pill-out-of-stock {
    background-color: #fee2e2;
    color: #ef4444;
}

/* Específico para Impuestos (Interactiva) */
.pill-tax {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    border-color: #e5e7eb;
}

.pill-tax.active {
    background-color: #1e5cb9;
    color: white;
    transform: scale(1.05);
}

/* Animación de cambio de texto suave */
.text-fade {
    transition: opacity 0.2s ease-in-out;
}
.text-hidden {
    opacity: 0;
}

/* Pastilla stock disponible */
.pill-stock-ok {
    background-color: #e8f5e9;
    color: #2e7d32;
    cursor: pointer;
}
.pill-stock-ok.active {
    background-color: #079643;
    color: #ffffff;
    transform: scale(1.05);
}

/* Stock bajo (≤5 unidades) */
.pill-stock-low {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    cursor: pointer;
}
.pill-stock-low.active {
    background-color: #e65100;
    color: #fff;
    transform: scale(1.05);
    border-color: #e65100;
}


/* =============================================
   DARK MODE — product.php COMPLETO Y CORREGIDO
   Selector: [data-theme="dark"]
   ============================================= */

/* --- Contenedor principal --- */
[data-theme="dark"] .product-page-container {
    background-color: var(--bg-light, #1c1e26) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid #2d303a;
}

/* --- Breadcrumbs (Migas de pan) --- */
/* --- Breadcrumbs (Migas de pan) en EFECTO GLASS --- */
[data-theme="dark"] .breadcrumbs.mystyle {
    /* 1. Fondo oscuro pero semi-transparente */
    background: rgba(28, 30, 38, 0.4) !important; 
    
    /* 2. El desenfoque mágico (Glassmorphism) */
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
    
    /* 3. Borde muy sutil simulando el reflejo del cristal */
    border: 1px solid rgba(255, 255, 255, 0.08) !important; 
    
    /* 4. Sombra suave para despegarlo del fondo */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="dark"] .breadcrumbs {
    color: #252525 !important;
}
[data-theme="dark"] .breadcrumbs a {
    color: #ffffff !important;
}
[data-theme="dark"] .breadcrumbs a:hover {
    color: #000000 !important;
}
[data-theme="dark"] .breadcrumbs span {
    color: #000000 !important;
}

/* --- Título del producto --- */
[data-theme="dark"] .product-detail-info h1 {
    color: var(--text-dark) !important;
}

/* --- PRECIOS (Corregidos) --- */
[data-theme="dark"] .unified-current-price,
[data-theme="dark"] .product-detail-info .price {
    color: #a3b1ff !important; /* El lila/fiolet brillante de tu carrito */
}
[data-theme="dark"] .unified-old-price {
    color: #a0aec0 !important; /* Gris claro para el tachado */
}
[data-theme="dark"] .unified-badge {
    background-color: #ff4757 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .price-unified-box {
    background-color: var(--bg-light, #1c1e26) !important;
    border: 1px solid #2d303a !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

/* --- Galería: imagen principal --- */
[data-theme="dark"] .main-image-container {
    border-color: #2d303a !important;
    background-color: transparent; 
}
[data-theme="dark"] .main-image-container:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5) !important;
    border-color: #383c48 !important;
}
/* --- Galería: thumbnails --- */
[data-theme="dark"] .thumbnail {
    border-color: transparent !important;
    background-color: #ffffff;
}
[data-theme="dark"] .thumbnail:hover,
[data-theme="dark"] .thumbnail.active {
    border-color: var(--primary-color) !important;
}

/* --- Botones navegación galería --- */
[data-theme="dark"] .gallery-nav-btn {
    background-color: rgba(30, 32, 40, 0.8) !important;
    color: #ccc !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .gallery-nav-btn:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

/* --- Pastilla de impuestos --- */
[data-theme="dark"] .pill-tax {
    background-color: #252830 !important;
    color: var(--text-light) !important;
    border-color: #383c48 !important;
}
[data-theme="dark"] .pill-tax:hover {
    border-color: #4a4d5a !important;
}
[data-theme="dark"] .pill-tax.active {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
}

/* --- Pastillas de Stock (Verde, Naranja, Rojo adaptados) --- */
[data-theme="dark"] .pill-stock-ok {
    background-color: rgba(46, 204, 113, 0.15) !important;
    color: #2ecc71 !important;
    border: 1px solid rgba(46, 204, 113, 0.3) !important;
}
[data-theme="dark"] .pill-stock-ok.active {
    background-color: rgba(46, 204, 113, 0.35) !important;
    color: #fff !important;
    border-color: #2ecc71 !important;
}
[data-theme="dark"] .pill-stock-low {
    background-color: rgba(255, 167, 38, 0.15) !important;
    color: #ffa726 !important;
    border: 1px solid rgba(255, 167, 38, 0.3) !important;
}
[data-theme="dark"] .pill-stock-low.active {
    background-color: rgba(255, 167, 38, 0.35) !important;
    color: #fff !important;
    border-color: #ffa726 !important;
}
[data-theme="dark"] .pill-out-of-stock {
    background-color: rgba(255, 71, 87, 0.15) !important;
    color: #ff4757 !important;
    border: 1px solid rgba(255, 71, 87, 0.3) !important;
}

/* --- Barra de acciones (quantity + carrito + fav) --- */
[data-theme="dark"] .product-actions {
    background-color: var(--bg-light, #1c1e26) !important;
    border: 1px solid #2d303a !important;
}

/* --- Selector de cantidad --- */
[data-theme="dark"] .quantity-selector {
    background-color: var(--bg-light, #1c1e26) !important;
    border-color: #383c48 !important;
}
[data-theme="dark"] .quantity-selector input[type="number"] {
    color: var(--text-dark) !important;
}
[data-theme="dark"] .quantity-selector .quantity-btn,
[data-theme="dark"] .product-actions .quantity-btn {
    background-color: #252830 !important;
    border: 1px solid #383c48 !important;
    color: var(--text-dark) !important;
}
[data-theme="dark"] .quantity-selector .quantity-btn:hover:not(:disabled),
[data-theme="dark"] .product-actions .quantity-btn:hover:not(:disabled) {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

[data-theme="dark"] .quantity-selector .quantity-btn:disabled,
[data-theme="dark"] .product-actions .quantity-btn:disabled {
    background: #20242c !important;
    border-color: #303641 !important;
    color: #687181 !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.25) !important;
}

/* --- Botón favorito --- */
[data-theme="dark"] .toggle-fav-btn {
    background-color: #252830 !important;
    border: 1px solid #383c48 !important;
    color: #666 !important;
}
[data-theme="dark"] .toggle-fav-btn:hover {
    border-color: #ff4757 !important;
    color: #ff4757 !important;
}
[data-theme="dark"] .toggle-fav-btn.active {
    background-color: #ff4757 !important;
    border-color: #ff4757 !important;
    color: #ffffff !important;
}

/* --- Botón añadir al carrito --- */
[data-theme="dark"] .add-to-cart-btn {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

/* --- Descripción --- */
[data-theme="dark"] .product-detail-info .description {
    color: var(--text-light) !important;
}

/* --- Mensaje agotado (fallback) --- */
[data-theme="dark"] .out-of-stock-message {
    background: rgba(255, 71, 87, 0.15) !important;
    color: #ff4757 !important;
    border: 1px solid rgba(255, 71, 87, 0.3) !important;
}

/* --- Producto no encontrado --- */
[data-theme="dark"] .section-title {
    color: var(--text-dark) !important;
}

/* --- SweetAlert dark mode --- */
[data-theme="dark"] .my-custom-alert {
    background: var(--bg-light, #1c1e26) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-dark) !important;
}
[data-theme="dark"] .swal2-html-container {
    color: var(--text-light) !important;
}

/* =============================================
   RESPONSIVE — product.php
   ============================================= */

/* ─── TABLET (hasta 1024px) ─── */
@media (max-width: 1024px) {
    .product-page-container {
        padding: 1.5rem;
    }
    .unified-current-price {
        font-size: 1.9rem;
    }
    .product-detail-info h1 {
        font-size: 1.5rem;
    }
}

/* ─── MÓVIL GRANDE / TABLET PEQUEÑA (hasta 768px) ─── */
@media (max-width: 768px) {
    main.container {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    .product-page-container {
        padding: 1.25rem;
        border-radius: 16px;
        margin-bottom: 2rem;
    }
    .product-detail-container {
        gap: 1.5rem;
    }
    .product-detail-info h1 {
        font-size: 1.35rem;
    }
    .unified-current-price {
        font-size: 1.7rem;
    }
    .price-unified-box {
        padding: 8px 20px;
        gap: 10px;
    }
    .breadcrumbs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        font-size: 0.8rem;
        scrollbar-width: none; 
    }
    .breadcrumbs::-webkit-scrollbar {
        display: none; 
    }
    .product-actions {
        flex-direction: column;
        border-radius: 20px;
        padding: 0.75rem;
        gap: 0.75rem;
    }
    .product-actions .quantity-selector {
        width: auto;
    }
    .product-detail-info .add-to-cart-btn {
        width: 100%;
        height: 48px;
        font-size: 1rem;
    }
    .toggle-fav-btn {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }
    .thumbnail-container {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 0.5rem;
    }
    .gallery-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .product-detail-info .description {
        font-size: 0.95rem;
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }
    .status-tax-pill {
        font-size: 0.65rem;
        min-width: 120px;
        padding: 6px 16px;
    }
}

/* ─── MÓVIL PEQUEÑO (hasta 480px) ─── */
@media (max-width: 480px) {
    .product-page-container {
        padding: 1rem;
        border-radius: 14px;
    }
    .product-detail-container {
        gap: 1rem;
    }
    .product-detail-info h1 {
        font-size: 1.2rem;
    }
    .unified-current-price {
        font-size: 1.5rem;
    }
    .unified-badge {
        font-size: 0.75rem;
        padding: 2px 6px;
    }
    .unified-old-price {
        font-size: 0.85rem;
    }
    .price-unified-box {
        padding: 8px 15px;
        gap: 8px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .product-actions {
        align-items: center;
        padding: 0.75rem;
        border-radius: 16px;
    }
    .product-detail-info .add-to-cart-btn {
        height: 46px;
        font-size: 0.95rem;
        border-radius: 50px;
    }
    .quantity-selector .quantity-btn {
        width: 36px;
        height: 36px;
    }
    .product-actions .quantity-btn {
        width: 36px;
        height: 36px;
    }
    .quantity-selector input[type="number"] {
        width: 36px;
        font-size: 1rem;
    }
    .gallery-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    #gallery-prev-btn { left: 6px; }
    #gallery-next-btn { right: 6px; }
    .thumbnail-container {
        grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
        gap: 0.4rem;
    }
    .breadcrumbs {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }
    .product-detail-info .description {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
    .status-stock-pill {
        font-size: 0.8rem;
        padding: 6px 16px;
    }
    .my-custom-alert {
        width: 90% !important;
    }
}

/* ─── MÓVIL MUY PEQUEÑO (hasta 360px) ─── */
@media (max-width: 360px) {
    .product-page-container {
        padding: 0.75rem;
    }
    .product-detail-info h1 {
        font-size: 1.1rem;
    }
    .unified-current-price {
        font-size: 1.3rem;
    }
    .product-detail-info .add-to-cart-btn {
        font-size: 0.85rem;
        height: 44px;
    }
    .thumbnail-container {
        grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    }
}

/* =============================================
   MINIATURAS DENTRO DEL LIGHTBOX (ZOOM)
   ============================================= */

/* La imagen del lightbox NUNCA invade el espacio de las miniaturas */
.glightbox-container .gslide-image img {
    max-height: calc(85vh - 160px) !important;
}
.glightbox-container .gslide-media {
    max-height: calc(85vh - 160px) !important;
}

.glightbox-thumbnails {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.007);
    border-radius: 10px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 999999;
    max-width: 92vw;
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    opacity: 1;
    /* Sincronizado con el cierre del lightbox (~300 ms) para que
       las miniaturas y la foto desaparezcan a la vez */
    transition: opacity 0.3s ease;
}
/* Fade-out al cerrar el lightbox: se activa desde JS añadiendo
   la clase .closing al contenedor de miniaturas */
.glightbox-thumbnails.closing {
    opacity: 0;
    pointer-events: none;
}
.glightbox-thumbnails::-webkit-scrollbar { display: none; }

.glightbox-thumb {
    width: 56px;
    /*height: 56px;*/
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    flex-shrink: 0;
    background: #fff;
    opacity: 0.55;
    padding: 0;
    /* reset de <button> */
    outline: none;
}
.glightbox-thumb:hover {
    opacity: 1;
    transform: translateY(-3px);
}
.glightbox-thumb.active {
    opacity: 1;
    border-color: #fff;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.35);
    transform: translateY(-3px);
}
.glightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none; /* clic siempre lo recibe el botón, no la imagen */
}

/* Responsive */
@media (max-width: 768px) {
    .glightbox-container .gslide-image img,
    .glightbox-container .gslide-media {
        max-height: calc(90vh - 130px) !important;
    }
    .glightbox-thumbnails {
        bottom: 12px;
        padding: 8px 12px;
        gap: 8px;
    }
    .glightbox-thumb { width: 52px; height: 52px; }
}

@media (max-width: 480px) {
    .glightbox-container .gslide-image img,
    .glightbox-container .gslide-media {
        max-height: calc(90vh   - 110px) !important;
    }
    .glightbox-thumbnails {
        bottom: 8px;
        padding: 6px 10px;
        gap: 6px;
    }
    .glightbox-thumb { width: 44px; height: 44px; border-radius: 8px; }
}


/* =============================================
   PASTILLA SUPERIOR CON NOMBRE DEL PRODUCTO (LIGHTBOX)
   Se monta dinámicamente al abrir el lightbox (JS en product.php).
   Estilo glassmorphism para que case con las breadcrumbs en dark mode
   y con las miniaturas inferiores.
   ============================================= */

.glightbox-title-pill {
    position: fixed;
    /* Top por defecto = header SIN scroll (altura 165px + 10px de margen).
       Se sobreescribe más abajo cuando el header está en estado scrolled. */
    top: 25px !important;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    padding: 10px 26px;
    background: rgba(20, 22, 30, 0.55);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.3px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    max-width: 80vw;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease, top 0.3s ease;
    /* Pequeña entrada desde arriba al abrir el lightbox */
    animation: titlePillIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes titlePillIn {
    0%   { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Header en estado SCROLLED (más bajo: 125px) → subimos la pastilla */
body.lightbox-open.header-scrolled .glightbox-title-pill {
    top: 135px;
}

/* Fade-out al cerrar el lightbox: se activa desde JS añadiendo la clase
   .closing al elemento. Sincronizado con las miniaturas (~300 ms). */
.glightbox-title-pill.closing {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-8px);
}

/* Responsive */
@media (max-width: 768px) {
    .glightbox-title-pill {
        padding: 8px 20px;
        font-size: 0.9rem;
        max-width: 85vw;
    }
}

@media (max-width: 480px) {
    .glightbox-title-pill {
        padding: 7px 16px;
        font-size: 0.8rem;
        max-width: 88vw;
        letter-spacing: 0.2px;
    }
}


/* ============================================
   FIX: HEADER + CONTENIDO NO SE MUEVEN AL ABRIR EL LIGHTBOX
   ============================================
   1) GLightbox pone overflow:hidden en el body → rompe el position:sticky 
      del header → lo convertimos a position:fixed para que no se mueva.
   2) Al pasar a 'fixed', el header sale del flujo y el contenido salta 
      hacia arriba → compensamos con un padding-top en el body igual a 
      la altura del header. */

body.lightbox-open .main-header,
body.lightbox-open .main-header.scrolled {
    position: fixed !important;
    top: 10px !important;
    left: 1.5% !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Header sin scroll → altura 165px (definida en style.css línea 176) */
body.lightbox-open {
    padding-top: 165px;
}

/* Header con scroll → altura 125px (definida en style.css línea 6114) */
body.lightbox-open.header-scrolled {
    padding-top: 125px;
}

/* ══════════════════════════════════════════════════════════════
   PASTILLA "AVÍSAME" — botón junto a Agotado
   ══════════════════════════════════════════════════════════════ */
.pill-notify-me {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    cursor: pointer;
    transition: all 0.25s ease;
    /*display: inline-flex;*/
    align-items: center;
    gap: 5px;
    text-align: center;
}
.pill-notify-me:hover {
    background-color: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
    transform: scale(1.04);
    box-shadow: 0 6px 18px rgba(29, 78, 216, 0.35);
}
.pill-notify-me:hover svg {
    stroke: #fff;
}
.pill-notify-me.subscribed {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
    cursor: default;
}

[data-theme="dark"] .pill-notify-me {
    background-color: rgba(29, 78, 216, 0.15) !important;
    color: #93c5fd !important;
    border-color: rgba(29, 78, 216, 0.35) !important;
}
[data-theme="dark"] .pill-notify-me:hover {
    background-color: rgba(29, 78, 216, 0.45) !important;
    color: #fff !important;
    border-color: #60a5fa !important;
}
[data-theme="dark"] .pill-notify-me.subscribed {
    background-color: rgba(46, 204, 113, 0.15) !important;
    color: #2ecc71 !important;
    border-color: rgba(46, 204, 113, 0.3) !important;
}

/* ══════════════════════════════════════════════════════════════
   MODAL AVISO DE STOCK (.sna-*)
   ══════════════════════════════════════════════════════════════ */
.sna-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.sna-overlay.is-open {
    opacity: 1;
}
.sna-overlay[hidden] {
    display: none !important;
}

.sna-card {
    position: relative;
    background: #fff;
    border-radius: 22px;
    padding: 2.2rem 2rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.28);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}
.sna-overlay.is-open .sna-card {
    transform: none;
}

.sna-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.sna-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.sna-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    margin: 0 auto 1.1rem;
}
.sna-icon svg {
    width: 26px;
    height: 26px;
    stroke: #1d4ed8;
}

.sna-title {
    margin: 0 0 0.4rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: #111827;
}
.sna-subtitle {
    margin: 0 0 1.4rem;
    font-size: 0.88rem;
    color: #6b7280;
    line-height: 1.5;
}

.sna-field {
    text-align: left;
    margin-bottom: 1.1rem;
}
.sna-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.4rem;
    letter-spacing: .03em;
}
.sna-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #111827;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.sna-input:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.sna-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #22c1c3, #1aa5d8);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.97rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 18px rgba(26, 165, 216, 0.4);
}
.sna-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(26, 165, 216, 0.5);
}
.sna-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.sna-feedback {
    margin-top: 1rem;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
}
.sna-feedback.ok {
    background: #e8f5e9;
    color: #2e7d32;
}
.sna-feedback.err {
    background: #fee2e2;
    color: #ef4444;
}

/* Dark mode modal */
[data-theme="dark"] .sna-card {
    background: #1e2028;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .sna-close {
    color: #6b7280;
}
[data-theme="dark"] .sna-close:hover {
    color: #e5e7eb;
    background: #2d3039;
}
[data-theme="dark"] .sna-icon {
    background: linear-gradient(135deg, rgba(29,78,216,.2), rgba(29,78,216,.1));
}
[data-theme="dark"] .sna-title {
    color: #f3f4f6;
}
[data-theme="dark"] .sna-subtitle {
    color: #9ca3af;
}
[data-theme="dark"] .sna-label {
    color: #d1d5db;
}
[data-theme="dark"] .sna-input {
    background: #252830;
    border-color: #374151;
    color: #f3f4f6;
}
[data-theme="dark"] .sna-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}
[data-theme="dark"] .sna-feedback.ok {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}
[data-theme="dark"] .sna-feedback.err {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
}

@media (max-width: 480px) {
    .sna-card {
        padding: 1.8rem 1.4rem 1.6rem;
        border-radius: 18px;
    }
}

/* =============================================
   DARK MODE — DETALLES (.pdetails) Y DESCRIPCIÓN (.pdesc)
   Selector: [data-theme="dark"]
   ============================================= */

/* --- Pestañas de Detalles --- */
[data-theme="dark"] .pdetails {
    --pd-bg: #1e2028;
    --pd-surface: #24262f;
    --pd-border: #33363f;
    --pd-text: #e8e8ec;
    --pd-muted: #9aa3ad;
    --pd-shadow: 0 22px 50px -26px rgba(0, 0, 0, 0.75);
}

/* --- Marco de Descripción --- */
[data-theme="dark"] .pdesc {
    --pd-bg: #1e2028;
    --pd-surface: #24262f;
    --pd-border: #33363f;
    --pd-text: #e3e6ea;
    --pd-muted: #9aa3ad;
    --pd-shadow: 0 22px 50px -28px rgba(0, 0, 0, 0.72);
}

/* Reducimos un poco la intensidad del brillo animado en modo oscuro */
[data-theme="dark"] .pdesc__glow {
    opacity: 0.35; 
}

/* Suavizamos el pseudo-elemento interior de los detalles para que no contraste demasiado */
[data-theme="dark"] .pdetails__inner::before,
[data-theme="dark"] .pdesc__inner::after {
    opacity: 0.6;
}

/* ============================================================
   MODO OSCURO — SELECTOR DE CANTIDAD (product.php)
   ------------------------------------------------------------
   Mismo problema que en el carrito: las reglas dark usaban
   "background-color" y el degradado claro (background-image)
   del modo dia seguia visible encima.
   ============================================================ */
[data-theme="dark"] .quantity-selector {
    background: linear-gradient(145deg, #252a34, #1e222b) !important;
    border-color: #383c48 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45) !important;
}

[data-theme="dark"] .quantity-selector input[type="number"] {
    background: transparent !important;
    color: #e8ecf5 !important;
}

[data-theme="dark"] .quantity-selector .quantity-btn,
[data-theme="dark"] .product-actions .quantity-btn {
    background: linear-gradient(145deg, #343a47, #2a2f3a) !important;
    border: 1px solid #454b5a !important;
    color: #e8ecf5 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .05) !important;
}

[data-theme="dark"] .quantity-selector .quantity-btn:hover:not(:disabled),
[data-theme="dark"] .product-actions .quantity-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #6f7fff, #4f65e8) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 7px 16px rgba(79, 101, 232, .38) !important;
}

[data-theme="dark"] .quantity-selector .quantity-btn:disabled,
[data-theme="dark"] .product-actions .quantity-btn:disabled {
    background: #20242c !important;
    border-color: #303641 !important;
    color: #687181 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3) !important;
}

/* --- Modo oscuro: conservar las animaciones de los botones --- */
[data-theme="dark"] .quantity-selector .quantity-btn,
[data-theme="dark"] .product-actions .quantity-btn {
    transition: transform .18s ease, box-shadow .18s ease,
                background .18s ease, color .18s ease,
                border-color .18s ease !important;
}

[data-theme="dark"] .quantity-selector .quantity-btn:hover:not(:disabled),
[data-theme="dark"] .product-actions .quantity-btn:hover:not(:disabled) {
    transform: translateY(-1px) scale(1.04);
}

[data-theme="dark"] .quantity-selector .quantity-btn:active:not(:disabled),
[data-theme="dark"] .product-actions .quantity-btn:active:not(:disabled) {
    transform: scale(.94);
}

/* ============================================================
   REFERENCIA DEL PRODUCTO ("Ref.: 000019M")
   ------------------------------------------------------------
   Solo llevaba .text-muted de Bootstrap (#6c757d), que sobre el
   fondo oscuro apenas se leia.
   ============================================================ */
.product-reference {
    letter-spacing: .3px;
}

.product-reference .ref-value {
    font-weight: 600;
    color: #495057;
}

[data-theme="dark"] .product-reference,
[data-theme="dark"] .product-reference.text-muted {
    color: #9aa5b8 !important;
}

[data-theme="dark"] .product-reference .ref-value {
    color: #dfe5ef !important;
}
