﻿/**
 * Estilos globales del plugin Cursos, Recursos y Tests (CRT).
 *
 * Utiliza variables CSS personalizadas para soportar la inyección dinámica de temas de color.
 * Proporciona el diseño responsivo para carruseles de WooCommerce y grillas de Recetas.
 *
 * @package CursosRecursosTests
 * @subpackage Assets/CSS
 */

/* ==========================================================================
   1. VARIABLES DE DISEÑO Y DEFAULTS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

.crt-root {
    --crt-primary: #1F2C52;
    --crt-header-bg: rgba(31, 44, 82, 0.82);
    --crt-header-bg2: rgba(31, 44, 82, 0);
    --crt-accent: #F1B64E;
    --crt-chip-bg: #e7ba61cc;

    --crt-btn: #232D4F;
    --crt-btn-disabled: #B8B2B2;
    --crt-counter-bg: #f8f2dc;
    --crt-counter-border: #f1dfaf;
    --crt-white: #ffffff;
    --crt-text-dark: #333333;
    --crt-text-muted: #555555;
    --crt-border-color: rgba(31, 44, 82, 0.10);
    --crt-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    --crt-shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.10);

    --crt-card-height: 370px;
    --crt-card-height-without-desc: 300px;
    --crt-card-img-height: 180px;
    --crt-card-title-height: 63px;

    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    color: var(--crt-text-dark);
    overflow-x: hidden;
}

/* Reset global de box-sizing para TODOS los hijos de .crt-root */
.crt-root *,
.crt-root *::before,
.crt-root *::after {
    box-sizing: border-box;
}

/* Forzar min-height para empujar el pie de página de WP si no hay contenido */
.crt-root {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   2. HERO, ENCABEZADO Y FILTROS UNIFICADOS FHC26 - CENTRALIZADOS
   Todos los estilos visuales estéticos para .crt-header, .crt-search-row,
   .crt-tags-group, .crt-filters-grid y sus hijos se gestionan directamente
   en el style.css del Child Theme.
   ========================================================================== */

/* ==========================================================================
   4. SECCIONES Y CONTENIDOS (WOOCOMMERCE)
   ========================================================================== */
.crt-root .crt-content {
    max-width: 1200px;
    width: 100%;
    margin: 44px auto 10px;
    padding: 0 20px;
    flex-grow: 1;
}

.crt-root .crt-section {
    margin: 0 0 38px;
}

.crt-root .crt-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 24px;
}

.crt-root .crt-section-title {
    font-family: "Lora", serif;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--crt-primary);
    margin: 0;
    padding-left: 4px;
}

.crt-root .crt-counter {
    font-size: 13px;
    font-weight: 700;
    color: var(--crt-primary);
    background: var(--crt-counter-bg);
    border: 1px solid var(--crt-counter-border);
    border-radius: 999px;
    padding: 7px 12px;
    white-space: nowrap;
    display: none;
}

/* ==========================================================================
   5. CARRUSEL NATIVO (SCROLL-SNAP CSS)
   ========================================================================== */
.crt-root .crt-carousel-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    padding-bottom: 50px;
}


