/*
 * Recetas (sections/recetas/views/): home, categorías, búsqueda y detalle. Reproduce el re-skin de Landing-receta
 * (styles/redesign.css y lo que dejaban home.css y recipeDetail.css), medido en el navegador, pasado a mobile
 * first con los breakpoints y los tokens de tokens.css.
 *
 * Para Safari 14.0: sin gap en flexbox (las filas usan grid o márgenes), sin aspect-ratio (las imágenes
 * recortadas usan una caja con padding-top) y sin inset.
 */

/*
 * Poppins 400 y 600 de Google Fonts (v24), autohospedada (regla 5 de rule-frontend): el detalle de producción la
 * usa en las cifras de los macros, en «Ingredientes» y en el modal de acceso. Licencia: fonts/OFL-poppins.txt.
 */
@font-face {
    font-family: Poppins;
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../../fonts/poppins-400-latin-ext.woff2') format('woff2');
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
        U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: Poppins;
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../../fonts/poppins-400-latin.woff2') format('woff2');
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
        U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: Poppins;
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../../fonts/poppins-600-latin-ext.woff2') format('woff2');
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
        U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: Poppins;
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../../fonts/poppins-600-latin.woff2') format('woff2');
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
        U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.recipes,
.recipe-page {
    /* Medidas propias de la sección que no están en tokens.css */
    --recipes-width: 1120px;
    --recipes-radius: 16px;

    padding: 24px max(20px, calc((100% - var(--recipes-width)) / 2)) 64px;
    font-family: var(--font-family-recipes);

    /* El original fijaba -0.32px en toda la página (el -0.02em de su body de 16px, heredado como px) */
    letter-spacing: -0.32px;
    background-color: var(--bg-recipes);
    background-image: radial-gradient(var(--bg-recipes-dots) 1.1px, transparent 1.1px);
    background-size: 22px 22px;
}

/* ── Buscador ── */
.recipe-search {
    margin: 24px 0;
}

.recipe-search__field {
    display: grid;
    grid-template-columns: 20px 1fr;
    column-gap: 12px;
    align-items: center;
    padding: 14px 22px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-rail);
}

.recipe-search__field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-focus);
}

.recipe-search__field .icon {
    color: var(--fg-muted);
}

.recipe-search__input {
    min-width: 0;
    padding: 0;
    font: inherit;
    font-size: 15px;
    color: var(--fg);
    letter-spacing: var(--letter-spacing);
    background: transparent;
    border: 0;
    outline: none;
    appearance: none;
}

.recipe-search__input::placeholder {
    color: var(--fg-muted);
}

/* ── Home y listados ── */

/* flow-root: los márgenes del título y del buscador quedan adentro, como en producción, donde el bloque es un
   elemento flex y no los colapsa con los suyos */
.recipes-hero {
    display: flow-root;
    max-width: 720px;
    margin: 24px auto 8px;
}

.recipes-hero__title {
    margin: 8px 0 0;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    text-align: center;
}

/* Como en producción: 28 px con el margen que el navegador le da a un H1 (0.67em) y texto negro */
.recipes__title {
    margin: 0.67em 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 20px;
    color: var(--fg-recipe);
}

/* En producción el contenedor es flex y el margen del buscador (24 px) se suma al del H1 en lugar de colapsarse */
.recipe-search + .recipes__title {
    margin-top: calc(24px + 0.67em);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 0;
    margin: 0 0 30px;
    list-style: none;
}

.recipe-card {
    min-width: 0;
}

.recipe-card__link {
    position: relative;
    display: block;
    height: 100%;
    overflow: hidden;
    color: var(--fg);
    text-decoration: none;
    background: var(--bg);
    border: 1px solid var(--line-card);
    border-radius: var(--recipes-radius);
    box-shadow: var(--shadow-card);
    transition:
        box-shadow 180ms var(--ease),
        transform 180ms var(--ease);
}

.recipe-card__link:hover {
    box-shadow: var(--shadow-rail);
    transform: translateY(-2px);
}

.recipe-card__save {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    padding: 7px;
    color: var(--on-primary);
    background: var(--primary);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-primary);
}

/* Caja 1 / 0.82 con padding-top: Safari 14.0 no tiene aspect-ratio */
.recipe-card__media {
    position: relative;
    display: block;
    padding-top: 82%;
    background: var(--bg-subtle);
}

