/* Cocktail list + recipe (Make mode) ---------------------------------------- */

/* ---------- List ---------- */
.list-header { align-items: center; margin-bottom: 0.75rem; }
.list-random { flex-shrink: 0; }

/* Sticky toolbar. Phones: the site header scrolls away, so it sticks to the top. */
.list-toolbar {
    position: sticky;
    top: 0;
    z-index: 1010;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 calc(var(--bs-gutter-x) * -0.5) 1rem;
    padding: 0.6rem calc(var(--bs-gutter-x) * 0.5);
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}
@media (min-width: 992px) {
    .list-toolbar {
        top: var(--header-height);
        margin: 0 0 1.25rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
    }
}

.list-spirits {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0.1rem 0;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
}
.list-toolbar-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}
/* Phones: chips get their own row, Sort/Filters sit above */
@media (max-width: 575.98px) {
    .list-toolbar { flex-direction: column-reverse; align-items: stretch; gap: 0.5rem; }
    .list-toolbar-actions { justify-content: flex-end; }
    .list-toolbar-actions .btn { flex: 1 1 0; }
    .list-toolbar-actions .dropdown { flex: 1 1 0; display: flex; }
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.4rem;
    padding: 0 0.3rem;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 0.72rem;
    font-weight: 700;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: -0.25rem 0 1rem;
    padding: 0;
}
.chip-removable { min-height: 32px; font-size: 0.8rem; }
.chip-removable .chip-label { color: var(--text-muted); }
.chip-removable i { color: var(--text-subtle); }

.list-pagination { margin-top: 2rem; }

/* Filters sheet */
.filter-group + .filter-group { margin-top: 1.25rem; }
.filter-group-title {
    font-family: var(--body-font);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}
.filter-group-options { display: flex; flex-wrap: wrap; gap: 0.45rem; }

/* ---------- Recipe ---------- */
.recipe-back { margin-bottom: 0.75rem; }
/* Phones: the back link floats over the photo instead of taking a row */
@media (max-width: 991.98px) {
    .recipe-back { position: relative; height: 0; margin: 0; z-index: 2; }
    .recipe-back a {
        position: absolute;
        top: 0.5rem;
        left: 0;
        min-height: 36px;
        padding: 0 0.8rem 0 0.6rem;
        border-radius: var(--radius-pill);
        background: rgba(11, 11, 15, 0.6);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
        color: #fff;
        font-size: 0.875rem;
    }
    .recipe-back a:hover { color: #fff; }
}
.recipe-back a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}
.recipe-back a:hover { color: var(--text); }

.recipe {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}
@media (min-width: 992px) {
    .recipe {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        gap: 2.5rem;
        align-items: start;
    }
    .recipe-media {
        position: sticky;
        top: calc(var(--header-height) + 1.5rem);
    }
}

.recipe-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    aspect-ratio: 1 / 1;
}
/* Phones: the full drink, not a cropped band (BG 2026-10-04 — renders are
   square, 2:1 hid half the image; tap-to-expand lightbox covers zoom) */
@media (max-width: 991.98px) {
    .recipe-hero {
        aspect-ratio: 1 / 1;
        max-height: 60vh;
        width: auto;
        margin: calc(-1 * 1.25rem) calc(var(--bs-gutter-x) * -0.5) 0;
        border-radius: 0;
        border: 0;
    }
    .recipe-hero img { object-position: 50% 45%; }
}
.recipe-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recipe-hero-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 180px;
    color: var(--text-subtle);
    font-size: 3rem;
}

.recipe-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}
.recipe-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent-text);
    border: 1px solid var(--accent-border);
    letter-spacing: 0.02em;
}

.recipe-title {
    font-size: clamp(1.9rem, 1.4rem + 2.2vw, 3rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 0 0 0.5rem;
}
.recipe-rating-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.75rem;
    font-weight: 600;
}
.recipe-rating-summary .fa-star { color: var(--star); }
.recipe-rating-summary a { text-decoration: none; }
.recipe-desc { color: var(--text-muted); margin: 0 0 0.9rem; }

.recipe-facts {
    display: flex;
    flex-wrap: wrap;
    scrollbar-width: none;
    gap: 0.4rem;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}
.recipe-facts li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface-1);
    font-size: 0.85rem;
    font-weight: 500;
}
.recipe-facts i { color: var(--text-subtle); font-size: 0.8rem; }
.recipe-facts::-webkit-scrollbar { display: none; }
@media (max-width: 575.98px) {
    /* one swipeable row instead of two */
    .recipe-facts { flex-wrap: nowrap; overflow-x: auto; margin-left: calc(var(--bs-gutter-x) * -0.5); margin-right: calc(var(--bs-gutter-x) * -0.5); padding: 0 calc(var(--bs-gutter-x) * 0.5); }
    .recipe-facts li { white-space: nowrap; }
    .recipe-title { margin-bottom: 0.35rem; }
}

.recipe-actions { display: flex; gap: 0.5rem; }
.recipe-actions-inline { margin-bottom: 0.25rem; }
@media (max-width: 991.98px) {
    .recipe-actions-inline { display: none; }   /* phones use the action bar */
}

