/* ============================================================
   CATEGORY PAGE — figurydeco.pl mockup `kategoria.html`.
   Sections: cat-lead, cat-filters (chips + sort), prod-grid--cat,
     pagination, cat-desc (show-more), faq, cat-seo (link cloud),
     container queries (doc 2.8).
   Page deferred-loaded by layouts/default.inc.php.
   ============================================================ */

/* --- Breadcrumb --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 22px 0 0;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--ink-3);
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--ink-2); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--accent); opacity: 1; }
.breadcrumb__sep { color: var(--ink-3); opacity: .6; }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 500; }

/* --- Cat lead --- */
.cat-lead {
    background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
    padding: 0 0 40px; /* zero top: a global section{padding:100px 0} (port artifact, not in the mockup) was inflating this hero by 100px */
    border-bottom: 1px solid var(--line);
}
.cat-lead__inner {
    max-width: 880px;
    margin: 0 auto;
    text-align: center;
    padding: 32px 0 12px;
}
.cat-lead__title {
    font-family: var(--serif);
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1.04;
    margin: 6px 0 18px;
    color: var(--ink);
    font-weight: 500;
}
.cat-lead__title em {
    font-style: italic;
    color: var(--accent);
    position: relative;
}
.cat-lead__title em::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 4px;
    height: 8px;
    background: rgba(147,173,63,.22);
    z-index: -1;
}
.cat-lead__intro {
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink-2);
    margin: 0 auto;
    max-width: 720px;
}

/* --- Filters bar --- */
.cat-filters {
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(8px);
    padding: 0; /* zero the inherited global section{padding:100px 0} (port artifact) — the .filters bar carries its own 18px; mockup keeps this band compact */
}
.filters {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.filters__chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
    min-width: 0;
}
/* Style LiteCart's box_filter form to fit chip aesthetic */
#box-filter form[name="filter_form"] {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
}
#box-filter .tokens {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
#box-filter .tokens .token,
#box-filter .tokens > * {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    border: 1px solid var(--accent);
    border-radius: 999px;
    font-size: 12px;
}
#box-filter input[type="text"],
#box-filter input[type="number"],
#box-filter select {
    padding: 8px 14px;
    border: 1px solid var(--line-2);
    background: #fff;
    border-radius: 999px;
    font-size: 13px;
    color: var(--ink);
    font-family: inherit;
}
#box-filter input[type="submit"],
#box-filter button:not(.chip__btn) {
    padding: 9px 16px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
#box-filter input[type="submit"]:hover,
#box-filter button:not(.chip__btn):hover { background: var(--accent); border-color: var(--accent); }

