/**
 * UAorganic — Catalog page styles (archive-microgreen.php)
 * Extracted from design/catalog.html <style> block.
 */

/* ═══════════════════════════════════════════════════════
   CATALOG HERO
═══════════════════════════════════════════════════════ */
.cat-hero {
    background: var(--gradient-hero);
    padding: 24px 0 0;
    position: relative;
    overflow: hidden;
}

.cat-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.cat-hero::after {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(34,197,94,0.13) 0%, transparent 70%);
    pointer-events: none;
}

.cat-hero .container { position: relative; z-index: 1; }

/* Breadcrumb */
.cat-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 8px;
}

.cat-breadcrumb a {
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    transition: color 150ms ease;
}

.cat-breadcrumb a:hover { color: rgba(255,255,255,0.8); }

.cat-breadcrumb svg { width: 14px; height: 14px; color: rgba(255,255,255,0.2); }

.cat-breadcrumb__current { color: rgba(255,255,255,0.7); }

/* Hero grid: 2 cols × 2 rows
   col1 row1 = title  |  col2 row1 = meta stats
   col1 row2 = search |  col2 row2 = seeding button   */
.cat-hero__top {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 24px;
    row-gap: 10px;
    margin-bottom: 20px;
}

.cat-hero__title {
    grid-column: 1; grid-row: 1;
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.05;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.cat-hero__title span { color: #4ade80; }

.cat-hero__meta {
    grid-column: 2; grid-row: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.cat-hero__top > .cat-search { grid-column: 1; grid-row: 2; margin-bottom: 0; }

.cat-hero__bottom {
    grid-column: 2; grid-row: 2;
    align-self: center;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-toggle--hero { display: none !important; }

.cat-seeding-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: #f97316;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    transition: background 150ms ease;
    white-space: nowrap;
}

.cat-seeding-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.cat-seeding-btn:hover { background: #ea580c; color: #fff; }

.cat-meta-item { text-align: right; }

.cat-meta-item__num {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.cat-meta-item__label {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
}

.cat-meta-sep {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,0.12);
}

/* Search bar */
.cat-search {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.16);
    border-radius: 100px;
    padding: 6px 6px 6px 20px;
    gap: 12px;
    max-width: 560px;
    transition: all 200ms ease;
    backdrop-filter: blur(8px);
    margin-bottom: 32px;
}

.cat-search:focus-within {
    border-color: rgba(255,255,255,0.38);
    background: rgba(255,255,255,0.13);
}

.cat-search svg { width: 17px; height: 17px; color: rgba(255,255,255,0.45); flex-shrink: 0; }

.cat-search input {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-family: var(--font-body);
    flex: 1;
    outline: none;
    min-width: 0;
}

.cat-search input::placeholder { color: rgba(255,255,255,0.38); }

.cat-search__btn {
    flex-shrink: 0;
    background: var(--color-cta);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: background 150ms ease;
    letter-spacing: 0.01em;
}

.cat-search__btn:hover { background: var(--color-cta-hover); }

/* Filter bar wrapper — continues green hero background */
.cat-filterbar-wrap {
    background: var(--gradient-hero);
    padding-bottom: 0;
}

/* Filter bar — tabs + sort/view on green hero background */
.cat-filterbar {
    display: flex;
    align-items: center;
    gap: 12px;
    /* no flex-wrap: tabs scroll horizontally, right side stays fixed */
}

.cat-filterbar .cat-tabs {
    flex: 1;
    min-width: 0;
}

.cat-filterbar__right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding-bottom: 4px; /* align with tabs bottom border */
}

/* Override old .sort-select (white bg) for filterbar context */
.cat-filterbar__right .sort-select {
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.12) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    color: #fff !important;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-family: var(--font-body);
    cursor: pointer;
    outline: none;
}

.cat-filterbar__right .sort-select option {
    background: #14532d;
    color: #fff;
}

/* Filterbar view-toggle */
.cat-filterbar__right .view-toggle {
    display: flex;
    gap: 2px;
    border: none !important;
    border-radius: 0;
    overflow: visible;
}

/* Hero view-toggle (mobile duplicate) — layout only, display controlled separately */
.view-toggle--hero {
    gap: 2px;
    border: none;
    overflow: visible;
}

.cat-filterbar__right .view-btn,
.view-toggle--hero .view-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0 !important;
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 8px !important;
    color: rgba(255,255,255,0.6) !important;
    cursor: pointer;
    transition: background 150ms, color 150ms;
}

.cat-filterbar__right .view-btn svg,
.view-toggle--hero .view-btn svg { width: 16px; height: 16px; }