.recipe-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-card__title {
    display: block;
    padding: 12px 14px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.recipe-card__title strong {
    font-weight: 900;
}

.recipes-more {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

/* En producción el contenedor es flex y los márgenes no se juntan: los 30 px de la rejilla más estos 40 */
.recipe-grid + .recipes-more {
    margin-top: 70px;
}

/* ── Botones ── */
.recipe-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 500;
    color: var(--fg-button-soft);
    text-align: center;
    text-decoration: none;
    letter-spacing: var(--letter-spacing);
    cursor: pointer;
    background: var(--bg-button-soft);
    border: 0;
    border-radius: var(--radius-control);
}

.recipe-button .icon,
.recipe-button__logo {
    flex: 0 0 16px;
    margin-right: 8px;
}

/* Hasta 500 px las etiquetas de los botones suaves van en 12 px, como los <span> del original (banner.css) */
.recipe-button--soft {
    font-size: 12px;

    /* El -0.02em de producción calculado sobre 14 px, también en los botones de 12 px */
    letter-spacing: -0.28px;
}

.recipe-button--primary {
    padding: 10px 32px;
    color: var(--on-primary);
    background: var(--primary);
}

.recipe-button--primary:hover {
    background: var(--primary-hover);
}

.recipe-button--chatgpt .icon {
    color: var(--brand-chatgpt);
}

.recipe-button--claude .icon {
    color: var(--brand-claude);
}

.recipe-button--large {
    width: 100%;
    min-height: 52px;
    padding: 0 32px;
    margin-top: 16px;

    /* Figtree aunque esté dentro del modal (Poppins), con el renglón de 20 px de producción */
    font-family: var(--font-family-landing);
    font-size: 15px;
    line-height: 20px;
    font-weight: 700;
    color: var(--on-primary);
    background: var(--primary);
    border-radius: var(--radius-pill);
    transition: background 160ms var(--ease);
}

.recipe-button--large:hover {
    background: var(--primary-hover);
}

.recipe-button--block {
    display: flex;
}

/* ── Detalle ── */

/* Plan semanal y menú de la sesión, a la derecha del nav (como el header del original) */
.recipe-session {
    display: grid;
    grid-auto-flow: column;
    column-gap: 12px;
    align-items: center;
    margin-right: 8px;
}

.recipe-session__plan {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--fg-session);
    cursor: pointer;
    background: var(--bg-plan-head);
    border: 0;
    border-radius: 50%;
}

.recipe-session__profile {
    position: relative;
}

.recipe-session__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-family: var(--font-family-poppins);
    font-size: 16px;
    font-weight: 600;
    line-height: 20px;
    color: var(--on-primary);
    text-transform: uppercase;
    list-style: none;
    cursor: pointer;
    background: var(--fg-session);
    border-radius: 50%;
}

.recipe-session__avatar::-webkit-details-marker {
    display: none;
}

.recipe-session__menu {
    position: absolute;
    top: 48px;
    right: 0;
    z-index: 3;
    display: grid;
    row-gap: 10px;

    /* 210 px de contenido más el relleno y el borde, como el menú de producción */
    min-width: 240px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border-plan);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-menu);
}

.recipe-session__email {
    overflow: hidden;
    font-family: var(--font-family-poppins);
    font-size: 13px;
    line-height: normal;
    color: var(--fg-recipe-modal);
    text-overflow: ellipsis;
}

.recipe-session__logout {
    margin: 0;
}

.recipe-session__logout-button {
    width: 100%;
    padding: 8px 12px;
    font-family: var(--font-family-poppins);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: -0.28px;
    color: var(--fg-button-soft);
    cursor: pointer;
    background: var(--bg-chip);
    border: 0;
    border-radius: var(--radius-control);
}

.recipe-page > .recipe-search {
    margin: 0 0 24px;
}

.recipe-crumbs {
    margin: -8px 0 16px;
    font-size: 13px;
    color: var(--fg-muted);
}

.recipe-crumbs__list {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    list-style: none;
}

.recipe-crumbs__item + .recipe-crumbs__item::before {
    margin: 0 6px;
    content: '›';
}

.recipe-crumbs__link {
    color: inherit;
    text-decoration: none;
}

.recipe-crumbs__link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Base del detalle como en producción: 14/20 px y texto negro, que heredan los textos sin estilo propio */
.recipe {
    font-size: 14px;
    line-height: 20px;
    color: var(--fg-recipe);
}

