/* Variables Globales - Estilo ML */
:root {
    --sa-color-primary: #3483fa; /* Azul ML */
    --sa-color-primary-hover: #2968c8;
    --sa-color-secondary: #e3edfb; /* Celeste ML para carrito */
    --sa-color-secondary-hover: #c4d9f6;
    --sa-color-success: #00a650; /* Verde ML */
    --sa-color-bg: #ebebeb; /* Fondo general ML */
    --sa-color-card-bg: #ffffff;
    --sa-color-text-dark: #333333;
    --sa-color-text-muted: #999999;
    --sa-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Reset Básico para el CPT */
.sa-cpt-container, .sa-cpt-archive {
    font-family: var(--sa-font-family);
    background: linear-gradient(to bottom, #ffffff 0%, #F7F5F0 200px, #F7F5F0 100%); /* Degradado blanco a beige/gris cálido */
    color: var(--sa-color-text-dark);
    padding: 20px 0 0 0 !important; /* El aire inferior ahora lo da el zócalo */
    min-height: 100vh;
    -webkit-touch-callout: none; /* iOS Safari: Evita menú contextual al mantener apretado */
    -webkit-tap-highlight-color: transparent; /* Android: Evita recuadro gris al hacer touch */
}

/* Zócalo Inferior Sólido */
.sa-zocalo-inferior {
    background-color: #F7F5F0;
    height: 350px;
    width: 100%;
    margin: 0;
    padding: 0;
    display: block;
}

.sa-cpt-container * {
    box-sizing: border-box;
}
.sa-cpt-archive * {
    box-sizing: border-box;
}

/* -------------------------------------
   LAYOUT ARCHIVE (CATÁLOGO)
-------------------------------------- */
.sa-archive-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    gap: 30px;
}

.sa-sidebar {
    display: none;
}

.sa-sidebar-widget {
    margin-bottom: 25px;
}

.sa-sidebar-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--sa-color-text-dark);
}

.sa-products-content {
    flex: 1;
    width: 100%;
}

/* Filtros de Categorías Horizontales (Pills) */
.sa-category-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0 20px 0;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch; /* Suave en iOS */
    scrollbar-width: none; /* Ocultar scrollbar en Firefox */
}
.sa-category-filters::-webkit-scrollbar {
    display: none; /* Ocultar scrollbar en Chrome/Safari */
}

/* Indicadores de scroll móvil (puntos/píldoras) */
.sa-scroll-dot {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 4px;
    transition: all 0.3s ease;
}
.sa-scroll-dot.active {
    width: 18px;
    background: #475569;
}

/* Ocultar en Desktop, mostrar en móviles usando flex */
.sa-mobile-only-flex {
    display: none !important;
}
@media (max-width: 768px) {
    .sa-mobile-only-flex {
        display: flex !important;
    }
}
/* -------------------------------------
   NAVEGACIÓN DE CATEGORÍAS
-------------------------------------- */
.sa-category-navigation-container {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.sa-category-navigation-container a {
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

.sa-filter-btn {
    display: inline-block;
    padding: 6px 14px;
    background: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    white-space: nowrap;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    line-height: 1.2;
}
.sa-filter-btn:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.sa-filter-btn:active {
    transform: scale(0.96);
}
.sa-filter-btn.active {
    background: #1e293b;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(30,41,59,0.25);
    transform: translateY(-1px);
}
.sa-filter-btn.active:active {
    transform: scale(0.96) translateY(-1px);
}

.sa-products-grid {
    display: block;
    width: 100%;
}
.sa-products-grid.masonry-loaded {
    transform: translateX(7.5px); /* Centrado simétrico: reparte los 15px sobrantes de la derecha */
}
.sa-products-grid:not(.masonry-loaded) .sa-product-card {
    margin-right: 15px; /* Evita que se vean pegados durante el primer segundo de carga */
}
.sa-products-grid::after {
    content: '';
    display: block;
    clear: both;
}

/* Tarjeta de Producto (Card) */
.sa-product-card {
    background: var(--sa-color-card-bg);
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s ease-in-out, transform 0.1s ease, filter 0.1s ease;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
    position: relative;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    width: calc(25% - 16px); /* 4 Columnas con amplio margen de seguridad */
    margin-bottom: 15px;
    float: left; /* Fallback antes de que cargue Masonry */
}

.sa-product-card:hover {
    box-shadow: 0 7px 16px 0 rgba(0,0,0,.1);
}

.sa-product-card:active {
    transform: scale(0.98);
    filter: brightness(0.96);
}

.sa-card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Aspect ratio 1:1 */
    background-color: #ffffff;
}

.sa-card-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0;
}

