/* ============================================================
   Receptköket – Dark/Light Theme
   ============================================================ */

/* === DARK THEME (default) === */
:root,
[data-theme="dark"] {
    --bg:      #1A1A2E;
    --card:    #16213E;
    --primary: #E94560;
    --accent:  #0F3460;
    --text:    #E0E0E0;
    --muted:   #8892A4;
    --border:  rgba(255,255,255,.08);
    --shadow:  0 4px 24px rgba(0,0,0,.4);
    --input-bg: #0F3460;
    --code-bg:  rgba(255,255,255,.06);
}

/* === LIGHT THEME === */
[data-theme="light"] {
    --bg:      #F5F7FA;
    --card:    #FFFFFF;
    --primary: #E94560;
    --accent:  #EEF2FF;
    --text:    #1A1A2E;
    --muted:   #64748B;
    --border:  rgba(0,0,0,.10);
    --shadow:  0 4px 24px rgba(0,0,0,.10);
    --input-bg: #EEF2FF;
    --code-bg:  rgba(0,0,0,.06);
}

:root {
    --radius:     12px;
    --transition: .2s ease;
    --header-h:   56px;   /* height of top row only (used for mobile overlay) */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background .25s, color .25s;
}

main { flex: 1; }
img  { max-width: 100%; display: block; }
a    { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-weight: 700; line-height: 1.2; color: var(--text); }
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3 { color: #fff; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    border: none;
    transition: opacity var(--transition), transform var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline  { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-systembolaget { background: #007732; color: #fff; font-size: .85rem; padding: 10px 20px; }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-lätt,  .badge-easy   { background: #1a4731; color: #4ade80; }
.badge-medel, .badge-medium { background: #3d2e0a; color: #fbbf24; }
.badge-svår,  .badge-hard   { background: #3b0f0f; color: #f87171; }
.badge-difficulty            { background: rgba(0,0,0,.35); color: #fff; }
[data-theme="light"] .badge-lätt,
[data-theme="light"] .badge-easy   { background: #dcfce7; color: #166534; }
[data-theme="light"] .badge-medel,
[data-theme="light"] .badge-medium { background: #fef9c3; color: #854d0e; }
[data-theme="light"] .badge-svår,
[data-theme="light"] .badge-hard   { background: #fee2e2; color: #991b1b; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(22, 33, 62, .95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background .25s;
}
[data-theme="light"] .site-header {
    background: rgba(255,255,255,.95);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

/* Row 1: logo + search + controls + hamburger */
.header-top {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--header-h);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text);
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}
[data-theme="dark"] .logo { color: #fff; }
.logo:hover { text-decoration: none; opacity: .9; }
.logo-icon { font-size: 1.4rem; }

/* Search – stretches to fill available space in top row */
.header-search { flex: 1; }
.search-wrap   { position: relative; }

.header-search input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 9px 44px 9px 18px;
    color: var(--text);
    font-size: .9rem;
    outline: none;
    transition: border-color var(--transition);
}
.header-search input:focus { border-color: var(--primary); }
.header-search input::placeholder { color: var(--muted); }

.header-search button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
}
.header-search button:hover { color: var(--primary); }

/* CTA-knapp-grupp i top-raden */
.header-cta-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Alla recept CTA */
.header-all-recipes {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 2px solid #4e9af1;
    border-radius: 20px;
    color: #4e9af1;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}
.header-all-recipes:hover,
.header-all-recipes.active {
    background: #4e9af1;
    color: #fff;
    text-decoration: none;
}

/* Dryckes-match CTA button in top row */
.header-drink-match {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 2px solid var(--primary);
    border-radius: 20px;
    color: var(--primary);
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}
.header-drink-match:hover,
.header-drink-match.active {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}
[data-theme="dark"] .header-drink-match { color: var(--primary); }
[data-theme="dark"] .header-drink-match:hover,
[data-theme="dark"] .header-drink-match.active { color: #fff; }

/* Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    z-index: 200;
}
.autocomplete-dropdown a {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    font-size: .9rem;
}
.autocomplete-dropdown a:hover { background: var(--accent); }

/* Header controls (lang + theme) */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Language switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: .78rem;
    font-weight: 600;
}
.lang-btn {
    padding: 4px 8px;
    border-radius: 5px;
    color: var(--muted);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.lang-btn:hover, .lang-btn.active {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}
.lang-divider { color: var(--border); }

/* Theme toggle */
.theme-toggle {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background var(--transition);
    display: flex;
    align-items: center;
}
.theme-toggle:hover { background: var(--accent); }

/* Show sun in dark, moon in light */
[data-theme="dark"]  .icon-sun  { display: none; }
[data-theme="dark"]  .icon-moon { display: inline; }
[data-theme="light"] .icon-sun  { display: inline; }
[data-theme="light"] .icon-moon { display: none; }

/* Nav – second row on desktop */
.main-nav { border-top: 1px solid var(--border); }
/* Mobile-only CTA-duplicates – hidden on desktop */
.nav-all-recipes-mobile  { display: none; }
.nav-drink-match-mobile  { display: none; }
.main-nav ul { list-style: none; display: flex; gap: 2px; padding: 4px 0; flex-wrap: wrap; }
.main-nav a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--text);
    font-size: .82rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.main-nav a:hover, .main-nav a.active {
    background: var(--accent);
    color: var(--primary);
    text-decoration: none;
}
[data-theme="dark"] .main-nav a:hover,
[data-theme="dark"] .main-nav a.active { color: #fff; }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}
.hamburger span {
    display: block;
    width: 24px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: flex-end;
    background: var(--hero-bg, linear-gradient(135deg, var(--accent), var(--bg))) center/cover no-repeat;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26,26,46,.95) 30%, rgba(26,26,46,.2));
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
    padding: 60px 40px;
    margin: 0 auto;
    width: 100%;
}
.hero-label {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 16px;
}
.hero-content h1,
.hero-content .hero-title { font-size: clamp(1.8rem,4vw,2.8rem); margin-bottom: 12px; color: #fff; font-weight: 700; }
.hero-content p  { color: #ccc; margin-bottom: 20px; max-width: 480px; }
.hero-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; font-size: .85rem; color: #aaa; }

/* ============================================================
   CATEGORY STRIP
   ============================================================ */
.category-strip { padding: 24px 0; border-bottom: 1px solid var(--border); }
.category-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }

.category-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 8px 20px;
    color: var(--text);
    font-size: .88rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition);
}
.category-chip:hover {
    background: var(--accent);
    border-color: var(--primary);
    text-decoration: none;
}
.chip-icon { font-size: 1.2rem; }

/* ============================================================
   RECIPE GRID
   ============================================================ */
.section { padding: 48px 0; }
.section-title { font-size: 1.6rem; margin-bottom: 28px; }

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.recipe-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.card-img-link {
    display: block;
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}
.card-img-link img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.recipe-card:hover .card-img-link img { transform: scale(1.04); }

.card-badge {
    position: absolute;
    top: 12px; left: 12px;
    background: var(--primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.card-body { padding: 18px; }
.card-body h3 { font-size: 1rem; margin-bottom: 8px; }
.card-body h3 a { color: var(--text); }
[data-theme="dark"] .card-body h3 a { color: #fff; }
.card-body h3 a:hover { color: var(--primary); text-decoration: none; }
.card-desc  { font-size: .83rem; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.card-meta  { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); }
.card-source-line { margin-bottom: 10px; }
.card-source-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .73rem;
    font-weight: 500;
    color: var(--primary);
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.25);
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.source-favicon {
    width: 13px;
    height: 13px;
    object-fit: contain;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ============================================================
   RECIPE DETAIL
   ============================================================ */
.recipe-hero {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    background: var(--hero-bg, linear-gradient(135deg, var(--accent), var(--bg))) center/cover no-repeat;
}
.recipe-hero-content { position: relative; z-index: 1; padding: 40px 20px; }
.recipe-hero-content h1 { font-size: clamp(1.6rem,3.5vw,2.4rem); color: #fff; margin: 12px 0 20px; }

.breadcrumb { font-size: .82rem; color: var(--muted); }
.breadcrumb a { color: #aaa; }
.breadcrumb a:hover { color: var(--primary); }

.recipe-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,.3);
    border-radius: 10px;
    padding: 12px 18px;
    min-width: 90px;
    text-align: center;
}
.stat-icon  { font-size: 1.4rem; margin-bottom: 4px; }
.stat-label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-val   { font-size: .95rem; font-weight: 600; color: #fff; margin-top: 2px; }

.recipe-body    { padding: 40px 20px; }
.recipe-intro   { max-width: 720px; margin-bottom: 40px; font-size: 1.05rem; line-height: 1.7; }

.recipe-columns {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 40px;
    margin-bottom: 48px;
}

/* Ingredients */
.ingredients-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    align-self: start;
    position: sticky;
    top: calc(var(--header-h) + 20px);
}
.ingredients-panel h2 { font-size: 1.1rem; margin-bottom: 16px; }

/* Servings adjuster */
.servings-adjuster {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .88rem;
}
.servings-label { color: var(--muted); flex: 1; }
.servings-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s;
    user-select: none;
}
.servings-btn:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); color: #fff; }
.servings-btn:disabled { opacity: .35; cursor: default; }
.servings-count {
    font-weight: 700;
    font-size: 1rem;
    min-width: 24px;
    text-align: center;
}
.servings-reset {
    font-size: .75rem;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: color .15s, text-decoration-color .15s;
    margin-left: 2px;
}
.servings-reset:hover { color: var(--primary); text-decoration-color: var(--primary); }
.servings-reset.hidden { visibility: hidden; }


.ingredient-list { list-style: none; }
.ingredient-list li {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.ingredient-list li:last-child { border-bottom: none; }
.ing-amount { color: var(--primary); font-weight: 600; white-space: nowrap; min-width: 70px; }

/* Shopping action buttons (below ingredient list) */
.shopping-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.shopping-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 8px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.shopping-btn:hover { background: var(--card); border-color: var(--muted); }
.shopping-btn-matspar { border-color: #007732; color: #007732; }
.shopping-btn-matspar:hover { background: #007732; color: #fff; border-color: #007732; }

/* Shopping modal */
.shopping-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.shopping-modal-overlay[hidden] { display: none; }
.shopping-modal-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,.35);
}
.shopping-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.shopping-modal-header h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.shopping-modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
}
.shopping-modal-close:hover { color: var(--text); }
.shopping-modal-intro {
    font-size: .82rem;
    color: var(--muted);
    margin: 0 0 14px;
    line-height: 1.5;
}
.shopping-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
}
.shopping-ing-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.shopping-ing-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--bg);
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
    transition: background .12s, border-color .12s;
    font-size: .875rem;
}
.shopping-ing-link:hover {
    background: var(--card);
    border-color: #007732;
    color: #007732;
}
.shopping-ing-text { font-weight: 500; }
.shopping-ing-arrow {
    font-size: .75rem;
    color: var(--muted);
    white-space: nowrap;
    margin-left: 8px;
    flex-shrink: 0;
}
.shopping-ing-link:hover .shopping-ing-arrow { color: #007732; }
.shopping-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.shopping-modal-footer .btn { flex: 1; justify-content: center; padding: 10px; }

/* Recipe main image */
.recipe-main-image-wrap {
    margin-bottom: 32px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.18);
}
.recipe-main-image {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
}

/* Instructions */
.instructions-panel h2 { font-size: 1.1rem; margin-bottom: 24px; }
.instruction-list { list-style: none; display: flex; flex-direction: column; gap: 20px; }
.instruction-list li {
    display: flex;
    gap: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}
.step-number {
    flex-shrink: 0;
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    color: #fff;
}
.step-text { line-height: 1.6; padding-top: 6px; }

/* Drink pairings */
/* ============================================================
   DRINK PAIRINGS – recipe-card-style layout
   ============================================================ */
.drink-pairings {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 28px 32px;
    margin-top: 16px;
}
.drink-pairings > h2 {
    font-size: 1.2rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.drink-intro {
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: 22px;
    margin-top: 4px;
}

/* Searched drink banner */
.drink-searched-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.drink-searched-info { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drink-searched-sub  { color: var(--muted); font-size: .85rem; }

/* Type section */
.drink-type-section { margin-bottom: 24px; }
.drink-type-section:last-child { margin-bottom: 0; }
.drink-type-heading {
    font-size: .75rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Card grid – 3 per row, smaller than recipe cards */
.drink-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

/* Individual drink card – mirrors recipe-card */
.drink-item-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.drink-item-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.drink-item-card.drink-item-popular { border-color: var(--primary); }

/* Image area */
.drink-item-img {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #f0ede8;
}
[data-theme="dark"] .drink-item-img { background: #1c1e2e; }

.drink-item-img img {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform .3s ease;
}
.drink-item-card:hover .drink-item-img img { transform: scale(1.04); }

.drink-item-img-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    opacity: .35;
}
.drink-img-error img { display: none; }
.drink-img-error::after {
    content: '🍶';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    opacity: .3;
}

/* Tier badge on image */
.drink-item-badge {
    position: absolute;
    top: 7px; left: 7px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.drink-badge-budget  { background: rgba(74,222,128,.85); color: #052e16; }
.drink-badge-mid     { background: rgba(129,140,248,.85); color: #1e1b4b; }
.drink-badge-premium { background: rgba(251,191,36,.9);  color: #451a03; }

.drink-item-popular-tag {
    position: absolute;
    top: 7px; right: 7px;
    background: var(--primary);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
}

/* Card body */
.drink-item-body {
    padding: 11px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.drink-item-name {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.drink-item-price {
    font-size: .78rem;
    color: var(--muted);
    margin-top: auto;
    padding-top: 4px;
}
.drink-item-body .btn-systembolaget {
    display: block;
    text-align: center;
    font-size: .78rem;
    padding: 8px 10px;
    margin-top: 6px;
}

/* ============================================================
   PAGE HEADER (category / search)
   ============================================================ */
.page-header {
    padding: 40px 0 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
}
.page-header h1 { font-size: 2rem; margin-bottom: 8px; }
.page-header p  { color: var(--muted); }
.page-header em { color: var(--primary); font-style: normal; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--card);
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
}
.footer-brand .logo-icon { font-size: 2rem; }
.footer-brand .logo-text { font-size: 1.3rem; font-weight: 700; display: block; margin: 8px 0 4px; }
[data-theme="dark"] .footer-brand .logo-text { color: #fff; }
.footer-brand p   { color: var(--muted); font-size: .85rem; }
.footer-links h4  { font-size: .9rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 16px; }
.footer-links ul  { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a   { color: var(--text); font-size: .88rem; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); text-align: center; padding: 20px; font-size: .8rem; color: var(--muted); }
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--primary); }

/* ============================================================
   COOKIE CONSENT BANNER
   ============================================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    z-index: 999;
    background: var(--card);
    border-top: 2px solid var(--primary);
    box-shadow: 0 -4px 32px rgba(0,0,0,.3);
    animation: slideUp .3s ease;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}
.cookie-text { flex: 1; min-width: 280px; }
.cookie-text strong { display: block; margin-bottom: 4px; font-size: .95rem; }
.cookie-text p { font-size: .83rem; color: var(--muted); line-height: 1.5; }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100vh - var(--header-h));
}
.admin-sidebar {
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
}
.admin-sidebar h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 10px; padding: 0 14px; }
.admin-sidebar ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar a {
    display: block;
    padding: 9px 14px;
    border-radius: 6px;
    color: var(--text);
    font-size: .86rem;
    text-decoration: none;
    transition: background var(--transition);
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: var(--accent);
    color: var(--primary);
}
[data-theme="dark"] .admin-sidebar a:hover,
[data-theme="dark"] .admin-sidebar a.active { color: #fff; }

.admin-content { padding: 36px 40px; }
.admin-content h1 { font-size: 1.6rem; margin-bottom: 24px; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--accent);
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .08em;
}
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
.admin-table tr:hover td { background: rgba(255,255,255,.03); }

.admin-actions { display: flex; gap: 8px; }
.btn-sm { padding: 6px 14px; font-size: .78rem; }
.btn-danger { background: #7f1d1d; color: #fca5a5; }
.btn-danger:hover { background: #991b1b; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label,
.form-group label {
    display: block;
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 500;
}
.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-size: .9rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}
.form-control:focus  { border-color: var(--primary); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control  { appearance: auto; }

.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-hint  { font-size: .75rem; color: var(--muted); margin-top: 4px; }

.alert { padding: 12px 18px; border-radius: 8px; margin-bottom: 20px; font-size: .88rem; }
.alert-success { background: #1a4731; color: #4ade80; border: 1px solid #166534; }
.alert-error   { background: #3b0f0f; color: #f87171; border: 1px solid #7f1d1d; }
[data-theme="light"] .alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
[data-theme="light"] .alert-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* Dynamic rows */
.dynamic-group {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}
.remove-row {
    position: absolute;
    top: 12px; right: 12px;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}
.remove-row:hover { color: var(--primary); }
.add-row-btn {
    background: var(--accent);
    color: var(--text);
    border: 1px dashed var(--border);
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    font-family: inherit;
    transition: background var(--transition);
}
.add-row-btn:hover { background: var(--primary); color: #fff; border-style: solid; }

/* ============================================================
   TRANSLATIONS ADMIN TABLE
   ============================================================ */
.trans-group { margin-bottom: 40px; }
.trans-group-title {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--primary);
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}
.trans-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.trans-header, .trans-row {
    display: grid;
    grid-template-columns: 220px 1fr 1fr;
    gap: 0;
}
.trans-header {
    background: var(--accent);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}
.trans-header > div { padding: 10px 14px; }
.trans-row { border-top: 1px solid var(--border); }
.trans-row:hover { background: rgba(255,255,255,.02); }
.trans-row > div { padding: 8px 8px; }
.trans-row > div:first-child { padding: 12px 14px; display: flex; align-items: flex-start; }
.trans-key code {
    font-size: .75rem;
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--muted);
    word-break: break-all;
}
.trans-input { font-size: .82rem; padding: 7px 10px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .recipe-grid   { grid-template-columns: repeat(2,1fr); }
    .footer-inner  { grid-template-columns: 1fr 1fr; }
    .footer-brand  { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--header-h));
        background: var(--card);
        padding: 24px 20px;
        z-index: 99;
        overflow-y: auto;
        border-top: 1px solid var(--border);
        box-shadow: 0 8px 24px rgba(0,0,0,.3);
    }
    .main-nav.open { display: block; }
    .main-nav ul   { flex-direction: column; gap: 4px; }
    .main-nav a    { padding: 12px 16px; font-size: 1rem; }
    .hamburger     { display: flex; }

    .header-controls { gap: 6px; }
    /* On mobile: hide the top-row CTAs, show them in the hamburger menu instead */
    .header-cta-group { display: none; }
    .nav-all-recipes-mobile { display: list-item; }
    .nav-drink-match-mobile { display: list-item; }

    .hero-content    { padding: 40px 20px; }
    .recipe-columns  { grid-template-columns: 1fr; }
    .recipe-main-image { height: 240px; }
    .ingredients-panel { position: static; }
    .admin-layout    { grid-template-columns: 1fr; }
    .admin-sidebar   { display: none; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .recipe-stats    { gap: 12px; }
    .stat            { min-width: 72px; padding: 10px 12px; }
    .trans-header, .trans-row { grid-template-columns: 1fr; }
    .trans-header > div:not(:first-child),
    .trans-row > div:first-child { display: none; }
}

@media (max-width: 560px) {
    .recipe-grid   { grid-template-columns: 1fr; }
    .footer-inner  { grid-template-columns: 1fr; gap: 24px; }
    .drink-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .hero          { min-height: 380px; }
    .cookie-banner-inner { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   DRINK-PAIRING SEARCH PAGE
   ============================================================ */

.page-subtitle {
    color: var(--muted);
    font-size: 1.05rem;
    margin-top: 8px;
    max-width: 680px;
}
.page-subtitle a { color: var(--primary); }

/* Search form */
.drink-search-form {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 36px;
    box-shadow: var(--shadow);
}

.drink-search-input-wrap {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.drink-search-input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
.drink-search-input:focus { border-color: var(--primary); }
.drink-search-input::placeholder { color: var(--muted); }

.drink-search-btn { border-radius: 10px; padding: 14px 28px; white-space: nowrap; }

/* Search result meta line */
.drink-search-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--card);
    border-left: 4px solid var(--primary);
    border-radius: 0 10px 10px 0;
    margin-bottom: 8px;
}
.drink-label {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}
.drink-search-terms {
    color: var(--muted);
    font-size: .9rem;
}
.drink-search-terms a { color: var(--primary); }

/* Source badge on recipe cards */
.source-badge {
    background: #0057A3 !important;   /* Systembolaget-ish blue */
    color: #fff !important;
}
.koket-card .card-meta { margin-top: 8px; }
.source-link {
    color: var(--primary);
    font-size: .82rem;
    text-decoration: none;
}
.source-link:hover { text-decoration: underline; }

.card-img-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: var(--accent);
}

/* How it works / examples */
.drink-search-examples { margin-top: 48px; }
.drink-search-examples h2 { font-size: 1.4rem; margin-bottom: 16px; }
.drink-search-examples h3 { font-size: 1rem; margin: 28px 0 12px; color: var(--muted); }

.how-it-works {
    padding-left: 24px;
    color: var(--muted);
    line-height: 1.9;
}
.how-it-works a { color: var(--primary); }

.example-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.example-chip {
    display: inline-block;
    padding: 8px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-size: .9rem;
    transition: background .2s, border-color .2s;
}
.example-chip:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ============================================================
   SOURCE ATTRIBUTION – koket-recipe.php
   ============================================================ */

/* Top sticky banner */
.source-attribution-banner {
    background: #0057A3;
    color: #fff;
    padding: 10px 0;
    font-size: .88rem;
    position: sticky;
    top: 0;
    z-index: 90;
}
.source-attribution-banner .container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.source-attr-label { font-weight: 600; opacity: .9; }
.source-attr-link {
    color: #fff;
    word-break: break-all;
    opacity: .85;
}
.source-attr-link:hover { opacity: 1; text-decoration: underline; }
.source-attr-site { margin-left: auto; opacity: .8; }

/* Stat source link */
.stat-source a { color: #fff; text-decoration: underline; font-size: .9rem; }

/* Source brand attribution box */
.source-brand-box {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 48px;
    padding: 22px 26px;
    border-radius: 14px;
    border: 1px solid var(--border);
    border-left: 5px solid var(--sc, var(--primary));
    background: color-mix(in srgb, var(--sc, var(--primary)) 7%, var(--card));
}
.source-brand-logo-wrap {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.09);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.source-brand-favicon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}
.source-brand-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.source-brand-eyebrow {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
}
.source-brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--sc, var(--primary));
    line-height: 1.2;
}
.source-brand-desc {
    font-size: .8rem;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.45;
}
.source-brand-cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 11px 20px;
    border-radius: 9px;
    background: var(--sc, var(--primary));
    color: var(--sc-text, #fff);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .15s, transform .15s;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.source-brand-cta:hover { opacity: .88; transform: translateY(-1px); color: var(--sc-text, #fff); text-decoration: none; }

/* Favicon in sticky banner */
.source-banner-favicon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}

.alert-info {
    background: rgba(0, 87, 163, .15);
    border-left: 4px solid #0057A3;
    border-radius: 8px;
    padding: 16px 20px;
    color: var(--text);
}

/* ============================================================
   SEARCHED DRINK CARD (highlighted, "Din sökning")
   ============================================================ */
.drink-card-searched {
    border: 2px solid var(--primary);
    background: linear-gradient(135deg, rgba(233,69,96,.08) 0%, var(--card) 100%);
    position: relative;
}
.drink-card-header { display: flex; flex-direction: column; gap: 6px; }
.drink-searched-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    width: fit-content;
}
.drink-searched-note {
    font-size: .85rem;
    color: var(--muted);
    line-height: 1.6;
    flex: 1;
}

@media (max-width: 640px) {
    .drink-search-input-wrap { flex-direction: column; }
    .drink-search-btn { width: 100%; }
    .source-attr-site { display: none; }
    .source-attr-content { flex-direction: column; gap: 12px; }
    .source-brand-box { flex-wrap: wrap; gap: 14px; }
    .source-brand-cta { width: 100%; justify-content: center; }
}

/* ============================================================
   DISH TYPE TILES – drink-pairing-search.php results
   ============================================================ */
.dish-type-section { margin-top: 40px; }

.dish-type-heading {
    font-size: 1.4rem;
    margin-bottom: 6px;
}
.dish-type-subheading {
    color: var(--muted);
    font-size: .93rem;
    margin-bottom: 28px;
}

.dish-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

.dish-type-tile {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: flex-end;
    text-decoration: none;
    cursor: pointer;
    transition: transform .22s ease, box-shadow .22s ease;
    box-shadow: var(--shadow);
    background: var(--card) var(--tile-bg, none) center/cover no-repeat;
}
.dish-type-tile:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 36px rgba(0,0,0,.5);
    text-decoration: none;
}

.dish-tile-no-img {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: var(--card);
}

.dish-tile-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.18) 60%, transparent 100%);
    transition: background .22s;
}
.dish-type-tile:hover .dish-tile-overlay {
    background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.3) 60%, rgba(0,0,0,.05) 100%);
}

