/* =============================================
   RECIPE.CSS - Vue détail recette
   ============================================= */

/* RECIPE HEADER */
.recipe-header {
    position: relative;
    height: 42vh;
    min-height: 300px;
    overflow: hidden;
    background: #000;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
    isolation: isolate;
}

.recipe-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* TOPBAR */
.recipe-topbar {
    position: absolute;
    top: 35px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 3;
}

/* SERVINGS ADJUSTER */
.servings-adjuster {
    position: absolute;
    top: 14px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    padding: 4px;
    z-index: 4;
}

.servings-display {
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0 8px;
}

.servings-btn,
.servings-reset {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.servings-reset {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.servings-adjuster i {
    padding-top: 3px;
}

/* RECIPE BODY */
.recipe-body {
    position: relative;
    z-index: 5;
    margin-top: -18px;
    background:
        radial-gradient(700px 280px at 50% -80px, #fff7ed 0%, transparent 60%),
        var(--surface);
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    padding: 18px 18px 110px;
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.06);
}

/* ECO TAG */
.tag-chip.eco {
    z-index: 40;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border: 1px solid #EEF0F3;
    padding: 6px;
    border-radius: 999px;
    display: flex;
    gap: 4px;
    margin: 6px 0 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* MODE BUTTONS */
.mode-buttons-sticky {
    display: flex;
    gap: 10px;
    align-items: stretch;
    padding: 14px 20px;
    margin: 0 -24px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mode-buttons-sticky.is-stuck {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mode-btn {
    flex: 1;
    padding: 12px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-muted);
    background: transparent;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all .25s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
}

/* Badge styles for discount and time */
.mode-btn .mode-badge-discount,
.mode-btn .mode-badge-time {
    position: absolute !important;
    top: -10px !important;
    right: -6px !important;
    font-size: 0.6rem !important;
    font-weight: 900 !important;
    padding: 3px 6px !important;
    border-radius: 20px !important;
    z-index: 10 !important;
    animation: badgePulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    line-height: 1;
}

.mode-btn .mode-badge-discount {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
    color: white !important;
    border: 2px solid white !important;
}

.mode-btn .mode-badge-time {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    color: white !important;
    border: 2px solid white !important;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.mode-btn.active {
    background: white;
    color: var(--text-main);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.mode-btn[data-mode="fast"].active {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    color: #EA580C;
    border: 2px solid #FDBA74;
}

.mode-btn:not(.active) {
    border: 2px solid #E5E7EB;
    color: #6B7280;
    background: rgba(255, 255, 255, 0.6);
}

.mode-btn[data-mode="fast"]:not(.active) {
    border: 2px solid #FED7AA;
    color: #EA580C;
    background: rgba(255, 237, 213, 0.5);
}

/* ECO BUTTON - Featured & slightly larger */
.mode-btn.mode-btn-featured[data-mode="eco"] {
    flex: 1.15;
}

.mode-btn[data-mode="eco"]:not(.active) {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    color: #059669;
    border: 2px solid #34D399;
    animation: pulseGreenBorder 2.5s infinite;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.mode-btn[data-mode="eco"].active {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
    border: 2px solid #10B981;
}

@keyframes pulseGreenBorder {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
        border-color: #34D399;
    }

    50% {
        box-shadow: 0 6px 25px rgba(16, 185, 129, 0.35);
        border-color: #10B981;
    }
}

/* LOADING STATE pour les boutons de mode */
.mode-btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.mode-btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btnSpin 0.8s linear infinite;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes btnSpin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Transitions pour les badges */
.mode-btn .mode-badge-discount,
.mode-btn .mode-badge-time {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mode-btn .mode-badge-discount.updated,
.mode-btn .mode-badge-time.updated {
    animation: badgeUpdate 0.5s ease;
}

@keyframes badgeUpdate {
    0% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

/* SAVINGS TEASER */
.savings-teaser {
    background: linear-gradient(135deg, #064E3B 0%, #059669 100%);
    color: #fff;
    margin: 10px 0 18px;
    padding: 16px;
    border-radius: 18px;
    position: relative;
    z-index: 2;
}

.teaser-title {
    font-weight: 900;
    font-size: 1rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.teaser-sub {
    font-size: .85rem;
    opacity: .95;
    line-height: 1.4;
}

.teaser-icon {
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.2);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 15px;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ECO DASHBOARD */
.eco-card {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 18px;
    border: 1px solid #A7F3D0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.eco-gain {
    font-size: 1.9rem;
    font-weight: 900;
    color: #047857;
    line-height: 1;
    display: block;
}

.eco-label {
    font-size: .7rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #065F46;
    letter-spacing: 1px;
}

.eco-sep {
    width: 1px;
    height: 40px;
    background: rgba(0, 0, 0, 0.1);
}

.eco-text {
    font-size: .9rem;
    color: #064E3B;
    font-weight: 700;
    line-height: 1.4;
}

/* INGREDIENTS LIST */
.list-container {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    background: var(--surface);
    border: 1px solid #F1F5F9;
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .03);
}

.item-main-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    gap: 12px;
}

.item-text-col {
    flex: 1;
    min-width: 0;
}

.check-circle {
    width: 20px;
    height: 20px;
    border: 2px solid #E5E7EB;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #f3f4f6);
    flex-shrink: 0;
    margin-top: 2px;
}

.item-name {
    font-weight: 700;
    font-size: .95rem;
}

.item-qty {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 700;
}

.item-price {
    background: #0F172A08;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 900;
    color: #111827;
    min-width: 64px;
    text-align: right;
    margin-top: -4px;
    height: fit-content;
}

.diff-old {
    text-decoration: line-through;
    opacity: .45;
    font-size: .85em;
    margin-right: 6px;
}

.diff-new {
    color: #059669;
    font-weight: 900;
}

.badge-sub {
    display: inline-block;
    background: #D1FAE5;
    color: #059669;
    font-size: .65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 900;
    margin-left: 4px;
}

/* STEPS TIMELINE */
.steps-timeline {
    position: relative;
    padding-left: 10px;
    border-left: 2px dashed #E5E7EB;
}

.step-card {
    position: relative;
    background: var(--surface);
    padding: 14px 14px 12px;
    border-radius: 14px;
    border: 1px solid #F1F5F9;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .03);
    margin-left: 8px;
}

.step-card::before {
    content: "";
    position: absolute;
    left: -27px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px #fff;
    border: 2px solid #FDE7D5;
}

.step-card.fast-changed::before {
    background: var(--orange-fast);
    border-color: #FDBA74;
}

.step-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 900;
    font-size: .8rem;
    color: var(--primary);
    letter-spacing: .6px;
}

.step-badge-fast {
    background: var(--orange-fast-soft);
    color: var(--orange-fast);
    border: 1px solid #FDBA74;
    font-size: .65rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 6px;
}

.step-old {
    margin-top: 8px;
    font-size: .85rem;
    color: #9CA3AF;
    text-decoration: line-through;
    line-height: 1.4;
    font-weight: 700;
}

/* STICKY TOTAL */
.total-sticky {
    position: fixed;
    bottom: 100px;
    left: 16px;
    right: 16px;
    background: #0f172a;
    color: white;
    padding: 14px 18px;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    z-index: 90;
    border: 1px solid rgba(255, 255, 255, .06);
}

.total-sticky.hidden {
    transform: translateY(150%);
}