/* =========================================================
   ZieloneDrzewko - katalog i kategorie 220
   Układ typu marketplace: lewy panel filtrów, lista produktów, szybkie porównanie
========================================================= */

.shop-listing-page {
    --shop-max: 1280px;
    --shop-green: #0b4c39;
    --shop-olive: #789113;
    --shop-border: #dfe7d5;
    --shop-soft: #f4f8ee;
    --shop-card: #ffffff;
    --shop-text: #102018;
    --shop-muted: #657260;
    --shop-shadow: 0 18px 52px rgba(15, 54, 36, 0.075);
    width: min(var(--shop-max), calc(100% - 32px));
    margin: 0 auto 64px;
}

.shop-listing-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 34px auto 20px;
    padding: 30px 34px;
    border-radius: 28px;
    border: 1px solid var(--shop-border);
    background:
        radial-gradient(circle at 100% 0%, rgba(120, 145, 19, 0.08), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #f5f8ef 100%);
    box-shadow: var(--shop-shadow);
}

.shop-listing-hero .section-kicker {
    display: block;
    color: var(--shop-olive);
    font-size: 0.74rem;
    font-weight: 950;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.shop-listing-hero h1 {
    max-width: 820px;
    margin: 8px 0 0;
    color: var(--shop-text);
    font-size: clamp(1.95rem, 2.9vw, 3rem);
    line-height: 1.04;
    letter-spacing: -0.055em;
    font-weight: 950;
}

.shop-listing-hero p {
    max-width: 760px;
    margin: 12px 0 0;
    color: var(--shop-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.shop-filter-mobile-button {
    display: none;
    min-height: 44px;
    padding: 0 17px;
    border: 0;
    border-radius: 999px;
    background: var(--shop-green);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 900;
    cursor: pointer;
}

.shop-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.shop-active-filters a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #d8e4c8;
    background: #fff;
    color: var(--shop-text);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 850;
}

.shop-active-filters a span {
    color: var(--shop-olive);
    font-weight: 950;
}

.shop-active-filters .clear-all {
    background: #102018;
    border-color: #102018;
    color: #fff;
}

.shop-layout-xk {
    display: grid;
    grid-template-columns: 276px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.shop-sidebar-xk {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 14px;
    align-self: start;
}

.shop-sidebar-head {
    display: none;
}

.shop-sidebar-box {
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--shop-border);
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 54, 36, 0.055);
}

.shop-sidebar-box h2 {
    margin: 0;
    padding: 16px 18px;
    border-bottom: 1px solid #edf2e8;
    color: var(--shop-text);
    font-size: 0.98rem;
    line-height: 1.2;
    font-weight: 950;
    letter-spacing: -0.025em;
}

.shop-category-tree {
    display: grid;
    padding: 8px;
}

.shop-category-tree a {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0 11px;
    border-radius: 13px;
    color: #26352b;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 760;
}

.shop-category-tree a:hover,
.shop-category-tree a.is-active {
    background: #eef5e4;
    color: var(--shop-green);
}

.shop-filter-form {
    display: grid;
    gap: 13px;
    padding: 16px;
}

.shop-filter-form label {
    display: grid;
    gap: 7px;
    color: #445243;
    font-size: 0.8rem;
    font-weight: 850;
}

.shop-filter-form input[type="search"],
.shop-filter-form input[type="number"],
.shop-filter-form select {
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid #d7e2ca;
    background: #f8fbf4;
    color: var(--shop-text);
    font-size: 0.9rem;
    font-weight: 700;
    outline: none;
}

.shop-filter-form input:focus,
.shop-filter-form select:focus {
    border-color: var(--shop-olive);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(120, 145, 19, 0.12);
}

.shop-price-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.shop-check {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 9px !important;
    min-height: 34px;
}

.shop-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--shop-olive);
}

.shop-filter-form button {
    min-height: 44px;
    border: 0;
    border-radius: 15px;
    background: var(--shop-olive);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 920;
    cursor: pointer;
}

.shop-filter-form button:hover {
    background: var(--shop-green);
}

.shop-filter-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    color: #5f6b5f;
    font-size: 0.86rem;
    font-weight: 850;
    text-decoration: none;
}