.dish-tile-content {
    position: relative;
    z-index: 2;
    padding: 14px 14px 36px;
    width: 100%;
}
.dish-tile-label {
    display: block;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,.8);
    line-height: 1.3;
}
.dish-tile-count {
    display: block;
    color: rgba(255,255,255,.75);
    font-size: .78rem;
    margin-top: 3px;
    text-shadow: 0 1px 4px rgba(0,0,0,.8);
}

.dish-tile-source {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 2;
    background: rgba(0,0,0,.65);
    color: rgba(255,255,255,.85);
    font-size: .68rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ============================================================
   DISH TYPE HERO – dish-type-recipes.php
   ============================================================ */
.dish-type-hero {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: flex-end;
    background: var(--card) var(--hero-bg, none) center/cover no-repeat;
}
.dish-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 60%, rgba(0,0,0,.1) 100%);
}
.dish-hero-content {
    position: relative;
    z-index: 2;
    padding: 40px 20px;
}
.dish-hero-content h1 {
    font-size: 2rem;
    color: #fff;
    margin: 8px 0 4px;
}
.dish-hero-subtitle {
    color: rgba(255,255,255,.8);
    font-size: 1rem;
    margin: 0;
}

/* Source note */
.source-note {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,87,163,.12);
    border-left: 4px solid #0057A3;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: .9rem;
    color: var(--text);
    margin-top: 8px;
}
.source-note-icon { font-size: 1.2rem; flex-shrink: 0; }
.source-note a { color: #0057A3; }
[data-theme="dark"] .source-note a { color: #5aabff; }

@media (max-width: 640px) {
    .dish-type-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .dish-type-tile { aspect-ratio: 1 / 1; }
    .dish-tile-label { font-size: .9rem; }
    .dish-hero-content h1 { font-size: 1.5rem; }
    .dish-type-hero { min-height: 220px; }
}

/* ============================================================
   KATEGORI – TVÅKOLUMNS LAYOUT (filter + recept)
   ============================================================ */
.category-page-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    align-items: start;
    padding-bottom: 60px;
}
.category-page-layout.no-sidebar {
    grid-template-columns: 1fr;
}

/* ── Filtersidebar ────────────────────────────────────────── */
.filter-sidebar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: calc(var(--header-h) + 16px);
    max-height: calc(100vh - var(--header-h) - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.filter-sidebar::-webkit-scrollbar { width: 4px; }
.filter-sidebar::-webkit-scrollbar-track { background: transparent; }
.filter-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.filter-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.filter-title {
    font-size: .95rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}
[data-theme="dark"] .filter-title { color: #fff; }

.filter-clear-btn {
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.filter-clear-btn:hover {
    background: var(--primary);
    color: #fff;
}

.filter-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-section-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    margin-bottom: 10px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition);
    font-size: .86rem;
    line-height: 1.3;
}
.filter-option:hover { background: var(--accent); }

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}

.filter-label {
    flex: 1;
    color: var(--text);
}

.filter-count {
    font-size: .72rem;
    color: var(--muted);
    background: var(--accent);
    border-radius: 20px;
    padding: 1px 7px;
    flex-shrink: 0;
}

.filter-option input:checked + .filter-label { color: var(--primary); font-weight: 600; }
[data-theme="dark"] .filter-option input:checked + .filter-label { color: #fff; }

/* ── Recepthuvudkolumn ─────────────────────────────────────── */
.category-main { min-width: 0; }

/* Mobilfilterknapp */
.filter-toggle-mobile {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 16px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    margin-bottom: 16px;
    transition: border-color var(--transition);
}
.filter-toggle-mobile:hover { border-color: var(--primary); }

.filter-badge {
    background: var(--primary);
    color: #fff;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
}

/* ── Statusrad ─────────────────────────────────────────────── */
.recipe-grid-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    font-size: .85rem;
    color: var(--muted);
    min-height: 28px;
}

.active-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(233,69,96,.12);
    border: 1px solid rgba(233,69,96,.3);
    color: var(--primary);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: .75rem;
    font-weight: 600;
}
.filter-chip button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: .9rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
}
.filter-chip button:hover { color: #c0334f; }

/* ── Prisfilter ──────────────────────────────────────────── */
.price-slider-wrap {
    position: relative;
    height: 32px;
    margin-bottom: 12px;
}
.price-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    pointer-events: none;
}
.price-track-fill {
    position: absolute;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}
