/* Ariklass poe taiendused v1.0.2 */

/* ---------- Filter sidebar: scrolls on its own, header + "apply" button always visible ---------- */
@media (min-width: 901px) {
    .shop-filter-sidebar {
        position: sticky;
        top: 80px;
        align-self: start;
    }
    .admin-bar .shop-filter-sidebar { top: 112px; }

    .shop-filter-sidebar .af-wrap {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: auto;
        scrollbar-color: var(--red, #e8001d) #ececea;
    }
    .admin-bar .shop-filter-sidebar .af-wrap { max-height: calc(100vh - 132px); }

    .shop-filter-sidebar .af-wrap::-webkit-scrollbar { width: 10px; }
    .shop-filter-sidebar .af-wrap::-webkit-scrollbar-track { background: #ececea; border-radius: 0 8px 8px 0; }
    .shop-filter-sidebar .af-wrap::-webkit-scrollbar-thumb {
        background: var(--red, #e8001d);
        border-radius: 6px;
        border: 2px solid #ececea;
        min-height: 40px;
    }
    .shop-filter-sidebar .af-wrap::-webkit-scrollbar-thumb:hover { background: var(--red-dark, #c50019); }

    .shop-filter-sidebar .af-header {
        position: sticky;
        top: 0;
        z-index: 3;
    }
    .shop-filter-sidebar .af-footer {
        position: sticky;
        bottom: 0;
        z-index: 3;
        box-shadow: 0 -6px 12px rgba(0, 0, 0, .06);
    }
}

/* scroll hint arrows */
.apt-scroll-btn {
    display: none;
    position: absolute;
    left: 0;
    right: 10px;
    z-index: 4;
    border: 0;
    background: rgba(17, 17, 17, .82);
    color: #fff;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 6px 0;
    cursor: pointer;
}
.apt-scroll-btn:hover { background: var(--red, #e8001d); }
@media (min-width: 901px) {
    .apt-can-up .apt-scroll-up,
    .apt-can-down .apt-scroll-down { display: block; }
}

/* ---------- Block cart / checkout: hide raw pipe spec string under product name ---------- */
.wc-block-components-product-metadata__description,
.wc-block-cart-item__product .wc-block-components-product-metadata__description,
.wc-block-components-order-summary-item__description .wc-block-components-product-metadata__description {
    display: none !important;
}

/* ---------- VAT rows ---------- */
.apt-vat-block {
    padding: 4px 0 12px;
    font-size: 14px;
    color: #555;
}
.wc-block-checkout .apt-vat-block { padding: 0 16px 14px; }
.apt-vat-block .apt-vat-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
}
.apt-vat-block .apt-vat-line strong { font-weight: 600; color: #111; }
tr.apt-vat-row th, tr.apt-vat-row td { font-weight: 400; color: #555; font-size: .95em; }
.apt-mini-vat { font-size: 12px; color: #666; margin-top: 6px; }

/* ---------- Usage (product card) ---------- */
.apt-usage-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin: 8px 0 4px;
    font-size: 11px;
    line-height: 1.3;
}
.apt-fit-label { color: #777; margin-left: 2px; }
.apt-chip {
    background: #f1f1ef;
    color: #222;
    border-radius: 100px;
    padding: 3px 9px;
    font-weight: 500;
    white-space: nowrap;
}
.apt-chip-cad { background: #e9f1fb; color: #0b4a8b; }
.apt-chip-gaming { background: #f3ecfb; color: #5b2a91; }
.apt-chip-heavy { background: #fdf0e6; color: #8a4300; }
.apt-class {
    display: inline-block;
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.apt-class-1 { background: #ececea; color: #333; }
.apt-class-2 { background: #111; color: #fff; }
.apt-class-3 { background: var(--red, #e8001d); color: #fff; }

/* ---------- Usage (single product) ---------- */
.apt-usage { margin: 22px 0 26px; }
.apt-usage .spec-table-title { margin-bottom: 10px; }
.apt-usage-class { font-size: 14px; color: #333; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.apt-usage-list { list-style: none; margin: 0; padding: 0; border: 1px solid #e6e6e3; border-radius: 4px; background: #fff; }
.apt-usage-list li {
    display: grid;
    grid-template-columns: 1fr auto 90px;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
.apt-usage-list li:last-child { border-bottom: 0; }
.apt-u-name { font-weight: 600; color: #111; }
.apt-u-name small { display: block; font-weight: 400; color: #888; font-size: 12px; margin-top: 2px; }
.apt-meter { display: inline-flex; gap: 4px; }
.apt-meter i { width: 22px; height: 8px; border-radius: 2px; background: #e4e4e1; display: inline-block; }
.apt-meter i.on { background: #111; }
.apt-lvl-3 .apt-meter i.on { background: var(--red, #e8001d); }
.apt-u-val { font-size: 12px; color: #555; text-align: right; }
.apt-lvl-0 .apt-u-name, .apt-lvl-0 .apt-u-val { color: #aaa; }
.apt-usage-note { font-size: 12px; color: #888; margin-top: 8px; }
@media (max-width: 600px) {
    .apt-usage-list li { grid-template-columns: 1fr auto; }
    .apt-u-val { grid-column: 2; }
    .apt-meter { grid-row: 1; grid-column: 2; }
}

/* "Milleks sobib" after "Tehnilised andmed", before "Omadused" (summary is a flex column) */
.summary:has(> .product-spec-table) > .product-spec-table { order: 1; }
.summary:has(> .product-spec-table) > .apt-usage { order: 2; margin-top: 0; }
.summary:has(> .product-spec-table) > .product-spec-table ~ *:not(.apt-usage) { order: 3; }
