/* ==========================================================================
   Packs page — Category Shelves layout.
   Uses --forest-*, --sand-*, --text-* tokens from hub.css.
   ========================================================================== */

body { margin: 0; }

/* Global app-header band — mirrors the home page header (index.html) exactly.
   The band itself is the tap-to-home target (click handler in inline JS).
   Buttons inside stop propagation so they keep their own behaviour. */
.header {
    background: var(--forest-800);
    padding: 20px 24px;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    cursor: pointer;
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}
.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.back-btn:hover { background: rgba(255,255,255,0.25); }
.back-btn svg { width: 20px; height: 20px; }
.header-profile-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.header-profile-btn:hover { background: rgba(255,255,255,0.25); }
.header-profile-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}
.header-login-btn {
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.header-login-btn:hover { background: rgba(255,255,255,0.3); }
.header .tagline {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 4px;
    font-weight: 400;
    letter-spacing: 0.01em;
    min-height: 1.4em;
    line-height: 1.4;
    white-space: nowrap;
    margin: 0;
}
@media (max-width: 600px) {
    .header { padding: 16px 16px; }
    .header .tagline { display: none; }
}

.packs-page {
    padding: 18px 20px 96px;
    max-width: 720px;
    margin: 0 auto;
    background: var(--sand-100);
    min-height: 100vh;
}

.packs-header { margin-bottom: 16px; }
.packs-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--forest-600);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 2px;
}
.packs-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--forest-800);
    margin: 0 0 3px;
    letter-spacing: -0.015em;
    line-height: 1.1;
}
.packs-context {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}
.packs-context #packsContextName { color: var(--forest-700); font-weight: 600; }

.packs-search-wrap { margin-bottom: 14px; }
.packs-search {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid var(--sand-border);
    background: var(--cream-100);
    font-size: 14px;
}

.packs-taxa-chips,
.packs-continent-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.packs-chip {
    background: var(--cream-100);
    border: 1px solid var(--sand-border);
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 12px;
    color: var(--forest-700, #234d38);
    white-space: nowrap;
    font-weight: 600;
    cursor: pointer;
}
.packs-chip.active {
    background: var(--forest-800);
    color: var(--cream-50);
    border-color: var(--forest-800);
}

/* ========== Filter row (country + taxa chips + search icon) ========== */
.packs-filter-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
}
.packs-filter-chip {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e4e0d4;
    border-radius: 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--forest-800);
    box-shadow: 0 1px 2px rgba(15,40,24,0.04);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.packs-filter-chip.active {
    border-color: var(--forest-800);
    box-shadow: 0 0 0 1px var(--forest-800);
}
.packs-filter-lead {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.packs-filter-ico {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
}
.packs-filter-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.packs-filter-chev {
    color: #9a9a9a;
    font-size: 10px;
    flex-shrink: 0;
}
.packs-filter-iconbtn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e4e0d4;
    color: var(--forest-800);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(15,40,24,0.04);
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.packs-filter-iconbtn[aria-pressed="true"] {
    background: var(--forest-800);
    color: var(--cream-50);
    border-color: var(--forest-800);
}

.packs-search-inline {
    margin-bottom: 18px;
}
.packs-search-inline[hidden] { display: none; }

/* ========== Bottom sheet (shared by country + taxa pickers) ========== */
.packs-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    transition: opacity 160ms ease;
    -webkit-tap-highlight-color: transparent;
}
.packs-sheet-backdrop[hidden] { display: none; }
.packs-sheet-backdrop.is-open {
    opacity: 1;
}
.packs-sheet {
    background: var(--cream-100);
    width: 100%;
    max-width: 720px;
    max-height: 75vh;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 14px 18px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.packs-sheet-backdrop.is-open .packs-sheet {
    transform: translateY(0);
}
.packs-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--sand-border);
    border-radius: 99px;
    margin: 0 auto 12px;
}
.packs-sheet-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 800;
    font-size: 20px;
    color: var(--forest-800);
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}
.packs-sheet-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 14px;
}
.packs-sheet-body {
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Country list rows */
.packs-sheet-list {
    display: flex;
    flex-direction: column;
}
.packs-sheet-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--sand-border);
    cursor: pointer;
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
}
.packs-sheet-row:last-child { border-bottom: none; }
.packs-sheet-row.active {
    background: var(--sand-border);
    border-bottom-color: transparent;
}
.packs-sheet-row .flag {
    font-size: 22px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}