.price-slider {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    cursor: pointer;
    outline: none;
}
.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--card);
    box-shadow: 0 1px 6px rgba(0,0,0,.35);
    pointer-events: auto;
    cursor: grab;
    transition: transform .1s;
}
.price-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.2) translateY(0); }
.price-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--card);
    box-shadow: 0 1px 6px rgba(0,0,0,.35);
    pointer-events: auto;
    cursor: grab;
}

.price-range-inputs {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 8px;
}

.price-input-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.price-label {
    font-size: .72rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.price-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    font-size: .85rem;
    font-family: inherit;
    -moz-appearance: textfield;
}
.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.price-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(233,69,96,.15);
}

.price-separator {
    color: var(--muted);
    font-size: .9rem;
    padding-bottom: 8px;
    flex-shrink: 0;
}

.price-range-hint {
    font-size: .72rem;
    color: var(--muted);
    margin: 0;
}

/* ── Loading overlay ─────────────────────────────────────── */
.recipe-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    color: var(--muted);
    font-size: .9rem;
}
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tomt resultat */
.no-results-msg {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}
.no-results-msg .no-results-icon { font-size: 3rem; margin-bottom: 16px; }
.no-results-msg p { font-size: .95rem; margin-bottom: 16px; }

/* ============================================================
   STARTSIDA – POPULÄRA DRYCKER
   ============================================================ */
