/* ============================================================
   css/receta-detalle.css — Dark Green Glassmorphism
   Aplica a TODAS las páginas receta-*.html
   Optimizado: will-change, contain, font-display
   ============================================================ */

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes recipeHeroIn {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes orbPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes checkPop {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* ── 1. Base de la página ────────────────────────────────── */
.recipe-page {
    background: linear-gradient(135deg, #081A0A 0%, #0D2B0F 55%, #0A2010 100%);
    font-family: 'Inter', sans-serif;
    color: #C8E6C9;
    padding-bottom: 5rem;
    min-height: 100vh;
    position: relative;
}

/* Orbe decorativo de fondo */
.recipe-page::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -15%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.08) 0%, transparent 65%);
    border-radius: 50%;
    pointer-events: none;
    animation: orbPulse 14s ease-in-out infinite;
    z-index: 0;
}

/* ── 2. Hero de la Receta ────────────────────────────────── */
.recipe-hero {
    background: linear-gradient(180deg,
            rgba(8, 26, 10, 0.55) 0%,
            rgba(13, 43, 15, 0.70) 100%);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(76, 175, 80, 0.2);
    padding: 8rem 0 4rem;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: recipeHeroIn 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

/* Badge "Paso a Paso" */
.recipe-hero-tag {
    display: inline-block;
    background: linear-gradient(135deg, #2E7D32, #4CAF50);
    color: #FFFFFF !important;
    padding: 0.5rem 1.3rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.2rem;
    box-shadow: 0 4px 18px rgba(76, 175, 80, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Título principal */
.recipe-title-main {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 1rem;
    /* Verde oscuro profundo — el color del sitio */
    color: #1B5E20 !important;
    -webkit-text-fill-color: #1B5E20 !important;
    background: none !important;
    text-shadow:
        0 2px 6px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(76, 175, 80, 0.2);
    line-height: 1.2;
}

/* Íconos de metadata */
.recipe-meta-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #A5D6A7 !important;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

/* ── 3. Contenedor principal ─────────────────────────────── */
.recipe-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.recipe-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-top: -1rem;
}

@media (min-width: 992px) {
    .recipe-grid {
        grid-template-columns: 1fr 350px;
    }
}

/* ── 4. Caja de video ────────────────────────────────────── */
.recipe-video-box {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 20px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-bottom: 2.5rem;
}

.video-wrapper-inner {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #000;
}

.video-wrapper-inner video {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ── 5. Tarjetas de Ingredientes y Pasos ─────────────────── */
.recipe-card-box {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-radius: 20px !important;
    padding: 2.5rem !important;
    border: 1px solid rgba(76, 175, 80, 0.20) !important;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    will-change: box-shadow;
    contain: layout;
}

.recipe-card-box:hover {
    border-color: rgba(76, 175, 80, 0.45) !important;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 25px rgba(76, 175, 80, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

/* ── 6. Títulos de sección (🛒 Ingredientes / 🔪 Instrucciones) ─ */
.section-heading {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    background: none !important;
    border-bottom: 2px solid rgba(76, 175, 80, 0.45);
    padding-bottom: 0.75rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* ── 7. Lista de Ingredientes Interactiva ────────────────── */
.ingredients-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ingredient-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 0.5rem;
    border-bottom: 1px solid rgba(76, 175, 80, 0.12);
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.25s ease, padding-left 0.25s ease;
    contain: layout style;
}

.ingredient-item:last-child {
    border-bottom: none;
}

.ingredient-item:hover {
    background: rgba(76, 175, 80, 0.08);
    padding-left: 1rem;
}

/* Checkbox personalizado */
.ingredient-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(76, 175, 80, 0.4);
    border-radius: 7px;
    margin-right: 1rem;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.04);
}

.ingredient-item:hover .ingredient-checkbox {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

/* Estado: marcado */
.ingredient-item.checked .ingredient-checkbox {
    background: #4CAF50 !important;
    border-color: #4CAF50 !important;
    animation: checkPop 0.35s ease;
}

.ingredient-item.checked .ingredient-checkbox::after {
    content: '✓';
    color: #FFFFFF !important;
    font-size: 14px;
    font-weight: 800;
}

/* Texto del ingrediente — BLANCO para máxima legibilidad */
.ingredient-text {
    font-size: 1rem;
    color: #FFFFFF !important;
    font-weight: 500;
    transition: color 0.25s ease;
    line-height: 1.4;
}

/* Al marcar: tachado */
.ingredient-item.checked .ingredient-text {
    text-decoration: line-through;
    color: rgba(165, 214, 167, 0.45) !important;
}

/* Tip pequeño debajo del título */
.recipe-sidebar p[style],
.recipe-card-box>p {
    color: #81C784 !important;
    font-size: 0.88rem !important;
}

/* ── 8. Instrucciones Paso a Paso ────────────────────────── */
.steps-list {
    counter-reset: step-counter;
    list-style: none;
    padding: 0;
}

.step-item {
    position: relative;
    padding-left: 3.5rem;
    margin-bottom: 2rem;
}

/* Número del paso */
.step-item::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50 !important;
    border: 2px solid rgba(76, 175, 80, 0.35);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.step-item:hover::before {
    background: #4CAF50;
    color: #FFFFFF !important;
    border-color: #4CAF50;
    transform: scale(1.12);
    box-shadow: 0 0 14px rgba(76, 175, 80, 0.5);
}

/* Texto del paso — BLANCO legible y elegante */
.step-text {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #FFFFFF !important;
    margin: 0;
    padding-top: 6px;
    transition: color 0.25s ease;
}

.step-item:hover .step-text {
    color: #C8E6C9 !important;
}

/* h3 de "Infografía Original" */
.recipe-card-box h3 {
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    background: none !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

/* ── 9. Imagen de referencia ─────────────────────────────── */
.reference-image {
    width: 100%;
    border-radius: 14px;
    margin-top: 2rem;
    border: 1px solid rgba(76, 175, 80, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.reference-image:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), 0 0 20px rgba(76, 175, 80, 0.15);
}

/* ── 10. Botón flotante "← Volver" ──────────────────────── */
.back-floating {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(13, 43, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #81C784 !important;
    padding: 0.65rem 1.3rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid rgba(76, 175, 80, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.back-floating:hover {
    color: #FFFFFF !important;
    background: rgba(46, 125, 50, 0.75);
    border-color: #4CAF50;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
    transform: translateY(-2px) translateX(2px);
}

/* ── 11. Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .recipe-title-main {
        font-size: 1.9rem;
    }

    .recipe-hero {
        padding: 7rem 1rem 3rem;
    }

    .recipe-card-box {
        padding: 1.8rem 1.5rem !important;
    }

    .step-item {
        padding-left: 3rem;
    }

    .meta-item {
        font-size: 0.85rem;
    }
}