/* ==========================================================================
   Shop: Popular Pieces & Product Card
   ========================================================================== */

.hs-popular-section {
    width: 100%;
    padding: 60px 40px;
    background-color: #FAF9F6; 
}

.hs-popular-inner {
    max-width: 1440px;
    margin: 0 auto;
}

/* --- CABECERA --- */
.hs-popular-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500; 
    font-size: 40px;
    color: #000;
    margin: 0 0 15px 0;
    text-transform: uppercase;
}

.hs-popular-divider {
    border: none;
    height: 1px;
    background-color: #D6D6D6; 
    margin-bottom: 40px;
}

/* --- TRACK DEL SLIDER --- */
.hs-slider-wrapper {
    width: 100%;
    overflow: hidden; 
}

.hs-slider-track {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scrollbar-width: none; 
    -ms-overflow-style: none;  
    cursor: grab;
    padding-bottom: 10px;
}

.hs-slider-track::-webkit-scrollbar {
    display: none; 
}

.hs-slider-track.active {
    cursor: grabbing;
}

/* --- TARJETA DE PRODUCTO --- */
.hs-product-card {
    flex: 0 0 443px; 
    display: flex;
    flex-direction: column;
    user-select: none; 
}

/* Contenedor Imagen y el Enlace */
.hs-product-img-wrap {
    position: relative;
    width: 100%;
    height: 470px;
    background-color: #EAEAEA;
    margin-bottom: 15px;
    overflow: hidden;
}

/* Convertimos el enlace en un bloque que cubre el 100% para atrapar los clics */
.hs-product-img-link {
    display: block;
    width: 100%;
    height: 100%;
    /* Bloqueo absoluto de arrastre en todos los motores */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

.hs-product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-user-drag: none; /* Bloquea el ghost dragging pero permite el clic */
}

/* Etiqueta Superior Izquierda */
.hs-badge-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    height: 24px;
    background-color: #E1DDD8;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600; 
    font-size: 16px;
    color: #000;
}

/* Favorito Inferior Derecha */
.hs-fav-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 32px; 
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hs-fav-btn img {
    width: 100%;
    height: auto;
}

/* Información Base */
.hs-product-info {
    display: flex;
    flex-direction: column;
}

.hs-product-cat {
    font-family: 'General Sans', sans-serif;
    font-weight: 400; 
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    pointer-events: none;
}

.hs-product-cat a {
    color: inherit;
    text-decoration: none;
    pointer-events: auto;
}

/* Fila Título y Precio */
.hs-title-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.hs-product-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600; 
    font-size: 18px;
    color: #000;
    text-decoration: none;
}

.hs-product-price {
    font-family: 'Cinzel', serif;
    font-weight: 500; 
    font-size: 18px;
    color: #000;
}

/* Botón Add to Bag */
.hs-add-to-bag {
    display: inline-flex !important;
    align-items: center;
    justify-content: space-between;
    width: fit-content;
    padding: 8px 20px !important;
    border: 1px solid #000 !important;
    border-radius: 82px !important;
    background-color: transparent !important;
    color: #000 !important;
    font-family: 'Cormorant Garamond', serif !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    gap: 15px;
    transition: all 0.3s ease !important;
}

.hs-bag-icon-card {
    width: 24px !important;
    height: 24px !important;
    object-fit: contain;
    transition: all 0.3s ease;
}

.hs-add-to-bag:hover {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
}

.hs-add-to-bag:hover .hs-bag-icon-card {
    filter: invert(1); 
}

/* --- BARRA DE PROGRESO --- */
.hs-progress-container {
    width: 100%;
    height: 2px;
    background-color: #D6D6D6;
    margin-top: 30px;
    position: relative;
    border-radius: 2px;
}

.hs-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #000;
    width: 20%; 
    border-radius: 2px;
}

/* =========================================
   MOBILE VIEW (< 1024px)
   ========================================= */
@media (max-width: 1023px) {
    .hs-popular-section {
        padding: 40px 20px; /* Reducimos el padding lateral para ganar espacio */
    }

    .hs-popular-title {
        font-size: 32px; /* Título un poco más pequeño */
    }

    .hs-slider-track {
        gap: 15px; /* Menos espacio entre las tarjetas */
    }

    /* Forzamos a que solo se vean 2 tarjetas calculando el 50% menos el espacio del gap */
    .hs-product-card {
        flex: 0 0 calc(50% - 7.5px); 
    }

    /* Mantenemos la proporción de la imagen sin importar qué tan chica sea la pantalla */
    .hs-product-img-wrap {
        height: auto;
        aspect-ratio: 443 / 470;
    }

    /* --- TEXTOS E ICONOS MÓVILES --- */
    .hs-badge-tag {
        font-size: 14px;
        height: 22px;
        top: 10px;
        left: 10px;
    }

    .hs-fav-btn {
        width: 28px; /* Hacemos el corazón apenas más pequeño */
        height: 28px;
        bottom: 10px;
        right: 10px;
    }

    .hs-product-cat {
        font-size: 12px;
    }

    /* Aquí es donde cambiamos la estructura para que Precio baje debajo del Título */
    .hs-title-price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px; 
        margin-bottom: 15px;
    }

    .hs-product-title, 
    .hs-product-price {
        font-size: 18px;
    }

    /* --- BOTÓN DE COMPRA --- */
    .hs-add-to-bag {
        font-size: 16px !important;
        padding: 6px 15px !important;
    }

    .hs-bag-icon-card {
        width: 20px !important;
        height: 20px !important;
    }
}

/* =========================================
   MOBILE SMALL VIEW (< 480px) Opcional
   ========================================= */
@media (max-width: 480px) {
    /* Si en celulares muy delgados 2 tarjetas se ven muy apretadas, 
       podemos dejarlas en 1 tarjeta y media para invitar al scroll */
    .hs-product-card {
        flex: 0 0 calc(65vw); 
    }
}

/* ==========================================================================
   BLINDAJE CONTRA WOOCOMMERCE (Fix para la página Shop)
   ========================================================================== */
.woocommerce .hs-slider-track .hs-product-card,
.woocommerce-page .hs-slider-track .hs-product-card,
.hs-slider-track .product {
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    width: auto !important; /* Matamos el ancho forzado de WooCommerce */
    max-width: none !important;
}

/* Asegurarnos de que el track no colapse su altura */
.hs-slider-track {
    display: flex !important;
    align-items: stretch;
}