.section-alt { background: rgba(255,255,255,.02); }
[data-theme="light"] .section-alt { background: rgba(0,0,0,.02); }

.drink-popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.drink-popular-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}
.drink-popular-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.drink-popular-img {
    position: relative;
    background: var(--accent);
    aspect-ratio: 3/4;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.drink-popular-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform var(--transition);
}
.drink-popular-card:hover .drink-popular-img img { transform: scale(1.04); }
.drink-popular-img-placeholder {
    font-size: 3rem;
    opacity: .4;
}
.drink-popular-img.drink-img-error {
    background: var(--accent);
}
.drink-popular-img.drink-img-error::after {
    content: '🍶';
    font-size: 3rem;
    opacity: .4;
}

.drink-popular-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.drink-popular-type {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}
.drink-popular-name {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.drink-popular-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}
.drink-popular-recipe {
    font-size: .78rem;
    color: var(--muted);
    margin-top: auto;
    padding-top: 6px;
}
.drink-popular-recipe a {
    color: var(--text);
    text-decoration: none;
}
.drink-popular-recipe a:hover { color: var(--primary); }

/* Visnings-badge på receptkort */
.card-views-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* btn-sm variant */
.btn-sm {
    font-size: .78rem;
    padding: 6px 12px;
}

@media (max-width: 640px) {
    .drink-popular-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ============================================================
   PAGINERING
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    line-height: 1;
}
.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
    pointer-events: none;
}
.page-btn-nav {
    font-size: 1.1rem;
    font-weight: 700;
}

