/* =====================================================
   MOBILE.CSS - Estilos específicos para móviles v63
   Catálogo EMPODERI
   ===================================================== */

/* ===== UTILIDADES ===== */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: flex !important;
}

/* ===== ELEMENTOS MÓVILES OCULTOS EN DESKTOP ===== */
.mobile-search-container {
    display: none;
}

.bottom-nav {
    display: none;
}

/* ===== VARIABLES MÓVILES ===== */
:root {
    --bottom-nav-height: 60px;
    --header-height: 60px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== MEDIA QUERY MÓVIL ===== */
@media (max-width: 768px) {
    
    /* Utilidades */
    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }

    /* ===== BODY ===== */
    html, body {
        overflow-x: hidden;
        overscroll-behavior-x: none;
    }

    body {
        padding-top: calc(var(--bottom-nav-height) + 50px + env(safe-area-inset-top, 0px));
        padding-bottom: 0;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y pinch-zoom;
    }

    /* ===== BARRA PROMO - MOVIL ===== */
    .promo-bar {
        display: none;
    }

    .promo-content {
        gap: 6px;
        flex-wrap: nowrap;
    }

    .promo-separator {
        display: none;
    }

    .promo-item {
        white-space: nowrap;
    }

    .promo-item:nth-child(5) {
        display: none; /* Ocultar "Pago seguro" en movil */
    }

    /* ===== HEADER MOVIL ===== */
    header {
        display: none;
    }
    
    .header-content {
        padding: 0.8rem 1rem;
        gap: 0.5rem;
    }
    
    .logo {
        font-size: 1.2rem;
        flex: 1;
        flex-direction: column;
        align-items: center;
    }

    .logo-country {
        font-size: 0.55rem;
        letter-spacing: 1.2em;
    }

    .mobile-search-btn {
        background: var(--light);
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        font-size: 1.2rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .cart-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .cart-badge {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
        top: -3px;
        right: -3px;
    }
    
    /* ===== BÚSQUEDA MÓVIL EXPANDIBLE ===== */
    .mobile-search-container {
        display: none;
        position: fixed;
        top: var(--bottom-nav-height);
        left: 0;
        right: 0;
        background: white;
        padding: 0.8rem 1rem;
        border-bottom: 1px solid var(--border);
        z-index: 1090;
        animation: slideDown 0.3s ease;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    .mobile-search-container.active {
        display: block;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .mobile-search-inner {
        display: flex;
        gap: 0.5rem;
    }
    
    .mobile-search-inner input {
        flex: 1;
        padding: 0.8rem 1rem;
        border: 2px solid var(--border);
        border-radius: 25px;
        font-size: 1rem;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    .mobile-search-inner input:focus {
        outline: none;
        border-color: var(--primary);
    }
    
    .mobile-search-inner button {
        background: var(--gray);
        color: white;
        border: none;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        font-size: 1.2rem;
        cursor: pointer;
    }
    
    /* ===== FILTROS MÓVIL ===== */
    .filters {
        padding: 0.2rem 0;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        z-index: 90;
        background: white;
        border-bottom: 1px solid var(--border-light);
        transition: transform 0.3s ease;
    }

    /* Ocultar nav y filtros al hacer scroll hacia abajo */
    body.nav-hidden .bottom-nav {
        transform: translateY(-100%);
        box-shadow: none;
    }

    body.nav-hidden .filters {
        transform: translateY(calc(-100% - 60px));
    }

    /* Ocultar filtros cuando el modal está abierto */
    body.modal-open .filters {
        display: none;
    }

    /* Quitar sombra del nav cuando el modal está abierto (evita sombra visible sobre modal) */
    body.modal-open .bottom-nav {
        box-shadow: none;
        border-bottom: 1px solid #f0f0f0;
    }

    /* nav-hidden controla el hide/show dentro del modal también */
    body.modal-open.nav-hidden .bottom-nav {
        transform: translateY(-100%);
    }

    /* Ocultar filter bar junto con el nav al hacer scroll en el modal */
    body.modal-open.nav-hidden .modal-filter-bar {
        display: none;
    }

    .filters-row {
        display: flex;
        gap: 0.4rem;
        padding: 3px 0.75rem;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        flex-wrap: nowrap;
        align-items: center;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }

    .filters-row::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    .filter-count {
        font-size: 0.65rem;
        padding: 0px 5px;
        min-width: 16px;
    }
    
    /* ===== CONTENEDOR PRINCIPAL ===== */
    .container {
        padding: 0.25rem;
        padding-bottom: 2rem;
    }
    
    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
    }
    
    .section-title {
        font-size: 1.3rem;
        margin-bottom: 0;
    }
    
    .products-count {
        font-size: 0.85rem;
        color: var(--gray);
        background: var(--light);
        padding: 0.3rem 0.8rem;
        border-radius: 20px;
    }
    
    /* ===== GRID DE PRODUCTOS ===== */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    
    /* ===== TARJETA DE PRODUCTO MÓVIL ===== */
    .product-card {
        border-radius: 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .product-card:active {
        transform: scale(0.96);
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
        transition-duration: 0.1s;
    }
    
    .product-image {
        aspect-ratio: 9/10;
        border-radius: 16px 16px 0 0;
    }
    
    .product-image img {
        border-radius: 16px 16px 0 0;
    }

    .product-info.compact {
        padding: 0.2rem 0.3rem;
    }

    .product-row {
        gap: 0.2rem;
        margin-bottom: 0.05rem;
    }

    .product-row.row-name {
        gap: 0.15rem;
        margin-bottom: 0.02rem;
    }

    .product-name {
        font-size: 0.70rem;
        font-weight: 300;
        color: #4b5563;
        line-height: 1.15;
        margin: 0;
    }

    .tallas-container {
        gap: 0.1rem;
    }

    .talla-box {
        font-size: 0.45rem;
        padding: 0.1rem 0.15rem;
        min-width: 1rem;
    }

    .price-current {
        font-size: 0.85rem;
        color: #4b5563;
    }

    .price-original {
        font-size: 0.65rem;
    }

    .rating-mini,
    .code-mini,
    .stock-mini {
        font-size: 0.5rem;
    }
    
    .add-to-cart {
        padding: 0.5rem 0.66rem;
        font-size: 0.83rem;
        margin-top: 0;
        border-radius: 10px;
        letter-spacing: 0;
    }

    /* Botón agregar al carrito en modal */
    #addToCartBtn {
        position: relative;
        overflow: hidden;
        will-change: box-shadow;
    }

    /* Habilitado: pulso + flash blanco */
    #addToCartBtn:not(:disabled) {
        animation: pulseCart 2s ease-in-out infinite;
    }

    #addToCartBtn:not(:disabled)::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 60%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
        animation: shimmer 3s ease-in-out infinite;
    }

    /* Talla seleccionada - flash blanco */
    .size-option.selected {
        box-shadow: var(--shadow-md);
    }

    .size-option.selected::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 60%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
        animation: shimmer 3s ease-in-out infinite;
    }

    /* Delivery note móvil - 15% más pequeño */
    .delivery-note {
        padding: 7px 10px;
        gap: 7px;
        margin-top: 0.5rem;
        border-radius: 8px;
    }

    .delivery-icon {
        font-size: 1rem;
    }

    .delivery-text {
        font-size: 0.72rem;
        line-height: 1.25;
    }

    .delivery-text strong {
        font-size: 0.72rem;
    }

    .delivery-sub {
        font-size: 0.63rem;
    }

    /* Fotos reales badge - sin espacio extra */
    .fotos-reales-badge {
        padding: 0.15rem 0.5rem;
        font-size: 0.6rem;
        margin-top: 0.2rem;
        border-radius: 5px;
        gap: 0.2rem;
    }
    
    /* ===== MODAL PRODUCTO MÓVIL ===== */
    .modal {
        padding: 0;
        top: 0;    /* overlay cubre TODA la pantalla — el nav (z-index:1100) queda encima.
                      Antes usábamos top:var(--bottom-nav-height) pero en FBIAB la variable
                      CSS puede no resolverse a tiempo, dejando un gap visible con el grid. */
        height: 100%;
        align-items: flex-start;
    }

    .modal-content {
        border-radius: 0;
        box-shadow: none;
        margin-top: var(--bottom-nav-height); /* el contenido empieza debajo del nav */
        height: calc(100vh - var(--bottom-nav-height));
        max-height: none;
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        animation: slideUp 0.3s ease;
        overflow: hidden;
        transition: transform 0.3s ease; /* GPU — sincroniza con nav y filter bar, sin gap */
    }

    /* Cuando el nav se oculta, modal-content sube exactamente el mismo valor usando transform.
       margin-top se mantiene fijo en 60px siempre — solo el transform cambia.
       Así nav + filter bar + modal-content suben al mismo tiempo en el mismo frame GPU. */
    body.nav-hidden .modal-content {
        transform: translateY(calc(-1 * var(--bottom-nav-height)));
        height: 100vh;
    }

    .modal-body {
        overflow-y: auto;
        flex: 1;
        overscroll-behavior: contain;
    }
    
    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .modal.closing .modal-content {
        animation: slideDown 0.25s ease-in forwards;
    }
    .modal.closing {
        animation: fadeOut 0.25s ease-in forwards;
    }
    @keyframes slideDown {
        from { transform: translateY(0); }
        to { transform: translateY(100%); }
    }
    @keyframes fadeOut {
        from { opacity: 1; }
        to { opacity: 0; }
    }
    

    .modal-close {
        position: sticky;
        top: 0;
        z-index: 100;
        margin-left: auto;
        margin-right: 0.5rem;
        margin-top: 0.5rem;
        margin-bottom: -36px;
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    
    .modal-body {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        gap: 0.8rem;
    }

    .modal-gallery {
        order: 1;
        width: 100%;
        height: auto !important;
        flex-shrink: 0;
        gap: 0.2rem;
    }

    .modal-gallery .thumbnail-gallery {
        padding: 2px 0;
        gap: 6px;
    }

    /* Swipe gallery - Móvil */
    .swipe-gallery {
        position: relative;
        overflow: hidden;
        border-radius: 12px;
        width: 100%;
        touch-action: pan-y;
    }

    .swipe-track {
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
        transition: transform 0.3s ease;
    }

    .swipe-slide {
        flex: 0 0 100%;
        width: 100%;
    }

    .swipe-slide .main-image-container {
        border-radius: 0 !important;
    }

    .swipe-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        padding: 10px 0 4px;
    }

    .swipe-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #ccc;
        transition: all 0.3s;
        cursor: pointer;
    }

    .swipe-dot.active {
        background: var(--primary, #ff6b35);
        transform: scale(1.3);
    }

    .swipe-counter {
        display: block;
        position: absolute;
        top: 10px;
        left: 10px;
        background: rgba(0, 0, 0, 0.6);
        color: white;
        font-size: 0.75rem;
        font-weight: 600;
        padding: 3px 8px;
        border-radius: 12px;
        z-index: 2;
    }

    .modal-details {
        order: 2;
        width: 100%;
        height: auto;
    }
    
  .main-image {
    width: 100% !important;
    aspect-ratio: 9/10 !important;
    object-fit: contain !important;
    border-radius: 16px;
    padding: 1rem !important;
}

    /* Zoom en imagen - Mobile (pinch to zoom) */
    .main-image-container.zoomable {
        position: relative;
        overflow: hidden;
        touch-action: pan-y; /* permite scroll vertical; JS maneja pinch y swipe horizontal */
    }

    .main-image-container.zoomable.zoomed {
        overflow: hidden;
        touch-action: none; /* cuando hay zoom activo, JS controla todo el pan */
    }

    .main-image-container.zoomable img {
        transform-origin: 0 0;
    }

    .zoom-hint {
        font-size: 0.7rem;
        padding: 5px 10px;
        bottom: 10px;
        right: 10px;
    }

    /* Animacion carrito - Mobile */
    .fly-to-cart {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .add-to-cart.adding {
        transform: scale(1);
    }

    .thumbnail-row {
        gap: 0.4rem;
        justify-content: center;
        padding: 0.5rem 0;
    }
    
    .thumbnail {
        width: 55px;
        height: 55px;
        border-radius: 8px;
    }

    .modal-info-row {
        flex-direction: row;
        align-items: baseline;
        gap: 0.5rem;
    }

    .modal-details h2.modal-nombre {
        font-size: 0.74rem;
        margin-bottom: 0;
        min-width: 0;
        opacity: 0.85;
        color: #333;
    }

    .modal-info-row .price-current {
        font-size: 1.03rem;
        font-weight: 700;
    }

    .modal-info-row .price-original {
        font-size: 0.68rem;
    }

    .modal-code {
        font-size: 0.63rem;
        position: static;
        flex-shrink: 0;
    }

    .modal-discount-badge {
        font-size: 0.68rem;
        padding: 0.2rem 0.5rem;
    }

    .modal-stock-info {
        margin-bottom: 0.8rem;
        padding: 0.5rem;
    }

    .modal-stock-info .stock-good,
    .modal-stock-info .stock-low,
    .modal-stock-info .stock-out {
        font-size: 0.68rem;
    }

    .modal-description {
        font-size: 0.65rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }

    .size-selector {
        margin: 1rem 0;
    }

    .size-selector h3 {
        font-size: 0.86rem;
    }

    .size-options {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.4rem;
    }

    .size-option {
        padding: 0.6rem 0.4rem;
        border-radius: 10px;
    }

    .size-us {
        font-size: 0.81rem;
    }

    .size-cm {
        font-size: 0.63rem;
    }

    .size-stock {
        font-size: 0.5rem;
        margin-top: 0.2rem;
        padding: 0.1rem 0.2rem;
    }

    /* ===== COMPARTIR - MOVIL ===== */
    .share-container {
        display: none;
    }

    .share-btn {
        flex: 1 1 calc(33% - 6px);
        min-width: 0;
        padding: 7px 9px;
        font-size: 0.83rem;
        gap: 4px;
    }

    .share-btn-icon {
        font-size: 1rem;
    }

    .share-btn.whatsapp-product .whatsapp-svg {
        width: 18px;
        height: 18px;
    }

    /* ===== POLITICAS MODAL - MOVIL ===== */
    .policies-mini {
        gap: 6px;
        padding: 10px;
        margin-top: 0.8rem;
    }

    .policy-item {
        font-size: 0.75rem;
        gap: 8px;
    }

    .policy-icon {
        font-size: 0.95rem;
        width: 20px;
    }

    /* ===== PAGINACION MOVIL ===== */
    .pagination-container {
        margin-top: 1.5rem;
        gap: 0.4rem;
    }
    
    .pagination-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .pagination-number {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    
    .pagination-info {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
        font-size: 0.8rem;
    }
    
    /* ===== TOP NAVIGATION ===== */
    .bottom-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--bottom-nav-height);
        background: white;
        display: flex;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        z-index: 1100;
        padding-top: env(safe-area-inset-top, 0px);
        transition: transform 0.3s ease;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--gray);
        padding: 0.5rem;
        position: relative;
        transition: all 0.3s ease;
        flex: 1;
        /* Reset button styles */
        background: none;
        border: none;
        cursor: pointer;
        font-family: inherit;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-item:active {
        transform: scale(0.9);
    }

    .bottom-nav-item.active {
        color: var(--primary);
    }

    .bottom-nav-icon {
        font-size: 1.3rem;
        margin-bottom: 0.2rem;
        transition: transform 0.3s ease;
    }

    .bottom-nav-item:hover .bottom-nav-icon,
    .bottom-nav-item:active .bottom-nav-icon {
        transform: scale(1.2);
    }

    .bottom-nav-item.active .bottom-nav-icon {
        animation: iconBounce 0.5s ease;
    }

    @keyframes iconBounce {
        0% { transform: scale(1); }
        30% { transform: scale(1.3) translateY(-3px); }
        50% { transform: scale(0.9); }
        70% { transform: scale(1.1); }
        100% { transform: scale(1); }
    }

    .bottom-nav-label {
        font-size: 0.65rem;
        font-weight: 500;
        transition: all 0.3s ease;
    }

    .bottom-nav-item.active .bottom-nav-label {
        font-weight: 700;
    }
    
    .bottom-nav-badge {
        position: absolute;
        top: 0;
        right: 50%;
        transform: translateX(100%);
        background: var(--secondary);
        color: white;
        font-size: 0.6rem;
        font-weight: bold;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        animation: badgePulse 2s ease-in-out infinite;
    }

    @keyframes badgePulse {
        0%, 100% { transform: translateX(100%) scale(1); }
        50% { transform: translateX(100%) scale(1.15); }
    }

    .bottom-nav-badge.bounce {
        animation: badgeBounce 0.5s ease;
    }

    @keyframes badgeBounce {
        0% { transform: translateX(100%) scale(1); }
        30% { transform: translateX(100%) scale(1.4); }
        50% { transform: translateX(100%) scale(0.9); }
        70% { transform: translateX(100%) scale(1.2); }
        100% { transform: translateX(100%) scale(1); }
    }

    /* === Bottom nav carrito con productos === */
    @keyframes mobileCartShake {
        0%, 72%, 100% { transform: rotate(0deg) scale(1); }
        75%  { transform: rotate(-14deg) scale(1.15); }
        79%  { transform: rotate(12deg) scale(1.1); }
        83%  { transform: rotate(-8deg) scale(1.05); }
        87%  { transform: rotate(5deg) scale(1.02); }
        91%  { transform: rotate(-2deg) scale(1); }
    }

    .bottom-nav-item.has-items .bottom-nav-icon {
        display: inline-block;
        animation: mobileCartShake 4s ease-in-out infinite;
    }

    @keyframes mobileBadgePop {
        0%, 72%, 100% { transform: translateX(100%) scale(1); }
        76%  { transform: translateX(100%) scale(1.6); }
        81%  { transform: translateX(100%) scale(0.85); }
        86%  { transform: translateX(100%) scale(1.2); }
        91%  { transform: translateX(100%) scale(1); }
    }

    .bottom-nav-item.has-items .bottom-nav-badge {
        animation: mobileBadgePop 4s ease-in-out infinite;
    }
    
    /* ===== CARRITO SIDEBAR ===== */
    .cart-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1001;
    }
    
    .cart-overlay.active {
        display: block;
    }
    
    .cart-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 350px;
        height: 100%;
        background: white;
        z-index: 1002;
        display: flex;
        flex-direction: column;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    }

    .cart-sidebar.active {
        right: 0;
    }
    
    .cart-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }
    
    .cart-header h2 {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .cart-close-btn {
        background: var(--light);
        border: none;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        font-size: 1.2rem;
        cursor: pointer;
    }
    
    .cart-items {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
    }
    
    .cart-empty {
        text-align: center;
        color: var(--gray);
        padding: 2rem;
    }
    
    .cart-item {
        display: flex;
        gap: 0.8rem;
        padding: 0.8rem;
        background: var(--light);
        border-radius: 12px;
        margin-bottom: 0.8rem;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
        border-radius: 8px;
        object-fit: cover;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .cart-item-info {
        flex: 1;
    }
    
    .cart-item-name {
        font-weight: 600;
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }
    
    .cart-item-details {
        font-size: 0.75rem;
        color: var(--gray);
    }
    
    .cart-item-price {
        font-weight: 700;
        color: var(--primary);
        margin-top: 0.3rem;
    }
    
    .cart-item-actions {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .cart-item-view {
        background: none;
        border: none;
        color: #2563eb;
        cursor: pointer;
        padding: 0.5rem;
        font-size: 1rem;
    }

    .cart-item-view:hover {
        color: #1e40af;
    }

    .cart-item-remove {
        background: none;
        border: none;
        color: #ef4444;
        cursor: pointer;
        padding: 0.5rem;
        font-size: 1rem;
    }

    .cart-footer {
        padding: 1rem;
        border-top: 1px solid var(--border);
        padding-bottom: calc(1rem + var(--safe-area-bottom));
    }
    
    .cart-total {
        display: flex;
        justify-content: space-between;
        font-size: 1.1rem;
        font-weight: 700;
        margin-bottom: 1rem;
    }
    
    .checkout-btn {
        width: 100%;
        padding: 1rem;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
    }
    
    .checkout-btn:active {
        background: var(--primary-dark);
    }

    .checkout-btn:disabled {
        background: #ccc;
        color: #888;
        cursor: not-allowed;
        opacity: 0.7;
    }

    .checkout-btn.loading {
        cursor: wait;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .checkout-btn.loading::after {
        content: '';
        width: 14px;
        height: 14px;
        border: 2px solid rgba(255,255,255,0.4);
        border-top-color: white;
        border-radius: 50%;
        animation: btn-spin 0.7s linear infinite;
        flex-shrink: 0;
    }

    /* ===== WISHLIST SIDEBAR ===== */
    .wishlist-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1001;
    }

    .wishlist-overlay.active {
        display: block;
    }

    .wishlist-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 350px;
        height: 100%;
        background: white;
        z-index: 1002;
        display: flex;
        flex-direction: column;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    }

    .wishlist-sidebar.active {
        right: 0;
    }

    .wishlist-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .wishlist-header h2 {
        font-size: 1.2rem;
        margin: 0;
    }

    .wishlist-items {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
        padding-bottom: calc(1rem + var(--safe-area-bottom));
    }

    .product-heart {
        font-size: 0.8rem;
    }

    /* ===== TOAST NOTIFICATIONS ===== */
    .toast-container {
        position: fixed;
        bottom: calc(var(--bottom-nav-height) + 1rem + var(--safe-area-bottom));
        left: 1rem;
        right: 1rem;
        z-index: 2000;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        pointer-events: none;
    }
    
    .toast {
        background: var(--dark);
        color: white;
        padding: 1rem;
        border-radius: 12px;
        font-size: 0.9rem;
        font-weight: 500;
        animation: toastIn 0.3s ease;
        pointer-events: auto;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .toast.success {
        background: var(--secondary);
    }
    
    .toast.error {
        background: #ef4444;
    }
    
    .toast.warning {
        background: #f59e0b;
    }
    
    @keyframes toastIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes toastOut {
        from {
            opacity: 1;
            transform: translateY(0);
        }
        to {
            opacity: 0;
            transform: translateY(20px);
        }
    }
    
    /* ===== LOADING ===== */
    .loading {
        padding: 3rem 1rem;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
    }
    
    /* ===== SKELETON LOADING ===== */
    .skeleton {
        background: linear-gradient(90deg, var(--border) 25%, var(--light) 50%, var(--border) 75%);
        background-size: 200% 100%;
        animation: skeleton 1.5s infinite;
        border-radius: 8px;
    }
    
    @keyframes skeleton {
        0% {
            background-position: 200% 0;
        }
        100% {
            background-position: -200% 0;
        }
    }
    
    .skeleton-card {
        background: white;
        border-radius: 16px;
        overflow: hidden;
    }
    
    .skeleton-image {
        height: 160px;
    }
    
    .skeleton-text {
        height: 14px;
        margin: 0.5rem 0.8rem;
    }
    
    .skeleton-text.short {
        width: 60%;
    }
    
    .skeleton-button {
        height: 36px;
        margin: 0.5rem 0.8rem 0.8rem;
    }
    
    /* ===== PULL TO REFRESH INDICATOR ===== */
    .pull-indicator {
        display: none;
        text-align: center;
        padding: 1rem;
        color: var(--gray);
        font-size: 0.9rem;
    }
    
    .pull-indicator.active {
        display: block;
    }
}

/* ===== TABLET ADJUSTMENTS ===== */
@media (min-width: 481px) and (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-image {
        aspect-ratio: 9/10;
    }
    
    .cart-sidebar {
        max-width: 400px;
    }

    .wishlist-sidebar {
        max-width: 400px;
    }
}

/* ===== LANDSCAPE MÓVIL ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        flex-direction: unset;
    }

    .main-image {
        aspect-ratio: 9/10;
    }
    
    .bottom-nav {
        height: 50px;
    }
    
    .bottom-nav-icon {
        font-size: 1.1rem;
    }
    
    .bottom-nav-label {
        display: none;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    /* Opcional: agregar soporte dark mode */
}



/* Nav visible sobre el modal en móvil */
@media (max-width: 768px) {
    /* body.modal-open en estilos-shein.css usa position:fixed (desktop scroll lock).
       En móvil lo revertimos a static para que position:fixed del nav funcione bien. */
    body.modal-open {
        position: static !important;
    }
}

/* ===== BANNER INSTALAR PWA ===== */
.pwa-install-banner {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    z-index: 1200;
    animation: slideUpBanner 0.4s ease;
}

@keyframes slideUpBanner {
    from { transform: translateY(120%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.pwa-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
}

.pwa-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pwa-text strong {
    font-size: 0.85rem;
    color: var(--dark);
}

.pwa-text span {
    font-size: 0.72rem;
    color: var(--gray);
}

.pwa-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.pwa-dismiss {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    flex-shrink: 0;
}

/* Animación pulso para botón agregar al carrito */
@keyframes pulseCart {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 12px rgba(255, 107, 53, 0.5); }
}

@keyframes shimmer {
    0%, 100% { left: -100%; }
    50% { left: 120%; }
}

/* ===== PROTECCIÓN DE IMÁGENES MÓVIL ===== */

/* Bloquear long-press (menú guardar imagen) */
.product-image img,
.main-image-container img,
.thumbnail,
.gallery img {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}
