/* UI bundle css — generado automáticamente; no editar */

/* --- component:media-card --- */
/**
 * media-card — card unificada de imagen + texto.
 *
 * Autocontenida: no depende de las familias .hero-grid / .category-* de
 * site.css. Solo se carga donde se llama a use_component('media-card'),
 * hoy únicamente en /ui.
 */

.media-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    border: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    color: #111;
    text-decoration: none;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
/* Fondo blanco salvo que la card traiga su propia utilidad bg-* (variante panel) */
.media-card:not([class*="bg-"]) {
    background-color: #fff;
}
.media-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    color: #111;
}

/* --- media ------------------------------------------------------------- */

.media-card__media {
    position: relative;
    display: block;
    flex-shrink: 0;
    overflow: hidden;
    background-color: #eee;
}
.media-card__media picture {
    display: block;
    width: 100%;
    height: 100%;
}
.media-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}
.media-card:hover .media-card__img {
    transform: scale(1.04);
}
.media-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.25rem;
    color: #555;
}

/* --- cuerpo ------------------------------------------------------------ */

.media-card__body {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    padding: 1rem 1.15rem 1.15rem;
}
.media-card__text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}
.media-card__title {
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.35;
}
.media-card__desc {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #666;
}
.media-card__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.1rem;
    height: 2.1rem;
    margin-left: auto;
    border-radius: 50%;
    background-color: #eee;
    color: #111;
    font-size: 1rem;
    transition: background-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}
.media-card:hover .media-card__arrow {
    background-color: #111;
    color: #fff;
    transform: translateX(3px);
}
.media-card__cta {
    display: block;
    margin-top: 0.85rem;
}
.media-card > .stretched-link::after {
    z-index: 3;
}

/* --- variante stack ----------------------------------------------------- */

.media-card--stack .media-card__media {
    aspect-ratio: 5 / 4;
}

/* --- variante row ------------------------------------------------------- */

.media-card--row {
    flex-direction: row;
    align-items: stretch;
}
.media-card--row .media-card__media {
    width: 38%;
    max-width: 11rem;
    aspect-ratio: auto;
}
.media-card--row .media-card__body {
    align-items: flex-start;
}
.media-card--row .media-card__arrow {
    align-self: center;
}

/* --- variante overlay --------------------------------------------------- */

.media-card--overlay .media-card__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.media-card--overlay .media-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.15) 45%, rgba(0, 0, 0, 0) 75%);
}
.media-card--overlay .media-card__body {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 14rem;
    padding: 1.25rem;
    color: #fff;
}
/* El texto no debe estirarse: se apoya en el borde inferior, sobre el degradado */
.media-card--overlay .media-card__text {
    flex: 0 1 auto;
}
.media-card--overlay .media-card__title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.15;
}
.media-card--overlay .media-card__desc {
    color: rgba(255, 255, 255, 0.88);
}
.media-card--overlay .media-card__arrow {
    margin-left: 0;
    background-color: rgba(255, 255, 255, 0.9);
}

/* --- variante panel ----------------------------------------------------- */

.media-card--panel .media-card__body {
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 12rem;
    padding: 1.5rem;
}
.media-card--panel .media-card__title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
}

/* --- variante menu ------------------------------------------------------ */

.media-card--menu {
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    height: auto;
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    background-color: transparent;
    box-shadow: none;
    white-space: normal;
}
.media-card--menu:hover {
    transform: none;
    box-shadow: none;
    background-color: #f5f5f5;
}
.media-card--menu .media-card__media {
    width: 3rem;
    height: 3rem;
    border-radius: 0.4rem;
}
.media-card--menu .media-card__body {
    padding: 0;
    gap: 0.5rem;
}
.media-card--menu .media-card__title {
    font-size: 0.88rem;
    font-weight: 600;
}
.media-card--menu .media-card__arrow {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 0.8rem;
}
.media-card--menu.media-card--no-image .media-card__media {
    background-color: #f0f0f0;
}

/* --- tamaños ------------------------------------------------------------ */