.cat-filterbar__right .view-btn:hover,
.view-toggle--hero .view-btn:hover { background: rgba(255,255,255,0.18) !important; color: #fff !important; }

.cat-filterbar__right .view-btn.active,
.view-toggle--hero .view-btn.active { background: rgba(255,255,255,0.18) !important; color: #fff !important; border-color: rgba(255,255,255,0.35) !important; }

/* Category tabs */
.cat-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
}

.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 12px 12px 0 0;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    border: none;
    background: transparent;
    white-space: nowrap;
    transition: all 150ms ease;
    letter-spacing: 0.01em;
    border-bottom: 2px solid transparent;
    text-decoration: none;
}

.cat-tab:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.06); }

.cat-tab.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-bottom-color: #4ade80;
}

.cat-tab__count {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 100px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.55);
    line-height: 1;
}

.cat-tab.active .cat-tab__count {
    background: rgba(74,222,128,0.2);
    color: #4ade80;
}


/* ═══════════════════════════════════════════════════════
   FILTERBAR CONTROLS (sort-select, view-toggle)
═══════════════════════════════════════════════════════ */

.sort-select {
    padding: 7px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--r-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 13px;
    font-family: var(--font-body);
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: border-color 150ms ease;
}

.sort-select:focus { border-color: var(--color-primary); }

.view-toggle {
    display: flex;
    border: 1.5px solid var(--color-border);
    border-radius: var(--r-md);
    overflow: hidden;
}

.view-btn {
    padding: 7px 10px;
    background: var(--color-surface);
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: all 150ms ease;
    display: flex;
    align-items: center;
}

.view-btn svg { width: 16px; height: 16px; }

.view-btn.active { background: var(--color-primary); color: #fff; }

.view-btn:not(.active):hover { background: var(--green-50); color: var(--color-primary); }


/* ═══════════════════════════════════════════════════════
   CATALOG GRID
═══════════════════════════════════════════════════════ */
.catalog-section { padding: 36px 0 80px; }

/* Light background for the cards area */
#main { background: #f8faf8; }

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    align-items: stretch;
}

@media (max-width: 1024px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .catalog-grid { grid-template-columns: 1fr; } }

/* ── Compact view (4 columns, photo + title only) ── */
.catalog-grid--compact {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.catalog-grid--compact .card__body { display: none; }
.catalog-grid--compact .card__photo { height: 160px; }
.catalog-grid--compact .card:hover { transform: translateY(-4px); }
.catalog-grid--compact .card__photo::after {
    background: linear-gradient(to bottom, transparent 10%, rgba(10,30,15,0.88) 100%);
}
.catalog-grid--compact .card__name {
    font-size: 0.85rem;
    padding: 8px 10px 10px;
    line-height: 1.3;
}

@media (max-width: 1100px) { .catalog-grid--compact { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px)  { .catalog-grid--compact { grid-template-columns: repeat(2, 1fr); } }


/* ═══════════════════════════════════════════════════════
   CULTURE CARD
═══════════════════════════════════════════════════════ */
.card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 1px 2px rgba(21,128,61,0.04),
        0 4px 16px rgba(21,128,61,0.08);
    transition: box-shadow 220ms ease, transform 220ms ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    box-shadow:
        0 2px 4px rgba(21,128,61,0.06),
        0 16px 48px rgba(21,128,61,0.14);
    transform: translateY(-6px);
}

/* ─── Photo ─── */
.card__photo {
    position: relative;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.card__photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 400ms ease;
}

.card:hover .card__photo img { transform: scale(1.05); }

.card__photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 35%, rgba(10,30,15,0.72) 100%);
    pointer-events: none;
}