.recipe__hero {
    display: grid;
    row-gap: 28px;
    margin-bottom: 28px;
}

.recipe__media {
    margin: 0;
}

/* En línea, como en producción: la figura suma el espacio bajo la línea base del renglón (6 px) */
.recipe__image {
    display: inline;
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 20px;
}

.recipe__info {
    min-width: 0;
}

.recipe__title {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    line-height: normal;
}

.recipe__author {
    margin: 0 0 15px;
}

.recipe__author-link {
    color: var(--fg-recipe-link);
    text-decoration: underline;
}

.recipe__actions {
    display: flex;
    flex-wrap: wrap;
    padding: 0 8px;
    margin: 0 0 -8px;
}

/* Sin gap en flexbox (Safari 14.0): cada botón deja su espacio a la derecha y abajo */
.recipe__actions > * {
    margin: 0 8px 8px 0;
}

.recipe-macros {
    padding: 20px;
    margin-top: 16px;
    background: var(--bg);
    border: 1px solid var(--line-card);
    border-radius: var(--recipes-radius);
    box-shadow: var(--shadow-card);
}

.recipe-macros__title {
    margin: 0 0 12px;
    font-size: 21px;
    font-weight: 700;
    line-height: 20px;
}

.recipe-macros__list {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px 0 0;
}

.recipe-macros__item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    margin: 0 8px 0 0;
    font-size: 12px;
    line-height: 24px;
    color: var(--fg-button-soft);
    background: var(--bg-chip);
    border-radius: var(--radius-pill);
}

.recipe-macros__label {
    margin-right: 4px;
    font-family: var(--font-family-poppins);
}

.recipe-macros__value {
    margin: 0;

    /* En el teléfono producción usa la sans-serif del sistema con interlineado de 1.5; desde 480 px, Poppins */
    font-family: var(--font-family-generic);
    font-weight: 600;
    line-height: 18px;
}

.supplements-banner {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    margin: 0 0 20px;
    color: var(--on-primary);
    text-decoration: none;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-deep) 100%);
    border-radius: var(--recipes-radius);
    box-shadow: var(--shadow-card);
    transition:
        box-shadow 180ms var(--ease),
        transform 180ms var(--ease);
}

.supplements-banner:hover {
    box-shadow: var(--shadow-rail);
    transform: translateY(-1px);
}

.supplements-banner__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--on-primary-soft);
    border-radius: var(--radius-pill);
}

.supplements-banner__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.supplements-banner__title {
    font-size: 14px;
    font-weight: 800;

    /* El -0.02em del banner de producción, calculado sobre su base: 12 px en el teléfono y 14 px desde 480 px */
    letter-spacing: -0.24px;
}

.supplements-banner__subtitle {
    font-size: 12px;
    font-weight: 500;
    color: var(--on-primary-muted-recipe);

    /* El -0.02em del banner de producción, calculado sobre su base: 12 px en el teléfono y 14 px desde 480 px */
    letter-spacing: -0.24px;
}

.supplements-banner__cta {
    grid-column: 1 / -1;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    white-space: nowrap;
    background: var(--bg);
    border-radius: var(--radius-pill);
}

.recipe-section {
    padding: 24px;
    margin-bottom: 20px;
    background: var(--bg);
    border: 1px solid var(--line-card);
    border-radius: var(--recipes-radius);
    box-shadow: var(--shadow-card);
}

/* Ingredientes y preguntas frecuentes no llevan línea abajo en producción */
.recipe-section--open {
    border-bottom: 0;
}

/* Con el margen inferior que el navegador le da a un H2 (0.83em), como en producción */
.recipe-section__title {
    margin: 0 0 0.83em;
    font-size: 21px;
    font-weight: 700;
    line-height: 20px;
}

/* En producción solo «Ingredientes» usa Poppins (de su CSS anterior) */
.recipe-section__title--ingredients {
    font-family: var(--font-family-poppins);
    font-size: 20px;
    font-weight: 600;
    line-height: 24px;
    color: var(--fg-button-soft);
}

.recipe-section__lead {
    margin: 14px 0;
}

.recipe-ingredients {
    padding: 0;
    margin: 0;
    list-style: none;
}

/*
 * [porción] [imagen] [nombre / unidad] [Detalles] [Comprar], como el re-skin del original. En el teléfono los
 * botones bajan a otra fila: en una sola fila el original se salía de la pantalla (397 px en 375).
 */