.packs-sheet-row .country-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: var(--forest-800);
}
.packs-sheet-row .country-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.packs-sheet-row.active .country-count {
    color: var(--forest-800);
}
.packs-sheet-check {
    color: var(--ochre-600);
    font-weight: 700;
    font-size: 16px;
    margin-left: 4px;
}

/* Taxa 2-col grid */
.packs-sheet-taxa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-bottom: 8px;
}
.packs-sheet-taxa-row {
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--sand-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.packs-sheet-taxa-row.active {
    background: var(--forest-800);
    color: var(--cream-50);
    border-color: var(--forest-800);
}
.packs-sheet-taxa-row .taxa-ico {
    font-size: 20px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}
.packs-sheet-taxa-row .taxa-body {
    min-width: 0;
    flex: 1;
}
.packs-sheet-taxa-row .taxa-name {
    font-weight: 700;
    font-size: 13px;
    color: inherit;
}
.packs-sheet-taxa-row .taxa-count {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 2px;
}

.packs-shelf {
    margin-bottom: 22px;
}
.packs-shelf-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}
.packs-shelf-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--forest-900, #0d2818);
    letter-spacing: -0.015em;
    margin: 0;
}
.packs-shelf-more {
    font-size: 11px;
    color: var(--forest-800);
    font-weight: 700;
    text-decoration: none;
    background: #f3eedf;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.packs-shelf-more:hover { background: #ebe3cf; }
.packs-shelf-tag {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 10px;
    line-height: 1.3;
}

/* Netflix-style horizontal scrolling shelves. The row bleeds to the page
   edges (negative margin matching .packs-page padding) so the peeking
   card at the right edge signals "swipe for more". scroll-snap keeps the
   row aligned after a flick; scrollbar is hidden since the peek is the cue. */
.packs-shelf-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    margin: 0 -20px;
    padding: 4px 20px 10px;
    scrollbar-width: none;
}
.packs-shelf-row::-webkit-scrollbar { display: none; }
.packs-shelf-row > .pack-card,
.packs-shelf-row > .pack-card-column {
    flex: 0 0 46%;
    min-width: 0;
    scroll-snap-align: start;
}

/* Pack-card refinements scoped to the packs page only.
   Shared pack-card.css is also consumed by trips.html, so we override here
   instead of editing pack-card.css. */
.packs-page .pack-card-photo {
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
}
.packs-page .pack-card-title {
    color: var(--forest-900, #0d2818);
}
.packs-page .pack-card-sub {
    color: var(--text-secondary, #555);
}

.packs-current-badge {
    position: absolute; top: 8px; right: 8px;
    background: var(--forest-600);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    z-index: 2;
}

.packs-drillin-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.packs-back { font-size: 22px; color: var(--forest-600); line-height: 1; text-decoration: none; }
.packs-drillin-title { font-family: 'Fraunces', Georgia, serif; font-size: 1.6rem; font-weight: 600; color: var(--forest-800); margin: 0; }
.packs-drillin-sub { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 16px; }
.packs-drillin-hero-slot { margin-bottom: 18px; }
.packs-drillin-hero {
    aspect-ratio: 16/9;
    border-radius: 18px;
    background-size: cover; background-position: center;
    position: relative; overflow: hidden;
    color: #fff;
    cursor: pointer;
}
.packs-drillin-hero-overlay {
    position: absolute; inset: auto 0 0 0;
    padding: 14px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
}
.packs-drillin-hero-title { font-family: 'Fraunces', Georgia, serif; margin: 4px 0 2px; font-size: 1.2rem; }
.packs-drillin-hero-meta { margin: 0; font-size: 0.75rem; opacity: 0.9; }
/* packs-global-badge: used by renderDrillinHero overlay */
.packs-global-badge {
    background: rgba(255,255,255,0.95);
    color: var(--forest-800);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 6px;
}
/* packs-card-attribution: used by makeAttributionLine in renderDrillinHero */
.packs-card-attribution {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 0;
    line-height: 1.3;
    opacity: 0.85;
}
.packs-drillin-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

.packs-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.packs-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.packs-cta-icon { font-size: 32px; line-height: 1; }
.packs-cta-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.packs-cta-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--forest-800);
}
.packs-cta-sub { font-size: 0.8rem; color: var(--text-muted); }
.packs-cta-arrow { font-size: 24px; color: var(--forest-600); line-height: 1; }