.media-card--sm .media-card__title {
    font-size: 0.88rem;
}
.media-card--sm .media-card__body {
    padding: 0.75rem 0.85rem 0.9rem;
}
.media-card--sm .media-card__arrow {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.85rem;
}
.media-card--lg.media-card--stack .media-card__media {
    aspect-ratio: 16 / 9;
}
.media-card--lg .media-card__title {
    font-size: 1.15rem;
}
.media-card--lg.media-card--overlay .media-card__body,
.media-card--lg.media-card--panel .media-card__body {
    min-height: 18rem;
}

/* --- tema oscuro (panel sin imagen sobre fondo de color) ---------------- */

.media-card--dark,
.media-card--dark:hover {
    color: #fff;
}
.media-card--dark .media-card__desc {
    color: rgba(255, 255, 255, 0.85);
}
.media-card--dark .media-card__arrow {
    background-color: rgba(255, 255, 255, 0.9);
    color: #111;
}

@media (max-width: 575.98px) {
    .media-card--row .media-card__media {
        width: 34%;
    }
    .media-card--overlay .media-card__body {
        min-height: 11rem;
        padding: 1rem;
    }
}

/* --- component:product-tile --- */
/* product-tile — estilos base (también vía @import en site.css para la home) */
.product-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #fff;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.product-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}
.product-tile__media {
    position: relative;
    aspect-ratio: 5 / 4;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--bg-l-gray, #EEEEEE);
}
.product-tile__media picture {
    display: block;
    width: 100%;
    height: 100%;
}
.product-tile__img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}
.product-tile:hover .product-tile__img {
    transform: scale(1.04);
}
.product-tile__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 1rem 1.15rem 1.15rem;
    position: relative;
    z-index: 2;
}
.product-tile__body:last-of-type {
    padding-bottom: 1.2rem;
    flex: 1;
}
.product-tile__title {
    font-size: 0.98rem;
    line-height: 1.35;
    color: #111;
    flex: 1;
    min-width: 0;
}
.product-tile__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background-color: var(--bg-l-gray, #EEEEEE);
    color: #111;
    font-size: 1rem;
    flex-shrink: 0;
    margin-left: auto;
    transition: background-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}
.product-tile:hover .product-tile__arrow {
    background-color: #111;
    color: #fff;
    transform: translateX(3px);
}
.product-tile > .stretched-link::after {
    z-index: 3;
}
.product-tile__badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 4;
}
.product-tile__badge--start {
    left: 0.75rem;
    right: auto;
    background: transparent;
    padding: 0;
}
.product-tile__footer {
    padding: 0 1.15rem 1rem;
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.product-tile__footer p {
    margin-bottom: 0.4rem;
}
.product-tile__discount {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 4;
    display: inline-block;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    background-color: #16a34a;
    border-radius: 0.4rem;
}

/* --- component:ui-button --- */
/**
 * ui-button
 * Los colores (.btn-black, .btn-white, .btn-l-gray…) son tokens globales de
 * site.css. Aquí solo van los ajustes propios del componente.
 */
[data-component="ui-button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}
[data-component="ui-button"].col-12,
[data-component="ui-button"].w-100 {
    width: 100%;
}
[data-component="ui-button"] .bi {
    line-height: 1;
}
[data-component="ui-button"][disabled],
[data-component="ui-button"].disabled {
    opacity: 0.55;
    pointer-events: none;
}
/* El CTA que cubre una card no debe quedar por debajo del stretched-link */
[data-component="ui-button"].stretched-link {
    position: relative;
    z-index: 3;
}

/* --- block:category-alt-grid --- */
/**
 * category-alt-grid — grid + media-card row (block).
 */

.category-alt-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr);
}

/* Cards legacy (por si algún markup antiguo aún las usa) */
.category-alt-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 6.5rem;
    background-color: #fff;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.category-alt-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}
.category-alt-card__media {
    flex: 0 0 34%;
    max-width: 8.5rem;
    min-height: 6.5rem;
    overflow: hidden;
}
.category-alt-card__media picture {
    display: block;
    width: 100%;
    height: 100%;
}
.category-alt-card__img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}
.category-alt-card:hover .category-alt-card__img {
    transform: scale(1.04);
}
.category-alt-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.85rem 3rem 0.85rem 0.95rem;
    min-width: 0;
}
.category-alt-card__title {
    font-size: 0.92rem;
    line-height: 1.3;
}
.category-alt-card__desc {
    font-size: 0.78rem;
    line-height: 1.35;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: auto-phrase;
}
.category-alt-card__arrow {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
}
.category-alt-card:hover .product-tile__arrow {
    background-color: #111;
    color: #fff;
}