.sa-card-info {
    padding: 15px 15px 20px;
    border-top: 1px solid #f5f5f5;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.sa-card-price-row {
    display: flex;
    align-items: baseline;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 8px;
}

.sa-card-price {
    font-size: 22px;
    font-weight: 400;
    color: var(--sa-color-text-dark);
    margin: 10px 0 0 0;
    line-height: 1;
}

.sa-card-discount {
    color: var(--sa-color-success);
    font-size: 13px;
    font-weight: 400;
}

.sa-card-shipping {
    color: var(--sa-color-success);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
}

.sa-card-title {
    font-size: 14px;
    font-weight: 400;
    color: var(--sa-color-text-dark);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Botón flotante agregar carrito (Mobile Style) */
.sa-btn-add-cart-floating {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: var(--sa-color-secondary);
    color: var(--sa-color-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background 0.2s;
}

.sa-btn-add-cart-floating:hover {
    background: var(--sa-color-secondary-hover);
}

.sa-btn-add-cart-floating svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* -------------------------------------
   TARJETAS DE PUBLICIDAD (INTERSTICIALES)
-------------------------------------- */
.sa-info-card a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}
.sa-info-card .sa-card-image-wrapper {
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.sa-info-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}
.sa-info-card-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 15px;
    background: #111111; /* Grafito oscuro / Negro Premium */
    border-top: none;
}
.sa-info-card-title {
    margin-bottom: 6px;
    font-weight: 700;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.2;
}
.sa-info-card-desc {
    font-size: 13px;
    color: #a1a1aa; /* Gris claro */
    margin: 0;
    line-height: 1.4;
}

/* -------------------------------------
   LISTÓN DE DESTACADOS (FEATURED RIBBON)
-------------------------------------- */
.sa-featured-ribbon {
    position: absolute;
    top: 0;
    left: 12px; /* Alineado un poco hacia adentro */
    width: 24px;
    height: 42px;
    background-color: #8b0000; /* Bordó premium / Dark Red */
    z-index: 10;
    /* Recorte en V en la parte inferior para darle forma de cinta */
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 10px), 0 100%);
    filter: drop-shadow(0 3px 3px rgba(0,0,0,0.4)); /* Sombra para dar efecto de tela flotando */
}

/* -------------------------------------
   LAYOUT SINGLE (PRODUCTO INDIVIDUAL)
-------------------------------------- */
.sa-single-layout {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    display: flex;
    flex-wrap: wrap;
    padding: 30px;
    /* Sin border, sin box-shadow para que flote en el fondo blanco */
}

.sa-single-gallery-col {
    flex: 1 1 50%;
    min-width: 300px;
    padding-right: 30px;
}

.sa-single-info-col {
    flex: 1 1 40%;
    min-width: 300px;
    padding-left: 30px;
    border-left: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

/* Galería Single Moderna */
.sa-gallery-container {
    position: relative;
    width: 100%;
}

.sa-gallery-main-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #ffffff;
    border-radius: 8px;
}

.sa-gallery-track {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    scroll-behavior: smooth;
}

.sa-gallery-track::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.sa-gallery-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sa-gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Flechas Desktop */
.sa-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: #333;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.sa-gallery-main-wrapper:hover .sa-gallery-arrow {
    opacity: 1;
}

.sa-gallery-arrow:hover {
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.sa-gallery-prev {
    left: 10px;
}

.sa-gallery-next {
    right: 10px;
}

/* Contador 1/5 */
.sa-gallery-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 10;
}

/* Dots Mobile (Ocultos por defecto en Desktop) */
.sa-gallery-dots {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    display: none; /* Se muestra en mobile */
    justify-content: center;
    gap: 6px;
    z-index: 10;
}

.sa-gallery-dot {
    width: 8px;
    height: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    transition: background 0.3s;
}

.sa-gallery-dot.active {
    background: rgba(0, 0, 0, 0.7);
}

/* Miniaturas Desktop */
.sa-gallery-thumbnails-desktop {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.sa-gallery-thumb {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
    background: #f9f9f9;
}

.sa-gallery-thumb:hover {
    border-color: #ccc;
}

.sa-gallery-thumb.active {
    border-color: #333333; /* Borde oscuro solicitado */
}

/* Info Single */
.sa-single-condition {
    font-size: 14px;
    color: var(--sa-color-text-muted);
    margin-bottom: 5px;
}

.sa-single-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--sa-color-text-dark);
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.sa-single-price-block {
    margin-bottom: 20px;
}

.sa-single-price {
    font-size: 36px;
    font-weight: 300;
    color: var(--sa-color-text-dark);
    margin: 0;
    line-height: 1;
}

