/**
 * ==========================================================
 * SIDV Theme
 * ----------------------------------------------------------
 * Component: Product Card
 * ----------------------------------------------------------
 * Estilos para la tarjeta individual de producto en grillas,
 * carruseles y resultados de búsqueda.
 * ==========================================================
 */

/*==================================================
1. ESTRUCTURA Y CONTENEDOR PRINCIPAL
==================================================*/

.sidv-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background-color: #FFFFFF;
    border: 1px solid #E8EDF3;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(13, 33, 55, 0.04);
    transition: 
        transform .3s cubic-bezier(0.16, 1, 0.3, 1),
        border-color .3s ease,
        box-shadow .3s ease,
        opacity .25s ease;
}

.sidv-product-card:hover {
    transform: translateY(-5px);
    border-color: #FF9800;
    box-shadow: 0 16px 36px rgba(13, 33, 55, 0.1);
}

.sidv-product-card:focus-within {
    border-color: #FF9800;
    outline: 2px solid rgba(255, 152, 0, 0.25);
}

/*==================================================
2. MULTIMEDIA E IMAGEN DE PRODUCTO
==================================================*/

.sidv-product-card__media {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    padding: 1.25rem;
    background-color: #FFFFFF;
    border-bottom: 1px solid #F3F4F6;
}

.sidv-product-card__image-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    outline: none;
}

.sidv-product-card__img,
.sidv-product-card__media img {
    width: 100%;
    height: 100%;
    max-height: 180px;
    object-fit: contain;
    transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.sidv-product-card:hover .sidv-product-card__img,
.sidv-product-card:hover .sidv-product-card__media img {
    transform: scale(1.06);
}

/*==================================================
3. INSIGNIAS Y ETIQUETAS (BADGES)
==================================================*/

.sidv-product-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .35rem .75rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1;
    pointer-events: none;
}

.sidv-product-card__badge--sale {
    background-color: #EF4444;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

/*==================================================
4. ACCIONES FLOTANTES (WISHLIST / QUICKVIEW)
==================================================*/

.sidv-product-card__actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.sidv-product-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #0D2137;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(13, 33, 55, 0.08);
    transition: 
        background-color .2s ease,
        color .2s ease,
        transform .2s ease,
        opacity .2s ease;
}

.sidv-product-card__action-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    pointer-events: none;
}

.sidv-product-card__action:hover,
.sidv-product-card__action:focus-visible {
    background-color: #FF9800;
    color: #FFFFFF;
    transform: scale(1.08);
    outline: none;
}

.sidv-product-card__action.is-active {
    background-color: #FF9800;
    color: #FFFFFF;
}

.sidv-product-card__action.is-loading {
    opacity: .6;
    pointer-events: none;
}

.sidv-product-card__action:disabled {
    opacity: .45;
    pointer-events: none;
    cursor: not-allowed;
}

/*==================================================
5. CUERPO E INFORMACIÓN
==================================================*/

.sidv-product-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.15rem;
}

/* CATEGORÍA */
.sidv-product-card__category {
    margin-bottom: .4rem;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #FF9800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidv-product-card__category a {
    color: inherit;
    text-decoration: none;
    transition: color .2s ease;
}

.sidv-product-card__category a:hover {
    color: #0D2137;
}

/* TÍTULO */
.sidv-product-card__title {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidv-product-card__title a {
    color: #0D2137;
    text-decoration: none;
    transition: color .2s ease;
}

.sidv-product-card__title a:hover,
.sidv-product-card__title a:focus-visible {
    color: #FF9800;
    outline: none;
}

/* SKU */
.sidv-product-card__sku {
    display: block;
    margin-top: .35rem;
    font-size: .75rem;
    font-weight: 500;
    color: #98A2B3;
}

/* PRECIO */
.sidv-product-card__price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .75rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0D2137;
    line-height: 1.1;
}

.sidv-product-card__price del {
    font-size: .88rem;
    color: #98A2B3;
    font-weight: 500;
    text-decoration: line-through;
}

.sidv-product-card__price ins {
    text-decoration: none;
    color: #0D2137;
}

/* DISPONIBILIDAD (STOCK) */
.sidv-product-card__stock {
    margin-top: .5rem;
}

.sidv-product-card__stock-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    font-weight: 600;
}

.sidv-product-card__stock-status--available {
    color: #16A34A;
}

.sidv-product-card__stock-status--unavailable {
    color: #DC2626;
}

/* CONTROLES DE COMPRA */
.sidv-product-card__purchase {
    margin-top: auto;
    padding-top: 1rem;
}

/*==================================================
6. ESTADOS Y MODIFICADORES DE TARJETA
==================================================*/

.sidv-product-card--out-of-stock .sidv-product-card__img {
    filter: grayscale(0.2);
    opacity: .85;
}

.sidv-product-card.is-loading {
    opacity: .7;
    pointer-events: none;
}

.sidv-product-card.is-disabled {
    opacity: .55;
    pointer-events: none;
}

/*==================================================
7. ADAPTACIÓN RESPONSIVA
==================================================*/

@media (max-width: 768px) {
    .sidv-product-card__body {
        padding: 1rem;
    }

    .sidv-product-card__media {
        padding: 1rem;
    }

    .sidv-product-card__action {
        width: 36px;
        height: 36px;
    }

    .sidv-product-card__title {
        font-size: .9rem;
    }

    .sidv-product-card__price {
        font-size: 1.15rem;
    }
}