/* =============================================================================
   shop.css — Shop archive: layout, filter sidebar, toolbar, product grid/cards
   ============================================================================= */

/* ─── §11  Shop archive layout ───────────────────────────────────────────── */
.mpt-archive {
    display: grid;
    grid-template-columns: 0px minmax(0, 1fr);
    grid-template-areas: "sidebar products";
    gap: 0;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 28px var(--page-pad) 64px;
    align-items: start;
    transition: grid-template-columns .32s cubic-bezier(.4, 0, .2, 1),
                gap .32s cubic-bezier(.4, 0, .2, 1);
}
.mpt-archive.no-transition,
.mpt-archive.no-transition .mpt-sidebar,
.mpt-archive.no-transition .mpt-sidebar .mi-filter-panel { transition: none !important; }
.mpt-archive.sidebar-open {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: clamp(20px, 3vw, 40px);
}

/* ─── §12  Sidebar & filter panel ────────────────────────────────────────── */
.mpt-sidebar {
    grid-area: sidebar;
    overflow: hidden;
    width: 0;
    min-width: 0;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease, visibility 0s linear .32s;
}
.mpt-archive.sidebar-open .mpt-sidebar {
    width: 260px;
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transition: opacity .25s ease .1s, visibility 0s linear 0s;
}
.mpt-sidebar .mi-filter-panel {
    position: sticky;
    top: calc(var(--header-h) + 12px);
    width: 260px;
}
.mpt-products-area {
    grid-area: products;
    min-width: 0;
}

/* ─── Filter toggle button ────────────────────────────────────────────────── */
.mpt-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 8px 12px;
    background: black;
    color: var(--clr-white);
    border: 1px solid var(--clr-border);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    font-family: inherit;
    flex-shrink: 0;
    position: relative;
    justify-self: start;
}
.mpt-filter-toggle:hover { background: var(--clr-gray); border-color: var(--clr-black); color: black; }
.mpt-filter-toggle.is-open { background: var(--clr-white); color: black; border-color: var(--clr-black); }
.mpt-filter-toggle.is-open:hover { background: var(--clr-gray); }
.mpt-filter-toggle .mi-filter-badge { margin-left: 2px; }
.mpt-filter-toggle svg.mpt-toggle-icon-open,
.mpt-filter-toggle svg.mpt-toggle-icon-close,
.mpt-filter-toggle .mpt-toggle-label-open,
.mpt-filter-toggle .mpt-toggle-label-close { display: none; }
.mpt-filter-toggle:not(.is-open) svg.mpt-toggle-icon-open  { display: block; }
.mpt-filter-toggle:not(.is-open) .mpt-toggle-label-open    { display: inline; }
.mpt-filter-toggle.is-open svg.mpt-toggle-icon-close { display: block; }
.mpt-filter-toggle.is-open .mpt-toggle-label-close   { display: inline; }

/* ─── §13  Shop toolbar ───────────────────────────────────────────────────── */
.mpt-shop-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--clr-border);
    gap: 12px;
}
.woocommerce-result-count {
    font-size: 13px;
    color: var(--clr-muted);
    margin: 0;
    text-align: center;
    justify-self: center;
    grid-column: 2;
    white-space: nowrap;
}
.mpt-shop-toolbar .woocommerce-notices-wrapper { display: none; }
.woocommerce-ordering { justify-self: end; grid-column: 3; margin: 0; }
.woocommerce-ordering select { border: 1px solid var(--clr-border); padding: 7px 12px; font-size: 13px; font-family: inherit; outline: none; }
.woocommerce-ordering select:focus { border-color: var(--clr-black); }
.woocommerce .woocommerce-result-count { margin: 0; }