.crt-root .crt-carousel {
    width: 100%;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-items: flex-start;
    transition: height 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.crt-root .crt-carousel::-webkit-scrollbar {
    display: none;
    /* Safari/Chrome */
}

.crt-root .crt-carousel-track {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    flex: 0 0 100%;
    scroll-snap-align: start;
    padding: 10px 2px 16px;
    width: 100%;
    height: max-content;
}

.crt-root .crt-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none !important;
    color: var(--crt-text-dark);
    display: flex;
    flex-direction: column;

    height: var(--crt-card-height);
    min-height: var(--crt-card-height);
    max-height: var(--crt-card-height);

    width: calc(25% - 15px);
    min-width: calc(25% - 15px);
    max-width: calc(25% - 15px);

    box-shadow: var(--crt-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid var(--crt-border-color);
    cursor: pointer;
}




/* Flechas de Navegación */
.crt-root .crt-arrow {
    position: absolute !important;
    top: 50%;
    transform: translateY(-50%) !important;
    flex-shrink: 0;
    bottom: -10px;
    top: auto;
}


.crt-root .crt-arrow-left {
    /*left: -24px !important;*/
    left: 50% !important;
    transform: translate(-50px, 0) !important;
}

.crt-root .crt-arrow-right {
    /*right: -24px !important;*/
    right: 50% !important;
    transform: translate(50px, 0) !important;
}


.crt-root .crt-card:hover:not(.crt-card--inert) {
    transform: translateY(-4px);
    box-shadow: var(--crt-shadow-hover);
    color: var(--crt-text-dark);
}

.crt-root .crt-card--inert {
    cursor: default;
    border: 1px solid var(--crt-border-color);
}

.crt-root .crt-card--no-desc {
    height: var(--crt-card-height-without-desc);
    min-height: var(--crt-card-height-without-desc);
    max-height: var(--crt-card-height-without-desc);
}

.crt-root .crt-card:focus-visible {
    outline: 3px solid var(--crt-accent);
    outline-offset: 4px;
}

.crt-root .crt-card-img {
    width: 100%;
    height: var(--crt-card-img-height) !important;
    min-height: var(--crt-card-img-height) !important;
    max-height: var(--crt-card-img-height) !important;
    object-fit: cover !important;
    background: #f4f4f4;
    border-bottom: 1px solid var(--crt-border-color);
    display: block;
    flex: 0 0 var(--crt-card-img-height);
}

.crt-root .crt-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}

.crt-root .crt-card-type {
    display: inline-block;
    align-self: flex-start;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--crt-text-dark);
    margin-bottom: 8px;
    line-height: 1;
}

.crt-root .crt-card-title {
    font-family: "Lora", serif;
    font-size: 16px;
    font-weight: 700;
    color: #1F2C52;
    margin: 0 0 10px;
    line-height: 1.25;
    height: var(--crt-card-title-height);
    min-height: var(--crt-card-title-height);
    max-height: var(--crt-card-title-height);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.crt-root .crt-card-details {
    font-size: 14px;
    color: var(--crt-text-muted);
    margin: auto 0 0;
    line-height: 1.4;
    height: auto;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ==========================================================================
   6. MAQUETACIÓN DE RECETAS (GRILLA Y PAGINACIÓN)
   ========================================================================== */
.crt-root .crt-more-filters-toggle {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 999px;
    background: #f1b64e !important;
    color: #1f2c52 !important;
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    padding: 0 22px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
}

.crt-root .crt-clear-filters {
    width: 100%;
    min-height: 54px;
    border: 2px solid rgba(255, 255, 255, 0.74);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94) !important;
    color: #1f2c52 !important;
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    padding: 0 22px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.crt-root .crt-more-filters-toggle:hover,
.crt-root .crt-more-filters-toggle:focus-visible,
.crt-root .crt-clear-filters:hover,
.crt-root .crt-clear-filters:focus-visible {
    filter: brightness(0.98);
    outline: 3px solid rgba(255, 255, 255, 0.55);
    outline-offset: 3px;
}

.crt-root .crt-more-filters-panel {
    width: min(1740px, calc(100% - 64px));
    margin: 18px auto 0;
}

.crt-root .crt-more-filters-panel[hidden] {
    display: none !important;
}

.crt-root .crt-filters-grid--advanced {
    margin-top: 0 !important;
}

.crt-root .crt-filter-checks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 16px auto 0;
}

.crt-root .crt-filter-checks label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #1f2c52;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    cursor: pointer;
    user-select: none;
}

.crt-root .crt-filter-checks label.crt-filter-disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.crt-root .crt-filter-checks label.crt-filter-disabled input {
    cursor: not-allowed;
}

.crt-root .crt-filter-checks input {
    width: 16px;
    height: 16px;
    accent-color: #f1b64e;
}