/* Favorite: neutral until saved, then a red heart */
.favorite-btn.btn-outline-danger {
    --bs-btn-color: var(--text);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--border-strong);
    --bs-btn-hover-color: var(--text);
    --bs-btn-hover-bg: var(--surface-2);
    --bs-btn-hover-border-color: var(--border-strong);
    --bs-btn-active-color: var(--text);
    --bs-btn-active-bg: var(--surface-3);
    --bs-btn-active-border-color: var(--border-strong);
}
.favorite-btn.btn-danger {
    --bs-btn-color: var(--text);
    --bs-btn-bg: rgba(239, 68, 68, 0.14);
    --bs-btn-border-color: rgba(239, 68, 68, 0.45);
    --bs-btn-hover-color: var(--text);
    --bs-btn-hover-bg: rgba(239, 68, 68, 0.2);
    --bs-btn-hover-border-color: rgba(239, 68, 68, 0.55);
    --bs-btn-active-color: var(--text);
    --bs-btn-active-bg: rgba(239, 68, 68, 0.24);
    --bs-btn-active-border-color: rgba(239, 68, 68, 0.55);
}
.favorite-btn .fa-heart { color: #ef4444; }

/* Make card */
.make-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 0.875rem 0.75rem;
}
@media (min-width: 576px) { .make-card { padding: 1.4rem 1.5rem 1rem; } }

.make-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.make-heading {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
}
.make-heading-steps { margin-top: 1.4rem; margin-bottom: 0.4rem; }
.make-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.servings-stepper,
.unit-toggle {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    padding: 2px;
    height: 40px;
}
.stepper-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    font-size: 0.8rem;
}
.stepper-btn:hover:not(:disabled) { background: var(--surface-3); }
.stepper-btn:disabled { color: var(--text-subtle); opacity: 0.5; }
.servings-value {
    min-width: 5.4rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.unit-toggle [data-unit] {
    height: 34px;
    min-width: 40px;
    padding: 0 0.6rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}
.unit-toggle [data-unit][aria-checked="true"] {
    background: var(--surface-1);
    color: var(--text);
    box-shadow: var(--shadow-1), 0 0 0 1px var(--border);
}

.make-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.make-item + .make-item { border-top: 1px solid var(--border); }
.make-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    min-height: 52px;
    padding: 0.8rem 0.1rem;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    font-size: 1rem;
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
}
.make-check:focus-visible { outline-offset: -2px; border-radius: var(--radius-sm); }
.make-box {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border: 1.5px solid var(--border-strong);
    border-radius: 6px;
    color: transparent;
    font-size: 0.7rem;
    transition: background-color var(--dur-1), border-color var(--dur-1), color var(--dur-1);
}
.make-qty {
    flex: 0 0 auto;
    min-width: 6.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.make-name { flex: 1 1 auto; min-width: 0; }
.make-note { color: var(--text-muted); font-size: 0.9rem; }
.make-note::before { content: "· "; }
.make-subnote { margin: -0.4rem 0 0.7rem 2.9rem; color: var(--text-muted); font-size: 0.875rem; }

.make-step-num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    transition: background-color var(--dur-1), color var(--dur-1), border-color var(--dur-1);
}
.make-step-text { flex: 1 1 auto; padding-top: 1px; }

.make-item.is-done .make-box { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.make-item.is-done .make-step-num { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.make-item.is-done .make-qty,
.make-item.is-done .make-name,
.make-item.is-done .make-step-text {
    color: var(--text-subtle);
    text-decoration: line-through;
    text-decoration-color: var(--text-subtle);
}

.make-garnish {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-muted);
}
.make-garnish i { color: #4ade80; }
.make-garnish strong { color: var(--text); font-weight: 600; }

.make-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.6rem;
}
.make-footer:not(:has(button:not([hidden]))) { display: none; }
#wake-lock-btn.is-active { color: var(--premium); }

/* Sections below the make card */
.recipe-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.recipe-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}
.recipe-section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.9rem;
}
.recipe-section-head .recipe-section-title { margin: 0; }
.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    margin: 0 0 0.9rem;
    padding: 0;
}
.recipe-origin { color: var(--text-muted); }
.recipe-rate .rating-stars { margin-left: -8px; }

.review-list { display: flex; flex-direction: column; }
.review-item { padding: 1rem 0; }
.review-item + .review-item { border-top: 1px solid var(--border); }
.review-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; font-size: 0.9rem; margin-bottom: 0.2rem; }
.review-stars { margin-bottom: 0.5rem; font-size: 0.8rem; color: var(--surface-3); }
.review-stars .is-on { color: var(--star); }
.review-comment p { margin-bottom: 0.6rem; }
.review-form {
    margin-top: 1rem;
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-1);
}
.star-rating-input { display: inline-flex; gap: 0.15rem; }
.star-input-label,
.star-edit-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-subtle);
}
.star-input-label .is-on,
.star-edit-label .is-on { color: var(--star); }
.star-input-label:focus-within,
.star-edit-label:focus-within { outline: 2px solid var(--accent-text); border-radius: var(--radius-sm); }

/* Phone action bar, above the tab bar */
.action-bar {
    display: none;
}
@media (max-width: 991.98px) {
    .action-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(var(--bottom-tab-height) + env(safe-area-inset-bottom, 0px));
        z-index: 1035;
        display: flex;
        gap: 0.5rem;
        padding: 0.55rem calc(var(--bs-gutter-x) * 0.5 + env(safe-area-inset-right, 0px)) 0.55rem calc(var(--bs-gutter-x) * 0.5 + env(safe-area-inset-left, 0px));
        background: var(--header-bg);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        backdrop-filter: saturate(180%) blur(14px);
        border-top: 1px solid var(--border);
    }
    .action-bar .action-bar-btn { flex: 1 1 0; white-space: nowrap; padding-left: 0.5rem; padding-right: 0.5rem; }
    body.has-action-bar {
        padding-bottom: calc(var(--bottom-tab-height) + 62px + env(safe-area-inset-bottom, 0px));
    }
    body.has-action-bar .app-toasts {
        bottom: calc(var(--bottom-tab-height) + 62px + 0.75rem + env(safe-area-inset-bottom, 0px));
    }
}