.sa-single-shipping {
    color: var(--sa-color-success);
    font-size: 16px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

.sa-single-shipping span.bold {
    font-weight: 600;
}

/* Acciones (Comprar / Carrito) */
.sa-single-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto; /* Empuja los botones hacia abajo si hay espacio */
}

.sa-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}

.sa-btn-primary {
    background: var(--sa-color-primary);
    color: #fff;
}
.sa-btn-primary:hover {
    background: var(--sa-color-primary-hover);
}

.sa-btn-secondary {
    background: var(--sa-color-secondary);
    color: var(--sa-color-primary);
}
.sa-btn-secondary:hover {
    background: var(--sa-color-secondary-hover);
}

/* Selector de cantidad */
.sa-quantity-selector {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}
.sa-quantity-selector select {
    margin-left: 10px;
    padding: 5px;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}

/* -------------------------------------
   TABLA DE CARACTERÍSTICAS
-------------------------------------- */
.sa-features-table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 20px;
}
.sa-features-title {
    font-size: 18px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--sa-color-text-dark);
}
.sa-features-table {
    width: 100%;
    border-collapse: collapse;
}
.sa-features-table th, .sa-features-table td {
    padding: 12px 15px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.sa-features-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    width: 40%;
}
.sa-features-table td {
    color: #334155;
}
.sa-row-odd th, .sa-row-odd td {
    background-color: #ffffff;
}
.sa-row-even th, .sa-row-even td {
    background-color: #f8fafc;
}

/* -------------------------------------
   MEDIA QUERIES (RESPONSIVE)
-------------------------------------- */
/* Visibilidad por dispositivo */
.sa-desktop-only { display: block; }
.sa-mobile-only { display: none; }

@media (max-width: 1024px) {
    .sa-product-card {
        width: calc(33.333% - 16px); /* 3 Columnas con margen de seguridad */
    }
}

@media (max-width: 768px) {
    /* Visibilidad */
    .sa-desktop-only { display: none; }
    .sa-mobile-only { display: block; }

    /* Archive Mobile */
    .sa-archive-layout {
        flex-direction: column;
        padding: 0;
    }
    
    /* Sidebar (Oculto en favor de los filtros horizontales) */
    .sa-sidebar {
        display: none;
    }
    
    /* Wrapper general para celular (estilo app) */
    .sa-cpt-archive {
        padding: 0 8px 0 8px !important; /* El aire inferior ahora lo da el zócalo */
    }
    
    .sa-products-grid {
        display: block;
        width: 100%;
        background: transparent;
        padding: 0; /* Padding causes calculation bugs in Masonry */
        margin: 0 auto;
    }
    
    .sa-products-grid.masonry-loaded {
        transform: translateX(5px); /* Centrado simétrico: reparte los 10px sobrantes de la derecha en Mobile */
    }
    .sa-products-grid:not(.masonry-loaded) .sa-product-card {
        margin-right: 10px; /* Separación inicial en Mobile */
    }
    
    .sa-product-card {
        border-radius: 6px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        border: none;
        background: #fff;
        width: calc(50% - 10px); /* Margen de seguridad gigante para evitar 1 columna */
        margin-bottom: 10px;
    }

    .sa-card-image-wrapper {
        border-radius: 6px 6px 0 0;
        background-color: #ffffff; /* Fondo blanco */
    }

    .sa-card-image-wrapper img {
        padding: 0; /* Imagen borde a borde */
        border-radius: 6px 6px 0 0; /* Cortar puntas como la tarjeta */
    }
    
    /* Ajustes específicos para las Tarjetas de Publicidad en Mobile */
    .sa-info-card-info {
        padding: 12px 6px; /* Menos relleno lateral para dar respiro al texto */
    }
    .sa-info-card-title {
        font-size: 13.5px; /* Evita que frases como "A domicilio sin costo" salten de línea */
    }
    .sa-info-card-desc {
        font-size: 12px;
    }

    /* Single Mobile */
    .sa-single-layout {
        flex-direction: column;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        background: #ffffff;
    }

    .sa-single-gallery-col {
        padding: 0;
        background: #ffffff;
        margin-bottom: 10px;
    }

    /* Mobile Gallery Ajustes */
    .sa-gallery-thumbnails-desktop {
        display: none; /* Ocultar miniaturas en móvil */
    }

    .sa-gallery-dots {
        display: flex; /* Mostrar dots en móvil */
    }

    .sa-gallery-arrow {
        display: none; /* Ocultar flechas en móvil para favorecer swipe */
    }

    .sa-single-info-col {
        padding: 5px 15px 20px 15px;
        border-left: none;
        background: #ffffff;
    }
}