.crt-root .crt-grid-container {
    width: 100%;
}

.crt-root .crt-grid-paginated {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    align-items: stretch;
    width: 100%;
}

/* Tarjeta específica de Recetas */
.crt-root .crt-card--receta {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--crt-border-color);
    text-decoration: none !important;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 455px;
    min-height: 455px;
    max-height: 455px;
    width: 100%;
    max-width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.crt-root .crt-card--receta:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    color: inherit;
}

.crt-root .crt-card--receta img {
    width: 100%;
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    object-fit: cover;
    background: #f4f4f4;
    display: block;
    border-bottom: 1px solid var(--crt-border-color);
}

.crt-root .crt-card--receta .crt-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}

.crt-root .crt-card--receta .crt-card-title {
    font-family: "Lora", serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
    color: #111;
    line-height: 1.22;
    height: 65px;
    min-height: 65px;
    max-height: 65px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.crt-root .crt-card--receta p {
    font-size: 15px;
    color: var(--crt-text-muted);
    margin: 0 0 7px;
    line-height: 1.35;
}

.crt-root .crt-card--receta .crt-card-meta {
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.crt-root .crt-card--receta .crt-card-warning {
    min-height: 34px;
    max-height: 50px;
    border-radius: 10px;
    background: #fff5e0;
    color: #7a4b00;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 10px;
    overflow: hidden;
    padding: 7px 9px;
}

.crt-root .crt-ingredients-list {
    flex-wrap: wrap;
    gap: 8px;
    max-height: 60px;
    padding: 0;
    margin-top: auto;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    align-content: flex-start;
    justify-content: flex-start;
}

.crt-root .crt-ingredients-list::-webkit-scrollbar {
    width: 6px;
}

.crt-root .crt-ingredients-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.crt-root .crt-ingredients-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.crt-root .crt-chip {
    font-family: "Montserrat", sans-serif;
    background: var(--crt-chip-bg);
    color: #222;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 400;
    display: flex;
    line-height: 1.15;
    height: 25px;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
}

/* Paginación Recetas */
.crt-root .crt-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 42px;
    flex-wrap: wrap;
}

/* 
.crt-root .crt-page-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    background-color: var(--crt-btn) !important;
    color: #fff !important;
    padding: 0 !important;
    box-shadow: none !important;
    flex-shrink: 0;
}

.crt-root .crt-page-btn:hover:not(:disabled) {
    opacity: 0.8;
}

.crt-root .crt-page-btn:disabled {
    opacity: 0.5;
    cursor: default;
    background-color: var(--crt-btn-disabled) !important;
} */

.crt-root .crt-page-info {
    color: #666;
    font-size: 14px;
    font-weight: 600;
    min-width: 96px;
    text-align: center;
}

/* Botón Volver */
.crt-root .crt-back-container {
    text-align: center;
    margin-top: 42px;
    margin-bottom: 42px;
}

/* .crt-root .crt-btn-back {
    display: inline-block;
    text-decoration: none !important;
} */

/* ==========================================================================
   7. SKELETONS Y ESTADOS VACÍOS / ERROR
   ========================================================================== */
.crt-root .crt-empty,
.crt-root .crt-empty-state-global {
    text-align: center;
    color: #666;
    background: #f7f8fb;
    border: 1px solid #e2e6ef;
    border-radius: 16px;
    padding: 28px 20px;
    margin: 30px 0 10px;
    font-size: 16px;
    width: 100%;
}

.crt-root .crt-loading {
    text-align: center;
    color: #666;
    background: #f7f8fb;
    border: 1px solid #e2e6ef;
    border-radius: 16px;
    padding: 28px 20px;
    margin: 30px 0 10px;
    font-size: 16px;
}

.crt-root .crt-spinner {
    margin: 0 auto 10px;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--crt-primary);
    border-radius: 50%;
    animation: crtSpin 1s linear infinite;
}