.shop-main-xk {
    min-width: 0;
    display: grid;
    gap: 18px;
}

.shop-featured-strip,
.shop-results-panel,
.shop-seo-box-xk {
    border-radius: 24px;
    border: 1px solid var(--shop-border);
    background: #fff;
    box-shadow: 0 14px 42px rgba(15, 54, 36, 0.055);
}

.shop-featured-strip {
    padding: 16px;
}

.shop-featured-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.shop-featured-head strong {
    color: var(--shop-text);
    font-size: 1rem;
    font-weight: 950;
}

.shop-featured-head span {
    color: #6a7565;
    font-size: 0.86rem;
    font-weight: 750;
}

.shop-featured-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.shop-featured-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    min-width: 0;
    min-height: 92px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid #edf2e8;
    background: #fbfcf8;
    color: inherit;
    text-decoration: none;
}

.shop-featured-card:hover {
    border-color: #cdddbb;
    background: #f5f9ee;
}

.shop-featured-card img {
    grid-row: 1 / 3;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 14px;
    background: #f3f0e8;
}

.shop-featured-card span {
    min-width: 0;
    color: var(--shop-text);
    font-size: 0.82rem;
    line-height: 1.25;
    font-weight: 850;
}

.shop-featured-card strong {
    margin-top: 4px;
    color: var(--shop-green);
    font-size: 0.95rem;
    font-weight: 950;
}

.shop-results-panel {
    overflow: hidden;
}

.shop-results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid #edf2e8;
}

.shop-results-toolbar span {
    display: block;
    color: var(--shop-olive);
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.shop-results-toolbar strong {
    display: block;
    margin-top: 3px;
    color: var(--shop-text);
    font-size: 1.08rem;
    font-weight: 950;
}

.shop-sort-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.shop-sort-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #d8e4c8;
    background: #fff;
    color: #243528;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 820;
}

.shop-sort-tabs a:hover,
.shop-sort-tabs a.is-active {
    border-color: var(--shop-olive);
    background: var(--shop-olive);
    color: #fff;
}

.shop-product-list-xk {
    display: grid;
}

.shop-product-row-xk {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) 190px;
    gap: 18px;
    padding: 18px;
    border-bottom: 1px solid #edf2e8;
    background: #fff;
}

.shop-product-row-xk:last-child {
    border-bottom: 0;
}

.shop-product-row-xk:hover {
    background: #fbfcf8;
}

.shop-product-row-image {
    position: relative;
    display: block;
    width: 132px;
    height: 132px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #edf2e8;
    background: #f3f0e8;
}

.shop-product-row-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.shop-badge-sale {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 2;
    min-height: 24px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #a83b2d;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 950;
}

.shop-product-row-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.shop-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 8px;
}

.shop-product-meta span {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    background: #eef5e4;
    color: #53634f;
    font-size: 0.72rem;
    font-weight: 850;
}

.shop-product-row-info h2 {
    margin: 0;
    color: var(--shop-text);
    font-size: clamp(1rem, 1.25vw, 1.18rem);
    line-height: 1.24;
    font-weight: 920;
    letter-spacing: -0.025em;
}

.shop-product-row-info h2 a {
    color: inherit;
    text-decoration: none;
}

.shop-product-row-info h2 a:hover {
    color: var(--shop-green);
}

.shop-product-row-info p {
    max-width: 620px;
    margin: 9px 0 0;
    color: #5f6b5f;
    font-size: 0.9rem;
    line-height: 1.55;
}

.shop-product-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.shop-product-flags span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #d8e4c8;
    background: #fff;
    color: #596756;
    font-size: 0.76rem;
    font-weight: 850;
}

.shop-product-flags .is-available {
    color: #1f6b36;
    background: #eef8ec;
    border-color: #d7eccf;
}

.shop-product-flags .is-unavailable {
    color: #8a5a16;
    background: #fff8e8;
    border-color: #ead9a8;
}

.shop-product-row-buy {
    display: grid;
    align-content: center;
    justify-items: end;
    gap: 8px;
    text-align: right;
}

.shop-product-row-buy del {
    color: #8b9388;
    font-size: 0.9rem;
    font-weight: 760;
}