.recipe-ingredient {
    display: grid;
    grid-template-areas:
        'input image name name'
        'input image unit unit'
        'input image view shop';
    grid-template-columns: 56px 34px auto 1fr;
    gap: 4px 10px;
    place-items: center start;
    margin-bottom: 12px;
}

.recipe-ingredient--plain {
    grid-template-areas: 'input image name shop';
    margin-bottom: 8px;
}

.recipe-ingredient__input {
    grid-area: input;
    width: 56px;
    padding: 8px;
    font: inherit;
    font-size: 13px;
    text-align: center;
    background: var(--bg);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-control);
}

.recipe-ingredient__image {
    grid-area: image;
    align-self: start;
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: var(--radius-control);
}

.recipe-ingredient__name {
    grid-area: name;
    align-self: end;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    font-size: 12px;
}

.recipe-ingredient--plain .recipe-ingredient__name {
    align-self: center;
    font-size: 12px;
}

.recipe-ingredient__unit {
    grid-area: unit;
    align-self: start;
    font-size: 11.6667px;
}

.recipe-ingredient__link {
    grid-area: view;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--fg-muted);
    text-decoration: none;
    white-space: nowrap;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
}

.recipe-ingredient__link--buy {
    grid-area: shop;
}

.recipe-ingredient__link:hover {
    color: var(--fg);
    background: var(--bg-canvas);
}

.recipe-steps {
    padding-left: 24px;
    margin: 14px 0;
}

.recipe-steps__item {
    margin-bottom: 8px;
}

.recipe-nutrition {
    width: 100%;
    border-spacing: 2px;
}

/* Como la tabla de producción (recipeDetail.css): cada renglón es un flex de 33 px con el nombre a la izquierda y
   el valor a la derecha, separados por márgenes que se colapsan (14 px) y una línea abajo */
.recipe-nutrition__row {
    display: flex;
    box-sizing: content-box;
    justify-content: space-between;
    height: 33px;
    margin: 14px 0 8px;
    border-bottom: 1px solid var(--border-recipe-table);
}

.recipe-nutrition__row--head {
    padding-top: 16px;
    margin-bottom: 0;
    border-top: 5px solid var(--fg-button-soft);
}

/* El encabezado va en <thead> y los márgenes no se colapsan entre grupos: entre él y el primer dato quedan 14 px
   (10 más los 2 de border-spacing al final del encabezado y al inicio de los datos), como en producción */
.recipe-nutrition tbody .recipe-nutrition__row:first-child {
    margin-top: 10px;
}

.recipe-nutrition__group,
.recipe-nutrition__name,
.recipe-nutrition__value {
    display: block;
    padding: 1px;
    font-weight: 600;
    text-align: left;
}

/* El encabezado de cada grupo va en negrita 900, como el <strong> de producción */
.recipe-nutrition__group {
    font-weight: 900;
}

.recipe-nutrition__name {
    font-weight: 400;
}

.recipe-faq {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Como en producción: renglones de 33 px separados 8 px, con el enlace 14 px abajo (el margen de su párrafo) */
.recipe-faq__item {
    box-sizing: border-box;
    height: 33px;
    padding-top: 14px;
    margin-bottom: 8px;
}

.recipe-faq__link {
    color: inherit;
    text-decoration: underline;
}

.recipe-related {
    margin-bottom: 20px;
}

.recipe-related__title {
    margin: 17px 0;
    font-size: 21px;
    font-weight: 700;
    line-height: 20px;
}

.recipe-grid--related {
    gap: 16px;

    /* Las relacionadas cierran la página con el margen de su sección, sin el de los listados */
    margin-bottom: 0;
}

/* Dos líneas exactas: el "…" lo pone PHP al recortar el título */
.recipe-grid--related .recipe-card__title {
    height: 66px;
    overflow: hidden;
}

/* ── Modales ── */
.recipe-modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-modal);
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 16px;
    overflow-y: auto;
    background: var(--backdrop-recipes);
}

.recipe-modal[hidden] {
    display: none;
}

/* Con el modal abierto sin JS (llega con ?acceso=) se ve igual; con JS, recetas.js bloquea el scroll. Sin ancho
   fijo, como en producción: el panel toma el ancho de su texto más largo, hasta 600 px (el de «Guardar» mide 398 px
   y el de crear cuenta 480 px) */
