/* ═══════════════════════════════════════════════════════════════
   Favorites  (fv-)  — faithful translation of fr-favorites.jsx
   ═══════════════════════════════════════════════════════════════ */

/* ── Nav: dark green + sticky ── */
body:has(.fv-page) .nh-header {
    background: #0B3D2E !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 200 !important;
}
body:has(.fv-page) main,
body:has(.fv-loading) main { padding-top: 0 !important; }

/* ── Page wrapper ── */
.fv-page {
    background: #F8FAFC;
    min-height: 60vh;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    color: #0F172A;
    padding-bottom: 80px;
}
.fv-page, .fv-page * { box-sizing: border-box; }

.fv-loading {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #64748B;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    background: #F8FAFC;
}

/* ── Hero strip ── */
.fv-hero {
    background: #fff;
    border-bottom: 1px solid #E2E8F0;
    font-family: 'Geist','Inter',system-ui,sans-serif;
}
.fv-hero-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 30px 40px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.fv-kicker {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #10B981;
    margin-bottom: 10px;
}
.fv-title {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -.025em;
    margin: 0;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.1;
}
.fv-subtitle {
    font-size: 14.5px;
    color: #64748B;
    margin: 8px 0 0;
}

/* ── Hero toolbar (sort + add-all) ── */
.fv-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

/* Sort dropdown */
.fv-sort-wrap { position: relative; }
.fv-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #E2E8F0;
    background: #fff;
    color: #0F172A;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.fv-sort-label { color: #64748B; }
.fv-sort-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 18px 50px -16px rgba(15,23,42,.3);
    overflow: hidden;
    min-width: 210px;
}
.fv-sort-opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 11px 16px;
    border: none;
    background: #fff;
    color: #0F172A;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    font-size: 13.5px;
    cursor: pointer;
    transition: background .1s;
}
.fv-sort-opt:hover { background: #F8FAFC; }
.fv-sort-opt.is-active { background: #F8FAFC; color: #0B3D2E; font-weight: 600; }
.fv-sort-backdrop {
    position: fixed;
    inset: 0;
    z-index: 49;
}

/* Add-all button */
.fv-add-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: linear-gradient(135deg, #10B981 0%, #047857 100%);
    color: #fff;
    border: none;
    padding: 13px 20px;
    border-radius: 12px;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 24px -12px rgba(16,185,129,.6);
    white-space: nowrap;
    transition: opacity .15s;
}
.fv-add-all-btn:hover { opacity: .92; }
.fv-add-all-btn.is-done { background: #047857; }

/* ── Content area ── */
.fv-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 40px 80px;
}

/* ── Empty state ── */
.fv-empty {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 80px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.fv-empty-icon { opacity: .5; }
.fv-empty h3 { font-size: 21px; margin: 0; color: #0F172A; font-weight: 700; }
.fv-empty p  { font-size: 14px; color: #64748B; margin: 0; }
.fv-empty-btn {
    margin-top: 8px;
    display: inline-flex;
    padding: 13px 22px;
    background: #0B3D2E;
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background .15s;
}
.fv-empty-btn:hover { background: #14532D; color: #fff; }

/* ── Desktop grid (4 columns, reuses pl-card styles) ── */
.fv-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Heart in favorites is always filled green; clicking removes */
.fv-grid .pl-heart-abs { border-color: #10B981; background: rgba(16,185,129,.10); }
.fv-grid .pl-heart-abs svg path { stroke: #10B981; fill: #10B981; }

/* ── Mobile list (hidden on desktop) ── */
.fv-list { display: none; }

.fv-item {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
}
.fv-item-img {
    width: 104px;
    flex-shrink: 0;
    border-right: 1px solid #E2E8F0;
    position: relative;
    background: repeating-linear-gradient(
        45deg,
        rgba(16,185,129,.05) 0 9px,
        rgba(16,185,129,.10) 9px 18px
    );
    display: flex;
    align-items: center;
    justify-content: center;
}
.fv-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fv-item-body {
    flex: 1;
    min-width: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.fv-item-toprow {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.fv-item-brand { font-size: 11px; color: #64748B; }
.fv-item-remove {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    line-height: 0;
    flex-shrink: 0;
}
.fv-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #0F172A;
    line-height: 1.3;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.fv-item-name:hover { color: #0B3D2E; }
.fv-item-compat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #14532D;
    font-weight: 600;
}
.fv-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 6px;
}
.fv-item-price {
    font-size: 18px;
    font-weight: 700;
    color: #0B3D2E;
    letter-spacing: -.02em;
}
.fv-item-add {
    height: 36px;
    padding: 0 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #10B981 0%, #047857 100%);
    color: #fff;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity .15s;
}
.fv-item-add.is-done { background: #047857; }
.fv-item-add:hover { opacity: .9; }

/* ── Mobile sticky bar (hidden on desktop) ── */
.fv-mob-bar { display: none; }

/* ── Add-all toast ── */
.fv-toast {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 400;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #0B3D2E;
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 28px rgba(11,61,46,.35);
    animation: fv-toast-in .25s cubic-bezier(.16,1,.3,1);
    pointer-events: none;
}
@keyframes fv-toast-in {
    from { transform: translateY(-16px) scale(.96); opacity: 0; }
    to   { transform: translateY(0)     scale(1);   opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .fv-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .fv-hero-inner { padding: 20px 16px; flex-direction: column; align-items: flex-start; }
    .fv-title { font-size: 26px; }
    .fv-toolbar { width: 100%; justify-content: space-between; }
    .fv-content { padding: 16px 16px 100px; }
    .fv-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

@media (max-width: 480px) {
    /* Switch to list layout */
    .fv-grid { display: none; }
    .fv-list { display: flex; flex-direction: column; gap: 12px; }
    .fv-toolbar { flex-wrap: wrap; }
    /* Hide sort on very small — no sort in mobile design */
    .fv-sort-wrap { display: none; }
    /* Sticky bottom bar */
    .fv-mob-bar {
        display: block;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 50;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid #E2E8F0;
        padding: 12px 16px 26px;
    }
    .fv-mob-add-all {
        width: 100%;
        height: 50px;
        border-radius: 12px;
        border: none;
        background: linear-gradient(135deg, #10B981 0%, #047857 100%);
        color: #fff;
        font-family: 'Geist','Inter',system-ui,sans-serif;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        box-shadow: 0 10px 24px -10px rgba(16,185,129,.6);
    }
    .fv-mob-add-all.is-done { background: #047857; }
}