.shop-product-row-buy > strong {
    color: var(--shop-green);
    font-size: 1.22rem;
    font-weight: 960;
    letter-spacing: -0.03em;
}

.shop-row-cart-form {
    width: 100%;
}

.shop-row-cart-form button {
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 15px;
    background: var(--shop-olive);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 920;
    cursor: pointer;
}

.shop-row-cart-form button:hover {
    background: var(--shop-green);
}

.shop-row-details {
    color: #4d5e4a;
    font-size: 0.82rem;
    font-weight: 850;
    text-decoration: none;
}

.shop-row-details:hover {
    color: var(--shop-green);
}

.shop-empty-results {
    padding: clamp(38px, 5vw, 72px) 24px;
    text-align: center;
    background: #f4f8ee;
}

.shop-empty-results h2 {
    margin: 0 0 10px;
    color: var(--shop-text);
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
    font-weight: 950;
}

.shop-empty-results p {
    margin: 0 0 18px;
    color: #5f6b5f;
    font-weight: 750;
}

.shop-pagination-xk {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 18px;
    border-top: 1px solid #edf2e8;
}

.shop-pagination-xk a,
.shop-pagination-xk span {
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 13px;
    border: 1px solid #d8e4c8;
    background: #fff;
    color: #26352b;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 850;
}

.shop-pagination-xk a.is-active,
.shop-pagination-xk a:hover {
    background: var(--shop-olive);
    border-color: var(--shop-olive);
    color: #fff;
}

.shop-seo-box-xk {
    padding: 24px 28px;
}

.shop-seo-box-xk h2 {
    margin: 0 0 10px;
    color: var(--shop-text);
    font-size: clamp(1.25rem, 1.8vw, 1.7rem);
    line-height: 1.16;
    font-weight: 950;
    letter-spacing: -0.035em;
}

.shop-seo-box-xk p {
    max-width: 920px;
    margin: 0;
    color: #5f6b5f;
    font-size: 0.96rem;
    line-height: 1.72;
}

.shop-filter-overlay {
    display: none;
}

/* Ukrycie starych elementów katalogu, jeśli pozostały w cache lub innych paczkach */
.catalog-clean-filters,
.catalog-clean-sort,
.catalog-clean-hero,
.category-header > form,
.catalog-header > form {
    display: none !important;
}

/* Dark mode */
html[data-theme="dark"] .shop-listing-page,
html.dark .shop-listing-page,
body.dark .shop-listing-page {
    --shop-card: #0f2118;
    --shop-text: #f2f8ec;
    --shop-muted: rgba(237, 246, 233, 0.72);
    --shop-border: rgba(210, 232, 184, 0.14);
    --shop-soft: #0b1b14;
}