.recipe-modal__panel {
    position: relative;
    max-width: 600px;
    padding: 24px;

    /* Poppins 14/20 px, como el modal de producción */
    font-family: var(--font-family-poppins);
    font-size: 14px;
    line-height: 20px;
    color: var(--fg-button-soft);
    background: var(--bg);
    border: 1px solid var(--border-recipe-modal);
    border-radius: var(--recipes-radius);
}

.recipe-modal__panel--wide {
    width: 100%;
    max-width: 650px;
    overflow: hidden;
}

.recipe-modal--full {
    /* Una columna del ancho de la pantalla: la cuadrícula del plan (720 px como mínimo) se desplaza dentro de su
       caja y no estira el modal */
    grid-template-columns: minmax(0, 1fr);

    /* Arriba y no al centro: el panel es más alto que la pantalla y centrado se cortaría por arriba */
    align-items: start;
    padding: 0;
}

.recipe-modal__panel--full {
    width: 100%;
    max-width: none;
    min-height: 100%;
    border: 0;
    border-radius: 0;
}

.recipe-modal__close {
    position: absolute;

    /* El centro de la × queda donde la pone producción (31 px del borde de arriba y 24 de la derecha) */
    top: 13px;
    right: 6px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    font-family: inherit;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--fg-recipe);
    text-decoration: none;
    cursor: pointer;
    background: var(--bg);
    border: 0;
    border-radius: var(--radius-pill);
}

/* Una columna con 16 px entre bloques, como el contenedor del modal de producción */
.recipe-access {
    display: flex;
    flex-direction: column;
    row-gap: 16px;
}

/* En «Ver todas las recetas» la × es más chica, con la fuente del modal */
.recipe-modal__panel--wide .recipe-modal__close {
    top: 11px;
    right: 11px;
    font-size: 22px;
    font-weight: 400;
    line-height: 20px;
}

.recipe-access[hidden] {
    display: none;
}

.recipe-access__title {
    /* El margen por defecto de un <h2> (0.83em), que producción no cambia */
    margin: 16.6px 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
}

.recipe-access__text {
    margin: 14px 0;
    line-height: 18px;
    color: var(--fg-recipe-modal);
    text-align: center;
}

.recipe-access__notice {
    padding: 10px 12px;
    margin: 0 0 12px;
    color: var(--danger-fg);
    background: var(--danger-ring);
    border-radius: var(--radius-control);
}

.recipe-access__form {
    display: grid;
    row-gap: 8px;
}

.recipe-access__label {
    font-weight: 600;
    color: var(--fg-recipe-modal);
}

.recipe-access__input {
    width: 100%;
    padding: 8px;
    margin-bottom: 16px;

    /* Producción no les da fuente: quedan con la del sistema a 13.33 px y miden 34 px de alto */
    font-family: var(--font-family-generic);
    font-size: 13.3333px;
    line-height: normal;
    background: var(--bg);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-control);
}

/* El select de producción sin la flecha del navegador: una flecha gris dibujada y una rayita a su izquierda */
.recipe-access__input--select {
    padding-left: 10px;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--fg-recipe-select-arrow) 50%),
        linear-gradient(135deg, var(--fg-recipe-select-arrow) 50%, transparent 50%),
        linear-gradient(to right, var(--border-recipe-select-divider), var(--border-recipe-select-divider));
    background-repeat: no-repeat;
    background-position:
        calc(100% - 20px) calc(1em + 2px),
        calc(100% - 15px) calc(1em + 2px),
        calc(100% - 2.5em) 0.5em;
    background-size:
        5px 5px,
        5px 5px,
        1px 1.5em;
}

.recipe-access__toggle {
    display: flex;
    align-items: center;

    /* La casilla de producción lleva 16 px de margen abajo: el renglón mide 32 px */
    padding-bottom: 12px;
    font-weight: 600;
    color: var(--fg-recipe-modal);
}

.recipe-access__toggle[hidden] {
    display: none;
}

.recipe-access__toggle input {
    margin: 0 6px 0 4px;
}

/* En producción el botón va fuera del formulario: 16 px de separación más 16 de margen */
.recipe-access__form .recipe-button--large {
    margin-top: 24px;
}

/* El texto y el enlace en una fila centrada con 8 px entre los dos, como el pie de los modales de producción */
.recipe-modal__switch {
    display: flex;
    column-gap: 8px;
    align-items: center;
    justify-content: center;
    margin: 0;

    /* 12 px en el teléfono, como el <span> del original hasta 500 px; el enlace se queda en 14 px */
    font-size: 12px;
    line-height: 18px;
    text-align: center;
}