.filters__sort { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.filters__count { font-size: 13px; color: var(--ink-2); }
.filters__count strong { color: var(--ink); font-weight: 600; }
.sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-2);
}
.sort select {
    border: 1px solid var(--line-2);
    background: #fff;
    padding: 9px 32px 9px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-family: inherit;
    color: var(--ink);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12' fill='none' stroke='%23333' stroke-width='2'><path d='M2 4l4 4 4-4'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.sort select:hover  { border-color: var(--ink); }
.sort select:focus { outline: 0; border-color: var(--accent); }

/* Filter-chip mockup styling (only used if mockup chip JS is added later) */
.chip { position: relative; }
.chip__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--line-2);
    background: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    transition: all var(--transition);
    cursor: pointer;
    font-family: inherit;
}
.chip__btn:hover { border-color: var(--ink); }
.chip__btn svg { transition: transform var(--transition); opacity: .6; }
.chip.is-open .chip__btn { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.is-open .chip__btn svg { transform: rotate(180deg); opacity: 1; }
.chip.has-active .chip__btn { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.chip__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 40;
    min-width: 240px;
    max-width: 360px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.chip.is-open .chip__panel { opacity: 1; visibility: visible; transform: translateY(0); }
.chip__row { padding: 6px 0; }
.chip__row label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background .15s;
}
.chip__row label:hover { background: var(--bg-soft); }
.chip__row input[type="checkbox"],
.swatch input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}
.chip__panel--colors { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.swatch {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: background .15s;
}
.swatch:hover { background: var(--bg-soft); }
.swatch span {
    width: 18px; height: 18px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.filter-clear {
    font-size: 13px;
    color: var(--ink-3);
    padding: 9px 14px;
    border-radius: 999px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.filter-clear:hover { color: var(--accent); opacity: 1; }

/* --- Product grid (category) --- */
.cat-grid { padding: 40px 0 60px; }
.prod-grid--cat,
.listing.products {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    padding: 0; /* this grid is a <section>, so it inherited base.css section{padding:100px 0} → ~90px gap above products; mockup's grid is a <div>. .cat-grid already provides the 40/60 outer spacing */
}
.listing.products.rows { grid-template-columns: 1fr; }
@media (max-width: 1500px) { .prod-grid--cat, .listing.products { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1100px) { .prod-grid--cat, .listing.products { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .prod-grid--cat, .listing.products { grid-template-columns: repeat(2, 1fr); gap: 14px; } }

/* ============================================================
   CONTAINER QUERIES (doc sec 2.8 contract).
   .listing.products .product becomes a query container.
   Selector targets: .product-name, .product-price, .product-swatches.
   .product-name + .product-price live on .prod__title + .prod__price
   (multi-class on listing card, kept for this contract).
   ============================================================ */
.listing.products .product {
    container-type: inline-size;
    container-name: product-card;
    /* off-screen rendering optimization */
    content-visibility: auto;
    contain-intrinsic-size: 0 380px;
}
@container product-card (max-width: 220px) {
    .product-name, .prod__title { font-size: 15px; min-height: 36px; margin-bottom: 8px; }
    .product-price, .prod__price { font-size: 17px; }
    .prod__cat { display: none; }
    .product-swatches { gap: 4px; }
}
@container product-card (min-width: 380px) {
    .product-name, .prod__title { font-size: 21px; }
    .product-price, .prod__price { font-size: 24px; }
}

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 60px;
    flex-wrap: wrap;
}
.pagination a, .pagination span,
.pag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}
.pagination a, .pag--num { border-color: var(--line); }
.pagination a:hover,
.pag:hover:not([disabled]):not(.pag--dots) { border-color: var(--ink); color: var(--ink); opacity: 1; }
.pagination .current,
.pag.is-active {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}
.pag[disabled] { opacity: .35; cursor: not-allowed; }
.pag--dots { border: 0; cursor: default; }

/* --- Long description with show-more --- */
.cat-desc {
    background: var(--bg-soft);
    padding: 80px 0;
    border-top: 1px solid var(--line);
}
.cat-desc__head {
    max-width: 880px;
    margin: 0 auto 32px;
    text-align: center;
}
.cat-desc__head .eyebrow { margin-bottom: 12px; }
.cat-desc__more {
    max-width: 880px;
    margin: 0 auto;
    position: relative;
}
.cat-desc__body {
    position: relative;
    max-height: 520px;
    overflow: hidden;
    transition: max-height .5s cubic-bezier(.22,.61,.36,1);
}
.cat-desc__more.is-expanded .cat-desc__body { max-height: 6000px; }
.cat-desc__body::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 140px;
    background: linear-gradient(180deg, rgba(245,246,241,0) 0%, var(--bg-soft) 85%);
    pointer-events: none;
    transition: opacity .3s;
}
.cat-desc__more.is-expanded .cat-desc__body::after { opacity: 0; }
.cat-desc__body p {
    font-size: 16px;
    line-height: 1.75;
    color: var(--ink-2);
    margin: 0 0 18px;
}
.cat-desc__body p strong { color: var(--ink); font-weight: 600; }
.cat-desc__body p em { font-style: italic; color: var(--accent-dark); font-weight: 500; }
.cat-desc__body h3 {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 600;
    color: var(--ink);
    margin: 32px 0 12px;
}
.cat-desc__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 24px 0 0;
    padding: 12px 26px;
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.cat-desc__toggle:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.cat-desc__toggle svg { transition: transform .3s; }
.cat-desc__more.is-expanded .cat-desc__toggle svg { transform: rotate(180deg); }

/* --- FAQ (used on category + contact) --- */
.faq {
    background: var(--bg);
    padding: 90px 0;
    border-top: 1px solid var(--line);
}
.faq__head { text-align: center; margin-bottom: 48px; }
.faq__list {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.faq__item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.faq__item[open] {
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(147,173,63,.10);
}
.faq__q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 26px;
    cursor: pointer;
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
    list-style: none;
    user-select: none;
    transition: color var(--transition);
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q:hover { color: var(--accent-dark); opacity: 1; }
.faq__chev { flex-shrink: 0; color: var(--ink-3); transition: transform .3s, color var(--transition); }
.faq__item[open] .faq__chev { transform: rotate(180deg); color: var(--accent); }
.faq__a {
    padding: 0 26px 24px;
    border-top: 1px solid var(--line);
    margin-top: -1px;
}
.faq__a p {
    margin: 16px 0 0;
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink-2);
}
.faq__a a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.faq__a a:hover { color: var(--accent); opacity: 1; }
.faq__a p strong { color: var(--ink); font-weight: 600; }
.faq__contact {
    max-width: 820px;
    margin: 36px auto 0;
    padding: 22px 26px;
    text-align: center;
    background: var(--bg-soft);
    border-radius: var(--radius-lg);
    font-size: 14px;
    color: var(--ink-2);
}
.faq__contact a { color: var(--accent-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* --- SEO link cloud --- */
.cat-seo {
    background: var(--bg);
    padding: 60px 0 80px;
    border-top: 1px solid var(--line);
}
.cat-seo__title {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 24px;
}
.seo-links { display: flex; flex-wrap: wrap; gap: 8px; }
.seo-link {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: 4px;
    background: #fff;
    transition: all .18s ease;
    white-space: nowrap;
}
.seo-link:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: var(--accent-soft);
    opacity: 1;
}

/* --- Cat page responsive --- */
@media (max-width: 1024px) {
    .filters { gap: 14px; }
    .filters__sort { width: 100%; justify-content: space-between; margin-left: 0; }
}
@media (max-width: 720px) {
    .cat-lead__inner { padding: 18px 0 6px; text-align: left; }
    .cat-lead__title, .cat-lead__intro { text-align: left; }
    .cat-desc__head { text-align: left; }
    .cat-desc__body { max-height: 600px; }
    .cat-desc__body h3 { font-size: 22px; }
    .filters__chips { gap: 6px; }
    .pagination { gap: 4px; }
    .pag, .pagination a, .pagination span {
        min-width: 36px; height: 36px; padding: 0 10px; font-size: 12px;
    }
    .faq__q { font-size: 17px; padding: 18px 20px; }
    .faq__a { padding: 0 20px 20px; }
}