/* -------------------------------------
   NUEVOS ESTILOS: TARJETAS DE PRECIO
-------------------------------------- */
.sa-price-cards-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sa-price-card {
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sa-price-card-highlighted {
    background-color: #2d2d2d;
    color: #ffffff;
}

.sa-price-card-highlighted .sa-single-price {
    color: #ffffff;
    font-size: 32px;
    font-weight: 600;
    margin: 5px 0 0 0;
}

.sa-price-card-highlighted .sa-price-card-label {
    color: #aaaaaa;
    font-size: 13px;
}

.sa-price-card-highlighted .sa-price-extra-text {
    color: #cccccc;
    font-size: 13px;
    font-weight: 300;
    margin-top: 5px;
    line-height: 1.3;
}

.sa-price-card-secondary {
    background-color: #f5f5f5;
    color: #333333;
    flex: 1;
    padding: 10px 15px; /* Compact padding */
}

.sa-price-card-compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.sa-price-card-compact-row .sa-price-card-label {
    color: #777777;
    font-size: 13px;
    font-weight: 600;
}

.sa-price-compact-right {
    display: flex;
    align-items: center;
}

.sa-secondary-price {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    color: #333333;
}

.sa-price-compact-extra {
    font-size: 12px;
    margin-top: 2px;
    font-weight: 400;
}

.sa-ml-green {
    color: #00a650;
    font-weight: 600;
}

.sa-price-disclaimer {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
    font-style: italic;
}

/* -------------------------------------
   NUEVOS ESTILOS: VARIANTES MODERNAS (Floating Label)
-------------------------------------- */
.sa-variant-floating-container {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sa-variant-floating-container:hover {
    border-color: #cbd5e1;
}

.sa-variant-floating-container:focus-within {
    border-color: #333333;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.sa-variant-floating-label {
    position: absolute;
    top: 6px;
    left: 15px;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sa-variant-floating-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    padding: 24px 40px 10px 15px; /* Espacio para label arriba y flecha a la derecha */
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    outline: none;
    line-height: 1.2;
    min-height: 54px;
}

.sa-variant-floating-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94a3b8;
    pointer-events: none;
}

/* -------------------------------------
   NUEVOS ESTILOS: VARIANTES BOTONES (PILLS)
-------------------------------------- */
.sa-variant-pill {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #333333;
    padding: 6px 16px; /* Reducida la altura vertical */
    border-radius: 4px; /* Forma rectangular */
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.sa-variant-pill:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.sa-variant-pill.active {
    border-color: #111111;
    color: #ffffff;
    background: #111111;
    box-shadow: none;
}

/* Validación Errores */
.sa-variant-error .sa-variant-pills-label {
    color: #ef4444 !important;
}
.sa-variant-error .sa-variant-pill {
    border-color: #fecaca;
    background: #fff5f5;
    color: #ef4444;
}

@keyframes sa-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.sa-shake {
    animation: sa-shake 0.3s ease-in-out;
}

/* -------------------------------------
   NUEVOS ESTILOS: CANTIDAD Y CARRITO
-------------------------------------- */
.sa-qty-modern-control {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    height: 48px;
    flex: 0 0 105px;
}

.sa-qty-btn {
    background: #f9f9f9;
    border: none;
    width: 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555555;
    transition: background 0.2s;
}

.sa-qty-btn:hover {
    background: #eeeeee;
}

.sa-qty-input {
    width: 41px;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    -moz-appearance: textfield;
}

.sa-qty-input::-webkit-outer-spin-button,
.sa-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sa-btn-modern-gradient {
    background: linear-gradient(to bottom, #333333, #1a1a1a);
    color: #ffffff !important;
    flex-grow: 1;
    height: 48px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.sa-btn-modern-gradient span {
    color: #ffffff !important;
}

.sa-btn-modern-gradient:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    background: linear-gradient(to bottom, #2b2b2b, #111111);
}

.sa-btn-modern-gradient:active {
    transform: scale(0.98);
}
/* Tarjetas Logisticas */
.sa-logistics-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sa-logistics-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    background: #ffffff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sa-logistics-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.sa-icon-primary {
    font-size: 20px;
    color: #334155; /* Gris Oscuro Premium */
    width: 25px;
    text-align: center;
    margin-top: 2px;
}
.sa-logistics-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sa-logistics-title {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}
.sa-logistics-desc {
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}
.sa-text-green {
    color: #16a34a;
}

/* Rediseño de Galería Frontend (Fase 8) */
.sa-price-divider {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin: 6px 0;
}
.sa-mp-total {
    display: block;
    font-size: 14px;
    color: #475569;
    font-weight: 600;
}
.sa-card-mp-row {
    margin-top: 4px;
}
.sa-mp-cuotas {
    color: #00a650;
    font-size: 13px;
    font-weight: 500;
}
.sa-card-badges {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}
.sa-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}
.sa-badge i {
    margin-right: 4px;
}
.sa-badge-envio {
    background: #334155; /* Gris Oscuro Plomo para evitar confusión con "Gratis" */
    color: #ffffff;
}
.sa-badge-local {
    background: #00a650;
    color: #ffffff;
}
.sa-badge-stock {
    background: #fff3cd;
    color: #856404;
}

/* Botón Flotante de Carrito en Tarjeta */
.sa-btn-add-cart-floating {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #f8f9fa;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    z-index: 10;
}
.sa-btn-add-cart-floating:hover {
    background: #334155;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Modal Quick View */
.sa-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.sa-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: saModalFadeIn 0.3s ease-out;
}
.sa-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}
.sa-modal-close:hover {
    color: #0f172a;
}
@keyframes saModalFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ajustes Responsive Extras */
@media (max-width: 768px) {
    .sa-card-price {
        font-size: 20px;
    }
}

/* -------------------------------------
   SLIDERS DE PRODUCTOS RELACIONADOS
-------------------------------------- */
.sa-product-slider::-webkit-scrollbar {
    display: none;
}
.sa-product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sa-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1) !important;
}