.recipe-modal__link {
    padding: 1px 6px;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.28px;
    color: var(--fg-link);
    text-decoration: underline;
}

/* En el modal de «Guardar» el enlace es un botón de 40 px de alto */
.recipe-access .recipe-modal__link {
    padding: 10px 6px;
}

.recipe-more-modal {
    display: grid;
    grid-template-columns: 1fr;
}

/* El texto, el botón y el pie, centrados en el alto del modal con 16 px entre ellos; la marca va arriba */
.recipe-more-modal__body {
    position: relative;
    display: flex;
    flex-direction: column;
    row-gap: 16px;
    justify-content: center;
    padding-top: 36px;
}

.recipe-more-modal__brand {
    position: absolute;
    top: 0;
    left: 0;
    width: 122px;
    height: 20px;
}

.recipe-more-modal__text {
    margin: 14px 0;
    line-height: 18px;
    color: var(--fg-recipe-modal);
    text-align: center;
}

.recipe-more-modal__image {
    display: none;
}

/* ── Plan semanal ── */

/* Como el contenedor de producción: hasta 1140 px, centrado, en una columna con 16 px entre bloques */
.meal-plan-modal {
    display: flex;
    flex-direction: column;
    row-gap: 16px;
    max-width: 1140px;
    margin: 0 auto;
}

.meal-plan__title {
    margin: 16.6px 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
}

.meal-plan__text {
    margin: 14px 0;
    line-height: 18px;
    color: var(--fg-recipe-modal);
    text-align: center;
}

.meal-plan__scroll {
    overflow-x: auto;
}

.meal-plan {
    display: grid;
    grid-template-columns: auto repeat(5, minmax(140px, 1fr));
    gap: 1px;
    min-width: 720px;
    overflow: hidden;
    background: var(--border-plan);
    border: 1px solid var(--border-plan);
    border-radius: var(--radius-control);
}

.meal-plan__corner {
    background: var(--bg);
}

.meal-plan__head {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-recipe-modal);
    text-align: center;
    background: var(--bg-plan-head);
}

.meal-plan__head--time {
    justify-content: flex-start;
}

.meal-plan__head--total {
    background: var(--bg-plan-total);
}

/* 90 px de contenido más el relleno, como en producción. Las tarjetas llevan su margen a la derecha y abajo (en
   lugar de gap, que Safari 14 no tiene en flex), así que la celda solo rellena arriba y a la izquierda */
.meal-plan__cell {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
    min-height: 106px;
    padding: 8px 0 0 8px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    background: var(--bg);
    border: 0;
    border-radius: 0;
    transition: background 150ms ease;
}

.meal-plan__cell:hover {
    background: var(--bg-plan-head);
}

.meal-plan__add {
    position: absolute;
    top: 50%;
    left: 50%;
    padding: 0;
    font: inherit;
    font-size: 22px;
    line-height: 22px;
    color: var(--fg-plan-add);
    cursor: pointer;
    background: transparent;
    border: 0;
    transform: translate(-50%, -50%);
}

.meal-plan__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 84px;
    margin: 0 8px 8px 0;
    font-size: 12px;
    line-height: 14px;
    color: var(--fg-button-soft);
    text-align: center;
    text-decoration: none;
}

.meal-plan__card-image {
    width: 84px;
    height: 64px;
    margin-bottom: 4px;
    object-fit: cover;
    border-radius: var(--radius-control);
}

/* Dos renglones y «…», como el original */
.meal-plan__card-title {
    display: -webkit-box;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.meal-plan__remove {
    position: absolute;
    top: -6px;
    right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 15px;
    color: var(--on-primary);
    cursor: pointer;
    background: var(--bg-plan-remove);
    border: 0;
    border-radius: 50%;
}

.meal-plan__total {
    display: grid;
    row-gap: 2px;
    padding: 8px;

    /* 12 px en el teléfono, como los <span> del original hasta 500 px */
    font-size: 12px;
    background: var(--bg-plan-head);
}

.meal-plan-shopping {
    margin-top: 32px;
}

.meal-plan-shopping__title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
}

.meal-plan-shopping__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px 24px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.meal-plan-shopping__item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-plan);
}

/* 12 px en el teléfono, como los <span> del original hasta 500 px; el renglón sigue siendo el de 14 px */
.meal-plan-shopping__food,
.meal-plan-shopping__amount {
    font-size: 12px;
}