.card__photo--placeholder {
    width: 100%; height: 100%;
    background: var(--green-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    color: var(--green-300);
}

.card__name {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 1;
    padding: 14px 18px 16px;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* Category badge — solid white pill */
.card__cat {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 1;
    background: #ffffff;
    border-radius: 100px;
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #15803d;
    padding: 5px 11px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* ─── Body ─── */
.card__body {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

/* Flavor tags */
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; }

.ftag {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 4px 11px;
    border-radius: 100px;
    line-height: 1;
}

.ftag--spicy   { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.ftag--sweet   { background: #fefce8; color: #a16207; border: 1px solid #fef08a; }
.ftag--nutty   { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.ftag--fresh   { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.ftag--neutral { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
.ftag--citrus  { background: #fefce8; color: #a16207; border: 1px solid #fef08a; }
.ftag--pungent { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.ftag--earthy  { background: #f5f0ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.ftag--minty   { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* Intensity — one line: label | track | score */
.intensity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.intensity__label {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.intensity__score {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.intensity__track {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 100px;
    overflow: hidden;
}

.intensity__fill {
    height: 100%;
    border-radius: 100px;
}

.intensity__fill--low    { background: linear-gradient(90deg, #86efac, #4ade80); }
.intensity__fill--medium { background: linear-gradient(90deg, #4ade80, #16a34a); }
.intensity__fill--high   { background: linear-gradient(90deg, #16a34a, #14532d); }

/* Divider */
.card__sep { border: none; border-top: 1px solid #f1f5f9; margin: 0; }

/* Section label */
.sec-lbl {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #94a3b8;
    margin-bottom: 7px;
}

/* Taste description */
.card__taste {
    font-size: 13px;
    line-height: 1.55;
    color: #475569;
}

/* Texture — chips */
.textures { display: flex; gap: 6px; flex-wrap: wrap; }

.tex-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 10px;
    line-height: 1;
}

.tex-chip svg { width: 12px; height: 12px; color: #94a3b8; flex-shrink: 0; }

/* Pairs */
.pairs { display: flex; flex-wrap: wrap; gap: 5px; }

.pair {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 10px;
}

/* Similar */
.similar { font-size: 12.5px; color: #64748b; line-height: 1.5; }

.similar a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 150ms ease;
}

.similar a:hover { border-bottom-color: var(--color-primary); }

/* CTA */
.card__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 150ms ease;
    margin-top: auto;
}

.card__cta svg { width: 15px; height: 15px; transition: transform 200ms ease; }

.card__cta:hover { background: #15803d; color: #fff; }
.card__cta:hover svg { transform: translateX(3px); }


/* ═══════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════ */
.load-more-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-top: 48px;
    padding-bottom: 16px;
}

.load-more-row__progress { width: 100%; max-width: 320px; }

.load-more-row__track {
    height: 4px;
    background: var(--color-border-soft, #e2e8f0);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}

.load-more-row__fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #16a34a);
    border-radius: 100px;
    transition: width 400ms ease;
}

.load-more-row__text {
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted, #64748b);
    margin: 0;
}

.cat-pagination__links span.current {
    background: var(--color-primary);
    color: #fff;
    border: 1.5px solid var(--color-primary);
}

.cat-pagination__links span.dots {
    border: none;
    color: var(--color-text-muted);
}


/* ═══════════════════════════════════════════════════════
   RESPONSIVE + REDUCED MOTION
═══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .card, .card__photo img, .card__cta svg { transition: none; }
    .card:hover { transform: none; }
    .card:hover .card__photo img { transform: none; }
}

/* ─── 768px: планшет / великий телефон ─── */
@media (max-width: 768px) {
    .cat-hero { padding-top: 24px; }

    /* Hero grid → 1 колонка, правильний порядок */
    .cat-hero__top {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        row-gap: 14px;
        column-gap: 0;
        margin-bottom: 16px;
    }
    .cat-hero__title           { grid-column: 1; grid-row: 1; white-space: normal; }
    .cat-hero__meta            { grid-column: 1; grid-row: 2; justify-content: flex-start; gap: 12px; }
    .cat-hero__top > .cat-search { grid-column: 1; grid-row: 3; width: 100%; max-width: 100%; margin-bottom: 0; }
    .cat-hero__bottom          { grid-column: 1; grid-row: 4; width: 100%; justify-content: space-between; }
    .view-toggle--hero         { display: flex !important; }

    /* Мета-статистика: ліво */
    .cat-meta-item { text-align: left; }

    /* Filterbar: sticky при скролі */
    .cat-filterbar-wrap { position: sticky; top: 0; z-index: 90; }

    /* Filterbar: тільки таби, без sort і view-toggle */
    .cat-filterbar { flex-wrap: wrap; gap: 0; }
    .cat-filterbar .cat-tabs   { width: 100%; order: 1; }
    .cat-filterbar__right      { display: none; }

    /* Сітка карток */
    .catalog-grid { gap: 16px; }
    .catalog-section { padding: 24px 0 56px; }
}

/* ─── 480px: малий телефон ─── */
@media (max-width: 480px) {
    /* Статистику ховаємо — залишаємо місце для заголовка і пошуку */
    .cat-hero__meta { display: none; }

    /* Кнопка норм висадки — коротший текст через CSS не виходить,
       але вона перенесеться на новий рядок нормально */
    .cat-seeding-btn { font-size: 12px; padding: 8px 12px; }

    /* Таби категорій — менший відступ */
    .cat-tab { padding: 9px 12px; font-size: 12px; }
}

/* ─── Touch-пристрої: прибираємо hover-ефекти ─── */
@media (hover: none) {
    .card:hover {
        transform: none;
        box-shadow: 0 1px 2px rgba(21,128,61,0.04), 0 4px 16px rgba(21,128,61,0.08);
    }
    .card:hover .card__photo img { transform: none; }
    .card:active { transform: scale(0.98); transition: transform 100ms ease; }
}