/* -------------------------------------
   BARRA DE ACCIÓN (Buscador + PWA)
-------------------------------------- */
.sa-top-action-bar {
    max-width: 1200px;
    margin: 15px auto 12px auto;
    padding: 0 15px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px; /* Espacio entre buscador y botón app */
}

/* Buscador Inteligente */
.sa-search-container {
    flex-grow: 1; /* Esto hace que el buscador ocupe todo el espacio disponible */
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    padding: 4px 4px 4px 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.sa-search-container:focus-within {
    border-color: #1e293b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.sa-search-icon {
    color: #52525b;
    font-size: 14px;
    margin-right: 8px;
}
.sa-search-input {
    flex-grow: 1;
    border: none !important;
    background: transparent !important;
    padding: 6px 0 !important;
    font-size: 14px !important;
    color: #27272a !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: var(--sa-font-family);
    min-width: 0; /* Previene desbordamiento en flexbox */
}
.sa-search-input::placeholder {
    color: #a1a1aa;
}
.sa-search-btn {
    background: #1e293b;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: var(--sa-font-family);
}
.sa-search-btn:active {
    background: #0f172a;
}

/* Botón Instalar App (Reubicado) */
.sa-install-pwa-btn {
    background: linear-gradient(to bottom, #2a384f 0%, #1e293b 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.1), 0 3px 6px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    font-family: var(--sa-font-family);
    letter-spacing: 0.3px;
    white-space: nowrap; /* Evita que el texto se rompa en 2 líneas */
    flex-shrink: 0; /* Evita que el botón se achique demasiado */
}
.sa-install-pwa-btn:active {
    transform: scale(0.96);
}
.sa-install-pwa-btn i {
    font-size: 13px;
    opacity: 0.9;
}
@media (max-width: 768px) {
    .sa-top-action-bar {
        padding: 0 10px;
    }
}

/* Ocultar el botón si ya está instalada y ejecutándose como App (Standalone) */
@media all and (display-mode: standalone) {
    .sa-install-pwa-btn {
        display: none !important;
    }
}


/* Interstitial Carousel */
.sa-info-card .sa-card-image-wrapper {
    position: relative;
    overflow: hidden;
}
.sa-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}
.sa-carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

/* Interstitial Popup */
.sa-info-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.sa-info-popup-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}
.sa-info-popup-content img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}
.sa-info-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100000;
    transition: background 0.3s;
}
.sa-info-popup-close:hover {
    background: rgba(220, 38, 38, 0.9);
}

/* --- Migas de Pan (Breadcrumbs) --- */
.sa-breadcrumbs {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sa-breadcrumbs a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}
.sa-breadcrumbs a:hover {
    color: #2563eb;
    text-decoration: underline;
}
.sa-breadcrumbs i {
    font-size: 10px;
    color: #94a3b8;
}
.sa-breadcrumbs .sa-current-crumb {
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}
@media (max-width: 768px) {
    .sa-breadcrumbs {
        font-size: 12px;
        margin-bottom: 10px;
    }
    .sa-breadcrumbs .sa-current-crumb {
        max-width: 150px;
    }
}