/* ─── §14  Product card grid ─────────────────────────────────────────────── */
.woocommerce ul.products, .woocommerce-page ul.products, ul.products { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important; gap: 20px !important; list-style: none !important; margin: 0 !important; padding: 0 !important; width: 100% !important; float: none !important; }
.woocommerce ul.products::before, .woocommerce ul.products::after, ul.products::before, ul.products::after { display: none !important; content: none !important; }
.woocommerce ul.products li.product, ul.products li.product { float: none !important; clear: none !important; width: auto !important; max-width: none !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; list-style: none !important; display: flex !important; flex-direction: column !important; position: relative; overflow: hidden; border: 1px solid var(--clr-border); background: #fff; transition: border-color .18s, box-shadow .18s, transform .15s; }
.woocommerce ul.products li.product:hover, ul.products li.product:hover { border-color: var(--clr-black); box-shadow: 0 6px 24px rgba(0,0,0,.09); transform: translateY(-2px); }

/* ─── §15  Product card — image ──────────────────────────────────────────── */
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link, ul.products li.product a.woocommerce-LoopProduct-link { display: flex !important; flex-direction: column !important; flex: 1 !important; min-width: 0 !important; min-height: 0 !important; }
.woocommerce ul.products li.product a img, ul.products li.product a img { width: 100% !important; height: 240px !important; object-fit: contain !important; display: block !important; padding: 16px !important; margin: 0 !important; background: var(--clr-white) !important; transition: transform .32s ease; }
.woocommerce ul.products li.product:hover a img, ul.products li.product:hover a img { transform: scale(1.04); }

/* ─── §16  Product card — body ───────────────────────────────────────────── */
.woocommerce ul.products li.product .woocommerce-loop-product__title, ul.products li.product .woocommerce-loop-product__title { font-size: 12px !important; font-weight: 400 !important; text-transform: uppercase !important; letter-spacing: .04em !important; line-height: 1.3 !important; margin: 12px 14px 6px !important; padding: 0 !important; color: var(--clr-text) !important; word-break: break-word !important; overflow-wrap: anywhere !important; white-space: normal !important; }
.woocommerce ul.products li.product .price, ul.products li.product .price { display: block !important; font-size: 15px !important; font-weight: 800 !important; margin: 0 14px 8px !important; padding: 0 !important; color: var(--clr-black) !important; }
.woocommerce ul.products li.product del, ul.products li.product del { color: var(--clr-muted) !important; font-size: 12px !important; font-weight: 400 !important; }
.woocommerce ul.products li.product ins, ul.products li.product ins { text-decoration: none !important; color: var(--clr-red) !important; }

/* Color strip */
.mpt-color-strip { display: flex; align-items: center; gap: 6px; margin: 8px 14px 8px; position: relative; z-index: 5; }
.mpt-color-strip .mi-color-dot { display: inline-block; width: 18px; height: 18px; min-width: 18px; border-radius: 999px; border: 2px solid #fff; padding: 0; cursor: pointer; box-shadow: 0 0 0 1px rgba(0,0,0,.22); transition: transform .16s ease, box-shadow .16s ease; }
.mpt-color-strip .mi-color-dot:hover { transform: scale(1.12); }
.mpt-color-strip .mi-color-dot.is-active { box-shadow: 0 0 0 2px #111, 0 0 0 4px #fff; }

/* ─── §17  Product card — badges ─────────────────────────────────────────── */
.woocommerce ul.products li.product .onsale, ul.products li.product .onsale {
    position: absolute !important; top: 10px !important; right: 10px !important; left: auto !important; z-index: 20 !important;
    min-height: 0 !important; min-width: 0 !important; margin: 0 !important; padding: 5px 5px !important;
    background: var(--clr-red) !important; color: #fff !important; border-radius: 2px !important;
    font-size: 8px !important; font-weight: 800 !important; line-height: 1.2 !important; text-transform: uppercase !important; letter-spacing: .06em !important;
}
.mpt-card-stock { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 0 14px 8px; padding: 3px 8px; display: inline-block; line-height: 1.4; align-self: flex-start; }
.mpt-card-stock--in  { background: #e8f5e9; color: #2e7d32; }
.mpt-card-stock--low { background: #e8f5e9; color: #2e7d32; }
.mpt-card-stock--out { background: #fce4e4; color: #c62828; }

/* ─── §18  Product card — actions ────────────────────────────────────────── */
.mpt-card-actions { display: grid; grid-template-columns: 1fr 110px; gap: 8px; align-items: bottom; padding: 8px 14px 14px; margin-bottom: 0; }
.woocommerce ul.products li.product .mpt-card-actions .button,
ul.products li.product .mpt-card-actions .button {
    grid-column: 1; grid-row: 1;
    display: flex !important; align-items: center !important; justify-content: center !important;
    min-height: 38px !important; width: 100% !important; padding: 8px 10px !important;
    background: var(--clr-black); color: #fff !important;
    font-size: 10px !important; font-weight: 500 !important; text-transform: uppercase !important;
    letter-spacing: .07em !important; line-height: 1.2 !important; text-align: center !important; border-radius: 0px !important;
}
.woocommerce ul.products li.product .button { margin-top: 0 !important; }
.mpt-card-qty { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: 22px 1fr 22px; width: 110px; max-height: 38px; border: 1px solid var(--clr-border); }
.mpt-card-qty__btn { width: 22px; border: 0; background: var(--clr-gray); color: var(--clr-text); font-size: 16px; cursor: pointer; }
.mpt-card-qty__num { width: 100%; border: 0; border-left: 1px solid var(--clr-border); border-right: 1px solid var(--clr-border); text-align: center; font-size: 13px; font-weight: 700; background: #fff; }
.mpt-card-qty__num::-webkit-outer-spin-button, .mpt-card-qty__num::-webkit-inner-spin-button { -webkit-appearance: none; }
.mpt-card-btn-disabled, .mpt-card-btn-disabled:hover { background: #c4c4c4 !important; color: #fff !important; cursor: not-allowed !important; pointer-events: none !important; }
.mpt-card-qty--disabled, .mpt-card-qty--disabled * { background: #e5e5e5 !important; color: #999 !important; cursor: not-allowed !important; pointer-events: none !important; }
.added_to_cart.wc-forward { display: none !important; }

/* ─── Filter color swatches (sidebar) ────────────────────────────────────── */
.mi-color-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 4px; margin-bottom: 8px; }
.mi-color-swatch-btn { width: 26px; height: 26px; padding: 0; margin: 0; border: 1px solid #d8d8d8; border-radius: 50%; cursor: pointer; background-clip: padding-box; position: relative; }
.mi-color-swatch-btn:hover { border-color: #111; }
.mi-color-swatch-btn.is-active,
.mi-color-swatch-btn[aria-pressed="true"] { border-color: #111; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111; }
.mi-color-swatch-btn.is-active::after,
.mi-color-swatch-btn[aria-pressed="true"]::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: translate(-50%, -58%) rotate(45deg); }
.mi-color-swatch-btn[title^="Balta"]::after,
.mi-color-swatch-btn[title^="Pilka"]::after,
.mi-color-swatch-btn[title^="Sidabrinė"]::after { border-color: #111; }
.mi-color-swatch-btn[title^="Balta"]    { background: #fff !important; }
.mi-color-swatch-btn[title^="Juoda"]    { background: #080808 !important; }
.mi-color-swatch-btn[title^="Pilka"]    { background: #9b9b9b !important; }
.mi-color-swatch-btn[title^="Ruda"]     { background: #8b5a2b !important; }
.mi-color-swatch-btn[title^="Sidabrinė"] { background: linear-gradient(135deg, #f3f3f3, #9f9f9f) !important; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .mpt-archive, .mpt-archive.sidebar-open {
        grid-template-columns: 1fr !important;
        grid-template-areas: "products" !important;
        gap: 0 !important;
        padding-top: 20px;
    }
    .mpt-sidebar, .mpt-archive.sidebar-open .mpt-sidebar { display: none !important; }
    .mpt-filter-toggle { display: none !important; }
    .woocommerce ul.products, ul.products { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important; }
    .woocommerce ul.products li.product .mpt-card-actions .button,
    ul.products li.product .mpt-card-actions .button { font-size: 8px !important; }
}
@media (max-width: 640px) {
    .woocommerce ul.products, ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
    .woocommerce ul.products li.product a img, ul.products li.product a img { height: 180px !important; padding: 10px !important; }
}