.crt-root .crt-card-skeleton {
    height: 455px;
    background: #f0f0f0;
    border-radius: 14px;
    animation: crtPulse 1.5s infinite;
}

@keyframes crtSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes crtPulse {
    0% {
        background-color: #f0f0f0;
    }

    50% {
        background-color: #e0e0e0;
    }

    100% {
        background-color: #f0f0f0;
    }
}

/* ==========================================================================
   8. MEDIA QUERIES PARA ADAPTACIÓN RESPONSIVE
   ========================================================================== */

/* --- TABLET LANDSCAPE (≤ 992px) --- */
@media (max-width: 992px) {
    .crt-root {
        --crt-card-height: 375px;
        --crt-card-img-height: 175px;
    }

    .crt-root .crt-carousel-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: var(--crt-card-height);
    }
}

/* --- TABLET PORTRAIT / MOBILE (≤ 900px) — Cambio a carrusel horizontal de 1 card --- */
@media (max-width: 900px) {
    .crt-root {
        --crt-card-height: 365px;
        --crt-card-img-height: 175px;
        --crt-card-title-height: 62px;
    }



    .crt-root .crt-content {
        margin: 32px auto 8px !important;
        padding: 0 12px !important;
        max-width: 100% !important;
    }

    .crt-root .crt-section {
        margin-bottom: 34px !important;
    }

    .crt-root .crt-section-header {
        align-items: flex-start;
        margin-bottom: 16px !important;
    }

    .crt-root .crt-section-title {
        font-size: 25px !important;
    }

    .crt-root .crt-counter {
        font-size: 12px;
        padding: 6px 10px;
    }

    /* Carrusel: desactivar grid CSS, cambiar a flex horizontal con scroll-snap */
    .crt-root .crt-carousel-wrap {
        width: 100% !important;
        overflow: visible !important;
        padding: 0 0 50px !important;
    }

    .crt-root .crt-carousel {
        display: block !important;
        width: 100% !important;
        overflow: visible !important;
        scroll-snap-type: none !important;
    }

    .crt-root .crt-carousel-track {
        display: flex !important;
        flex-wrap: nowrap !important;
        grid-template-columns: none !important;
        grid-template-rows: none !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-behavior: smooth !important;
        scroll-snap-type: x mandatory !important;
        scrollbar-width: none !important;
        gap: 14px !important;
        width: 100% !important;
        padding: 8px 42px 18px 42px !important;
        min-height: calc(var(--crt-card-height) + 26px) !important;
        align-items: stretch !important;
    }

    .crt-root .crt-carousel-track::-webkit-scrollbar {
        display: none !important;
    }

    .crt-root .crt-card {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        height: var(--crt-card-height) !important;
        min-height: var(--crt-card-height) !important;
        max-height: var(--crt-card-height) !important;
        scroll-snap-align: center !important;
        border-radius: 16px !important;
    }

    .crt-root .crt-card-img {
        height: var(--crt-card-img-height) !important;
        min-height: var(--crt-card-img-height) !important;
        max-height: var(--crt-card-img-height) !important;
        object-fit: cover !important;
    }

    .crt-root .crt-card-body {
        padding: 16px !important;
    }

    .crt-root .crt-card-title {
        font-size: 16px !important;
        line-height: 1.3 !important;
    }

    .crt-root .crt-card-details {
        font-size: 13.5px !important;
    }

    .crt-root .crt-arrow {
        font-size: 24px !important;
        /*top: 50% !important;
        transform: translateY(-50%) !important;*/
        z-index: 50 !important;
    }

    /*.crt-root .crt-arrow-left {
        left: 2px !important;
    }

    .crt-root .crt-arrow-right {
        right: 2px !important;
    }*/


    /* Grilla de Recetas: reducir columna mínima */
    .crt-root .crt-grid-paginated {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }

    /* Tarjeta de Receta: reducir altura fija */
    .crt-root .crt-card--receta {
        height: 420px;
        min-height: 420px;
        max-height: 420px;
    }

    .crt-root .crt-card--receta img {
        height: 175px;
        min-height: 175px;
        max-height: 175px;
    }

    .crt-root .crt-card--receta .crt-card-body {
        padding: 18px;
    }

    .crt-root .crt-card--receta .crt-card-title {
        font-size: 20px;
        height: 72px;
        min-height: 72px;
        max-height: 72px;
    }
}