.meal-plan-shopping__amount {
    margin-left: 12px;
    font-weight: 600;
    color: var(--fg-recipe-modal);
    white-space: nowrap;
}

.meal-plan-shopping__empty {
    color: var(--fg-recipe-empty);
}

/* ── Aviso (snackbar del original, arriba al centro) ── */
.recipe-toast {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: var(--z-toast);
    max-width: calc(100% - 32px);
    padding: 16px;
    color: var(--on-primary);
    text-align: center;
    background: var(--bg-toast);
    border-radius: 10px;
    transform: translateX(-50%);
    font-size: 12px;
}

.recipe-toast[hidden] {
    display: none;
}

/*
 * Responsivo con los mismos cortes del original (Landing-receta: redesign.css, recipeDetail.css y home.css), que
 * usaba max-width 479, 500, 640, 767 y 1024; aquí van como min-width 480, 501, 641, 768 y 1025. Es una excepción de recetas
 * a los cortes de tokens.css (skill rule-frontend, regla 9), para que se acomode igual que producción.
 */

/* El header del original: 1120 px de contenido centrado (más 20 px por lado) y 80 px de alto */
.site-nav--minimal .site-nav__bar {
    max-width: 1160px;
    height: 80px;
    padding: 0 20px;
}

/* En el teléfono el detalle cambia el logo por «Regresar», como el header del original */
.site-nav--back .site-nav__logo {
    display: none;
}

@media (min-width: 480px) {
    .site-nav--back .site-nav__logo {
        display: flex;
    }

    .recipe-macros__value {
        font-family: var(--font-family-poppins);
        line-height: inherit;
    }

    .supplements-banner__title,
    .supplements-banner__subtitle {
        letter-spacing: -0.28px;
    }

    .site-nav--back .site-nav__back {
        display: none;
    }

    .recipe-grid--related {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Desde aquí la fila de un ingrediente cabe en una línea; antes se salía de la pantalla */
    .recipe-ingredient {
        grid-template-areas:
            'input image name view shop'
            'input image unit view shop';
        grid-template-columns: 68px 34px 1fr auto auto;
        row-gap: 0;
        margin-bottom: 8px;
    }

    .recipe-ingredient--plain {
        grid-template-areas: 'input image name view shop';
    }

    .recipe-ingredient__input {
        width: 68px;
    }

    .recipe-more-modal {
        grid-template-columns: 5fr 6fr;
    }

    /* Como en producción, la foto sale del panel por arriba, abajo y a la derecha, y con su proporción decide el
       alto del modal */
    .recipe-more-modal__body {
        padding-top: 0;
    }

    .recipe-more-modal__image {
        display: block;
        width: calc(100% + 32px);
        max-width: none;
        height: auto;
        margin: -42px -42px -42px 10px;
    }
}

/* Desde 501 px vuelven a su tamaño: el original solo achicaba sus <span> hasta 500 px */
@media (min-width: 501px) {
    .recipe-button--soft,
    .recipe-ingredient__name,
    .recipe-modal__switch,
    .recipe-toast {
        font-size: 14px;
    }

    .recipe-ingredient__link {
        font-size: 13px;
    }

    .recipe-access .recipe-modal__link {
        padding: 10px 32px;
    }

    .meal-plan__total {
        font-size: 11px;
    }

    .meal-plan-shopping__food,
    .meal-plan-shopping__amount {
        font-size: 14px;
    }
}

@media (min-width: 641px) {
    .recipe-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }

    .recipe-grid--related {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .supplements-banner {
        grid-template-columns: 40px 1fr auto;
        column-gap: 14px;
        padding: 14px 18px;
    }

    .supplements-banner__icon {
        width: 40px;
        height: 40px;
    }

    .supplements-banner__title {
        font-size: 16px;
    }

    .supplements-banner__subtitle {
        font-size: 13px;
    }

    .supplements-banner__cta {
        grid-column: auto;
        padding: 9px 18px;
    }
}

@media (min-width: 769px) {
    .recipe__hero {
        grid-template-columns: 260px 1fr;
        column-gap: 28px;
        align-items: start;
    }

    .recipe__image {
        height: 260px;
    }
}

@media (min-width: 1025px) {
    .recipe__hero {
        grid-template-columns: 300px 1fr;
    }

    .recipe__image {
        height: 300px;
    }
}