/* media-card row dentro del block */
.category-alt-grid .media-card--row {
    min-height: 6.5rem;
    position: relative;
}

.category-alt-grid .media-card--row .media-card__media {
    flex: 0 0 34%;
    width: auto;
    max-width: 8.5rem;
    min-height: 6.5rem;
    align-self: stretch;
    height: auto;
}

.category-alt-grid .media-card--row .media-card__body {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 3rem 0.85rem 0.95rem;
}

.category-alt-grid .media-card--row .media-card__text {
    gap: 0.35rem;
}

.category-alt-grid .media-card--row .media-card__title {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
}

.category-alt-grid .media-card--row .media-card__desc {
    font-size: 0.78rem;
    line-height: 1.35;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: auto-phrase;
}

.category-alt-grid .media-card--row .media-card__arrow {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
    align-self: auto;
}

.category-alt-grid .media-card--row:hover .media-card__arrow {
    background-color: #111;
    color: #fff;
}

@media (min-width: 992px) {
    .category-alt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }
}

@media (min-width: 1200px) {
    .category-alt-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }

    .category-alt-card__media,
    .category-alt-grid .media-card--row .media-card__media {
        max-width: 9rem;
    }
}

/* --- block:category-featured --- */
/**
 * category-featured — layout del block (media-card overlay + row).
 * El look base de las cards vive en media-card.css.
 */

.category-featured-block {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
}

.category-featured-block__grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 1fr;
    min-height: 0;
}

.category-featured-block > .media-card--overlay {
    position: relative;
    min-height: 22rem;
    height: 100%;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
    transform: none;
    cursor: pointer;
}

.category-featured-block > .media-card--overlay:hover {
    transform: none;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
    color: inherit;
}

.category-featured-block > .media-card--overlay:hover .media-card__img {
    transform: none;
}

.category-featured-block > .media-card--overlay .media-card__body {
    min-height: 100%;
    position: absolute;
    inset: 0;
    z-index: 2;
}

.category-featured-block > .media-card--overlay .media-card__title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.category-featured-block > .media-card--overlay .media-card__desc {
    font-size: 0.85rem;
    line-height: 1.35;
    max-width: none;
}

.category-featured-block > .media-card--overlay .media-card__cta {
    margin-top: 0.75rem;
}

.category-featured-block > .media-card--overlay .media-card__cta .btn {
    position: relative;
    z-index: 3;
}

.category-featured-block__grid .media-card--row {
    min-height: 8.75rem;
    height: 100%;
}

.category-featured-block__grid .media-card--row .media-card__media {
    flex: 0 0 42%;
    width: auto;
    max-width: none;
    align-self: stretch;
    height: auto;
    min-height: 100%;
}

.category-featured-block__grid .media-card--row .media-card__body {
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.05rem 1rem 0.65rem;
}

.category-featured-block__grid .media-card--row .media-card__title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
}

.category-featured-block__grid .media-card--row .media-card__arrow {
    align-self: flex-start;
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.82rem;
}

.category-featured-block__grid .media-card--row:hover .media-card__arrow {
    background-color: #111;
    color: #fff;
    transform: translateX(2px);
}

@media (min-width: 992px) {
    .category-featured-block {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0.85rem;
        min-height: 26rem;
    }

    .category-featured-block__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        height: 100%;
    }

    .category-featured-block > .media-card--overlay {
        min-height: 100%;
    }

    .category-featured-block__grid .media-card--row {
        min-height: 0;
    }

    .category-featured-block__grid .media-card--row .media-card__media {
        flex-basis: 44%;
    }
}

@media (min-width: 1200px) {
    .category-featured-block {
        gap: 1rem;
        min-height: 28rem;
    }

    .category-featured-block__grid .media-card--row .media-card__media {
        flex-basis: 45%;
    }

    .category-featured-block__grid .media-card--row .media-card__body {
        padding: 1.05rem 1.15rem 1.05rem 0.75rem;
    }

    .category-featured-block__grid .media-card--row .media-card__title {
        font-size: 0.92rem;
    }
}