.page-ellipsis {
    color: var(--muted);
    font-size: .9rem;
    padding: 0 4px;
    display: flex;
    align-items: center;
    height: 38px;
}

/* ============================================================
   RESPONSIV – filter
   ============================================================ */
@media (max-width: 900px) {
    .category-page-layout {
        grid-template-columns: 220px 1fr;
        gap: 20px;
    }
}

@media (max-width: 700px) {
    .category-page-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        display: none; /* dold tills mobilknapp togglas */
    }
    .filter-sidebar.mobile-open {
        display: block;
        margin-bottom: 20px;
    }

    .filter-toggle-mobile { display: flex; }
}

/* ── Redigerbara ytor ─────────────────────────────────────────────── */
.section-content-block { padding: 32px 0 0; }

.content-block {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 32px;
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.content-block-img {
    max-width: 280px;
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.content-block-text {
    flex: 1;
    line-height: 1.7;
    font-size: .97rem;
}

.content-block-text h2 { font-size: 1.35rem; margin: 0 0 12px; }
.content-block-text h3 { font-size: 1.1rem;  margin: 16px 0 8px; }
.content-block-text p  { margin: 0 0 12px; }
.content-block-text p:last-child { margin-bottom: 0; }
.content-block-text ul,
.content-block-text ol { padding-left: 20px; margin: 0 0 12px; }
.content-block-text a  { color: var(--accent); }
.content-block-text blockquote {
    border-left: 3px solid var(--accent);
    margin: 12px 0;
    padding: 8px 16px;
    color: var(--muted);
    font-style: italic;
}

/* Utan bild: full bredd */
.content-block:not(:has(.content-block-img)) .content-block-text { max-width: 100%; }

@media (max-width: 640px) {
    .content-block { flex-direction: column; padding: 20px; }
    .content-block-img { max-width: 100%; }
}