html[data-theme="dark"] .shop-listing-hero,
html[data-theme="dark"] .shop-sidebar-box,
html[data-theme="dark"] .shop-featured-strip,
html[data-theme="dark"] .shop-results-panel,
html[data-theme="dark"] .shop-seo-box-xk,
html.dark .shop-listing-hero,
html.dark .shop-sidebar-box,
html.dark .shop-featured-strip,
html.dark .shop-results-panel,
html.dark .shop-seo-box-xk,
body.dark .shop-listing-hero,
body.dark .shop-sidebar-box,
body.dark .shop-featured-strip,
body.dark .shop-results-panel,
body.dark .shop-seo-box-xk {
    background: #0f2118;
    border-color: rgba(210, 232, 184, 0.14);
    box-shadow: 0 20px 58px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .shop-product-row-xk,
html.dark .shop-product-row-xk,
body.dark .shop-product-row-xk {
    background: #0f2118;
    border-bottom-color: rgba(210, 232, 184, 0.11);
}

html[data-theme="dark"] .shop-product-row-xk:hover,
html.dark .shop-product-row-xk:hover,
body.dark .shop-product-row-xk:hover {
    background: #12261c;
}

html[data-theme="dark"] .shop-filter-form input,
html[data-theme="dark"] .shop-filter-form select,
html.dark .shop-filter-form input,
html.dark .shop-filter-form select,
body.dark .shop-filter-form input,
body.dark .shop-filter-form select {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(210, 232, 184, 0.14);
    color: #f2f8ec;
}

html[data-theme="dark"] .shop-featured-card,
html[data-theme="dark"] .shop-sort-tabs a,
html[data-theme="dark"] .shop-active-filters a,
html[data-theme="dark"] .shop-product-flags span,
html.dark .shop-featured-card,
html.dark .shop-sort-tabs a,
html.dark .shop-active-filters a,
html.dark .shop-product-flags span,
body.dark .shop-featured-card,
body.dark .shop-sort-tabs a,
body.dark .shop-active-filters a,
body.dark .shop-product-flags span {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(210, 232, 184, 0.12);
    color: #f2f8ec;
}

/* Responsive */
@media (max-width: 1180px) {
    .shop-featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-product-row-xk {
        grid-template-columns: 112px minmax(0, 1fr) 170px;
    }

    .shop-product-row-image {
        width: 112px;
        height: 112px;
    }
}

@media (max-width: 980px) {
    .shop-listing-page {
        width: min(100% - 24px, var(--shop-max));
    }

    .shop-filter-mobile-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .shop-layout-xk {
        grid-template-columns: 1fr;
    }

    .shop-sidebar-xk {
        position: fixed;
        z-index: 1002;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(360px, 88vw);
        overflow-y: auto;
        display: block;
        padding: 12px;
        background: #f4f8ee;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }

    .shop-sidebar-xk.is-open {
        transform: translateX(0);
    }

    .shop-sidebar-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
        padding: 10px 2px;
    }

    .shop-sidebar-head strong {
        color: var(--shop-text);
        font-size: 1.15rem;
        font-weight: 950;
    }

    .shop-sidebar-head button {
        min-height: 38px;
        padding: 0 12px;
        border: 0;
        border-radius: 999px;
        background: #102018;
        color: #fff;
        font-weight: 850;
    }

    .shop-sidebar-box + .shop-sidebar-box {
        margin-top: 12px;
    }

    .shop-filter-overlay {
        position: fixed;
        inset: 0;
        z-index: 1001;
        display: none;
        background: rgba(8, 20, 14, 0.48);
        backdrop-filter: blur(2px);
    }

    body.shop-filters-open .shop-filter-overlay {
        display: block;
    }

    .shop-results-toolbar {
        display: grid;
        gap: 12px;
    }

    .shop-sort-tabs {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .shop-listing-page {
        width: min(100% - 18px, var(--shop-max));
        margin-bottom: 42px;
    }

    .shop-listing-hero {
        display: grid;
        margin-top: 22px;
        padding: 22px;
        border-radius: 23px;
    }

    .shop-listing-hero h1 {
        font-size: 1.75rem;
        line-height: 1.08;
    }

    .shop-featured-grid {
        grid-template-columns: 1fr;
    }

    .shop-product-row-xk {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 13px;
        padding: 14px;
    }

    .shop-product-row-image {
        width: 92px;
        height: 92px;
        border-radius: 16px;
    }

    .shop-product-row-buy {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
        text-align: left;
        justify-items: start;
        padding-top: 12px;
        border-top: 1px solid #edf2e8;
    }

    .shop-row-cart-form {
        width: auto;
        min-width: 160px;
    }

    .shop-product-row-info p {
        display: none;
    }

    .shop-product-meta span:nth-child(n+2) {
        display: none;
    }

    .shop-product-flags {
        margin-top: 8px;
    }

    .shop-product-flags span:nth-child(n+2) {
        display: none;
    }

    .shop-results-toolbar,
    .shop-featured-strip,
    .shop-seo-box-xk {
        padding: 14px;
        border-radius: 20px;
    }

    .shop-sort-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .shop-sort-tabs a {
        white-space: nowrap;
    }
}

@media (max-width: 460px) {
    .shop-product-row-xk {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .shop-product-row-image {
        width: 82px;
        height: 82px;
    }

    .shop-product-row-info h2 {
        font-size: 0.95rem;
    }

    .shop-product-row-buy > strong {
        font-size: 1.1rem;
    }

    .shop-row-cart-form {
        width: 100%;
    }
}