/* --- MOBILE SMALL (≤ 560px) --- */
@media (max-width: 560px) {
    .crt-root {
        --crt-card-height: 355px;
        --crt-card-img-height: 165px;
        --crt-card-title-height: 60px;
    }

    .crt-root .crt-header-inner,
    .crt-root .fhc26-header__inner {
        padding-top: 18px !important;
    }



    .crt-root .crt-carousel-track {
        padding-left: 34px !important;
        padding-right: 34px !important;
        gap: 12px !important;
    }

    /*.crt-root .crt-arrow-left {
        left: 0 !important;
    }

    .crt-root .crt-arrow-right {
        right: 0 !important;
    }*/

    .crt-root .crt-page-info {
        display: none;
    }



    /* Grilla de Recetas: permitir 1 columna completa */
    .crt-root .crt-grid-paginated {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Tarjeta de Receta: reducir más para pantalla pequeña */
    .crt-root .crt-card--receta {
        height: auto;
        min-height: auto;
        max-height: none;
    }

    .crt-root .crt-card--receta img {
        height: 160px;
        min-height: 160px;
        max-height: 160px;
    }

    .crt-root .crt-card--receta .crt-card-body {
        padding: 16px;
        justify-content: center;
    }

    .crt-root .crt-card--receta .crt-card-title {
        font-size: 16px !important;
        height: auto;
        min-height: auto;
        max-height: none;
    }
    
    .crt-root .crt-card--receta p {
        font-size: 14px !important;
    }
    

    .crt-root .crt-ingredients-list {
        height: auto;
        max-height: none;
    }

    .crt-root .crt-more-filters-panel {
        width: 100% !important;
        margin-top: 12px;
    }

    .crt-root .crt-filter-checks {
        width: calc(100% - 28px);
        justify-content: flex-start;
    }

    .crt-root .crt-filter-checks label {
        flex: 1 1 calc(50% - 10px);
        justify-content: center;
        text-align: center;
    }
}

/* --- MOBILE VERY SMALL (≤ 400px) --- */
@media (max-width: 400px) {
    .crt-root {
        --crt-card-height: 340px;
        --crt-card-receta-height: 360px;
        --crt-card-img-height: 155px;
        --crt-card-title-height: 56px;
    }

    .crt-root .crt-content {
        padding: 0 8px !important;
    }

    .crt-root .crt-section-title {
        font-size: 22px !important;
    }

    .crt-root .crt-carousel-track {
        padding-left: 28px !important;
        padding-right: 28px !important;
        gap: 10px !important;
    }
    
    .crt-root .crt-card.crt-card--receta {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }
}

/* ==========================================================================
   9. PREFERENCIAS DE ACCESIBILIDAD
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {

    .crt-root .crt-carousel,
    .crt-root .crt-carousel-track {
        scroll-behavior: auto !important;
    }

    .crt-root .crt-card,
    .crt-root .crt-tag,
    .crt-root .crt-arrow,
    .crt-root .crt-btn-back,
    .crt-root .crt-page-btn {
        transition: none !important;
    }

    .crt-root .crt-card-skeleton {
        animation: none !important;
    }
}

/* Ajuste de tarjetas de recetas: los avisos largos no deben recortarse. */
.crt-root .crt-card.crt-card--receta {
    height: auto !important;
    min-height: 455px !important;
    max-height: none !important;
}

.crt-root .crt-card--receta .crt-card-body {
    min-height: 255px;
}

.crt-root .crt-card--receta .crt-card-warning {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal;
    overflow-wrap: anywhere;
}

.crt-root .crt-card--receta .crt-ingredients-list {
    margin-top: 8px;
}

@media (max-width: 560px) {
    .crt-root .crt-card.crt-card--receta {
        min-height: 0 !important;
    }

    .crt-root .crt-card--receta .crt-card-body {
        min-height: 0;
    }
}

/* ==========================================================================
   RECETAS: contenido (grilla / cards).
   Hero, buscador y filtros FHC26 viven en el child theme.
   ========================================================================== */

.crt-root .crt-content {
    width: min(1120px, calc(100% - 56px));
    margin: 0 auto;
    padding-top: 44px;
}

.crt-root .crt-grid-paginated {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 34px;
    justify-items: center;
}

.crt-root .crt-card--receta {
    width: 100%;
    max-width: 260px;
    border-radius: 12px;
}

.crt-root .crt-card--receta img {
    height: 155px;
    min-height: 155px;
    max-height: 155px;
}

.crt-root .crt-card--receta .crt-card-body {
    padding: 18px 16px;
}

.crt-root .crt-card--receta .crt-card-title {
    font-size: 15px;
    margin-bottom: 12px;
}

.crt-root .crt-card--receta p {
    font-size: 14px;
    margin-bottom: 6px;
}

.crt-root .crt-chip {
    height: 23px;
    padding: 5px 9px;
    font-size: 11px;
}

.crt-root .crt-ingredients-list {
    max-height: 56px;
    gap: 7px;
}

/* Desktop: grilla fija de cards */
@media (min-width: 901px) {
    .crt-root .crt-content {
        width: min(1060px, calc(100% - 96px)) !important;
        margin: 0 auto !important;
        padding-top: 44px !important;
    }

    .crt-root .crt-grid-paginated {
        display: grid !important;
        grid-template-columns: repeat(4, 220px) !important;
        justify-content: center !important;
        justify-items: stretch !important;
        gap: 34px 48px !important;
        align-items: start !important;
    }

    .crt-root .crt-card--receta {
        width: 220px !important;
        max-width: 220px !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        border-radius: 9px !important;
        box-shadow: 0 2px 7px rgba(22, 28, 45, .12) !important;
        align-self: start !important;
    }

    .crt-root .crt-card--receta img {
        height: 143px !important;
        min-height: 143px !important;
        max-height: 143px !important;
    }

    .crt-root .crt-card--receta .crt-card-body {
        padding: 17px 12px 14px !important;
        flex-grow: 0 !important;
    }

    .crt-root .crt-card--receta .crt-card-kicker {
        font-size: 10px !important;
        margin: 0 0 9px !important;
    }

    .crt-root .crt-card--receta .crt-card-title {
        height: auto !important;
        min-height: 42px !important;
        max-height: none !important;
        font-size: 17px !important;
        line-height: 1.18 !important;
        margin: 0 0 12px !important;
    }

    .crt-root .crt-card--receta p {
        font-size: 15px !important;
        line-height: 1.32 !important;
        margin: 0 0 5px !important;
    }

    .crt-root .crt-ingredients-list {
        margin-top: 9px !important;
        max-height: 52px !important;
        gap: 6px !important;
        overflow: hidden !important;
    }

    .crt-root .crt-chip {
        height: 21px !important;
        padding: 3px 10px !important;
        font-size: 12px !important;
        border-radius: 5px !important;
    }
}

@media (min-width: 901px) and (max-width: 1280px) {
    .crt-root .crt-grid-paginated {
        grid-template-columns: repeat(3, 220px) !important;
    }
}

/* Mobile: cards horizontales */
@media (max-width: 760px) {
    .crt-root .crt-content {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 28px 20px 0 !important;
        box-sizing: border-box !important;
    }

    .crt-root .crt-grid-container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .crt-root .crt-grid-paginated {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 18px !important;
        justify-items: stretch !important;
    }

    .crt-root .crt-card--receta {
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        display: grid !important;
        grid-template-columns: 146px minmax(0, 1fr) !important;
        align-items: stretch !important;
        border-radius: 13px !important;
        overflow: hidden !important;
        box-shadow: none !important;
        border: 0 !important;
        background: transparent !important;
    }

    .crt-root .crt-card--receta img {
        width: 146px !important;
        height: 146px !important;
        min-width: 146px !important;
        min-height: 146px !important;
        max-height: 146px !important;
        object-fit: cover !important;
        border: 3px solid #e6bf58 !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
    }

    .crt-root .crt-card--receta .crt-card-body {
        padding: 5px 0 4px 16px !important;
        min-height: 0 !important;
        background: transparent !important;
    }

    .crt-root .crt-card--receta .crt-card-kicker,
    .crt-root .crt-card--receta .crt-card-type {
        display: none !important;
    }

    .crt-root .crt-card--receta .crt-card-title {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        font-size: 19px !important;
        line-height: 1.2 !important;
        margin: 0 0 5px !important;
    }

    .crt-root .crt-card--receta p,
    .crt-root .crt-card--receta .crt-card-meta {
        font-size: 14px !important;
        line-height: 1.25 !important;
        margin: 0 0 3px !important;
    }

    .crt-root .crt-card--receta .crt-card-warning {
        display: none !important;
    }

    .crt-root .crt-ingredients-list {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        max-height: 54px !important;
        overflow: hidden !important;
        margin-top: 8px !important;
    }

    .crt-root .crt-chip {
        height: 20px !important;
        line-height: 20px !important;
        padding: 0 9px !important;
        font-size: 11px !important;
        border-radius: 5px !important;
    }

    .crt-root .crt-card-skeleton {
        height: 146px !important;
        min-height: 146px !important;
        border-radius: 13px !important;
    }
}

/* Ajuste cards familia REST API */
.crt-root.crt-familia-rest_api .crt-grid-paginated {
    align-items: start !important;
}

.crt-root.crt-familia-rest_api .crt-card--receta {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: start !important;
}

.crt-root.crt-familia-rest_api .crt-card--receta img {
    height: 178px !important;
    min-height: 178px !important;
    max-height: 178px !important;
}

.crt-root.crt-familia-rest_api .crt-card--receta .crt-card-body {
    padding: 18px 20px 20px !important;
    flex-grow: 0 !important;
}

.crt-root.crt-familia-rest_api .crt-card--receta .crt-card-title {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin-bottom: 18px !important;
}

.crt-root.crt-familia-rest_api .crt-card--receta .crt-card-meta {
    min-height: 0 !important;
    margin-bottom: 18px !important;
}

.crt-root.crt-familia-rest_api .crt-card--receta .crt-card-tags {
    margin-top: 0 !important;
}

.crt-root .crt-results-count.fhc26-header__results-count {
    display: none !important;
}

@media (max-width: 900px) {
    .crt-root.crt-familia-rest_api .crt-card--receta {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    .crt-root.crt-familia-rest_api .crt-card--receta img {
        height: 146px !important;
        min-height: 146px !important;
        max-height: 146px !important;
    }
}

/* Mobile CRT: ocultar subtítulo y contador del hero (Vouchers no usa .crt-root) */
@media (max-width: 900px) {
    .crt-root .crt-header-description,
    .crt-root .fhc26-header__desc {
        display: none !important;
    }
}

/* desk1 recetas card tags safe 20260823 */
.crt-root.crt-familia-rest_api .crt-card--receta .crt-card-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 8px !important;
    max-width: 100% !important;
    overflow: hidden !important;
}
.crt-root.crt-familia-rest_api .crt-card--receta .crt-card-tags > *,
.crt-root.crt-familia-rest_api .crt-card--receta .crt-tag,
.crt-root.crt-familia-rest_api .crt-card--receta [class*="tag"] {
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-height: 1.15 !important;
}
