/* =====================================================================
   SHIM-ME Hub — WooCommerce Shop Archive  (v0.5.3)
   Scope: body.woocommerce-shop  (WooCommerce adds this to the /store/ page)
   Dark theme matching the SHIM-ME design system.
   Base tokens from shim-global-tokens.css, shared elements from shim-woo-base.css.
   ===================================================================== */

/* ---- Page wrapper -------------------------------------------------- */

body.woocommerce-shop .woocommerce {
    padding: 56px 0 100px !important;
}

/* ---- Page heading -------------------------------------------------- */

body.woocommerce-shop .entry-title,
body.woocommerce-shop h1.page-title {
    font-family: var(--shim-display) !important;
    font-weight: 800 !important;
    font-size: clamp(40px, 5vw, 72px) !important;
    line-height: 0.95 !important;
    text-transform: uppercase !important;
    color: var(--shim-text) !important;
    margin: 0 0 12px !important;
    letter-spacing: -0.01em !important;
}

/* Category description */
body.woocommerce-shop .term-description,
body.woocommerce-shop .woocommerce-products-header__description {
    color: var(--shim-text-dim) !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    margin: 0 0 40px !important;
    max-width: 600px !important;
}

/* ---- Shop toolbar (result count + ordering) ----------------------- */

body.woocommerce-shop .woocommerce-products-header {
    margin-bottom: 32px !important;
}

body.woocommerce-shop .woocommerce-result-count {
    font-family: var(--shim-mono) !important;
    font-size: 11px !important;
    color: var(--shim-text-mute) !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    line-height: 42px !important;   /* matches ordering select height */
}

body.woocommerce-shop .woocommerce-ordering {
    margin: 0 !important;
}

body.woocommerce-shop .woocommerce-ordering select {
    background: var(--shim-bg-3) !important;
    border: 1px solid var(--shim-line-2) !important;
    color: var(--shim-text) !important;
    font-family: var(--shim-mono) !important;
    font-size: 11px !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    padding: 10px 38px 10px 14px !important;
    border-radius: 0 !important;
    height: 42px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: linear-gradient(45deg, transparent 50%, var(--shim-text-dim) 50%),
                      linear-gradient(135deg, var(--shim-text-dim) 50%, transparent 50%) !important;
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50% !important;
    background-size: 6px 6px, 6px 6px !important;
    background-repeat: no-repeat !important;
    cursor: pointer !important;
}

body.woocommerce-shop .woocommerce-ordering select:focus {
    border-color: var(--shim-red) !important;
    outline: none !important;
}

/* Toolbar row (result count left, ordering right) */
body.woocommerce-shop .woocommerce-products-header + .woocommerce > .woocommerce-result-count,
body.woocommerce-shop .woocommerce > .woocommerce-result-count {
    float: left !important;
}

body.woocommerce-shop .woocommerce > .woocommerce-ordering {
    float: right !important;
    margin-bottom: 24px !important;
}

/* ---- Product grid ------------------------------------------------- */

body.woocommerce-shop ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    clear: both !important;
}

/* 4-column for wider product ranges */
@media (min-width: 1200px) {
    body.woocommerce-shop ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ---- Product card ------------------------------------------------- */

body.woocommerce-shop ul.products li.product {
    background: var(--shim-bg-3) !important;
    border: 1px solid var(--shim-line) !important;
    display: flex !important;
    flex-direction: column !important;
    transition: border-color .15s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    text-decoration: none !important;
    position: relative !important;
}

body.woocommerce-shop ul.products li.product:hover {
    border-color: var(--shim-red) !important;
}

/* Product image */
body.woocommerce-shop ul.products li.product a.woocommerce-loop-product__link {
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    color: inherit !important;
}

body.woocommerce-shop ul.products li.product img {
    width: 100% !important;
    aspect-ratio: 4 / 3 !important;
    object-fit: contain !important;
    background:
        radial-gradient(ellipse at center, rgba(227,29,30,0.1), transparent 65%),
        var(--shim-bg-2) !important;
    border-bottom: 1px solid var(--shim-line) !important;
    padding: 24px !important;
    display: block !important;
    box-sizing: border-box !important;
    transition: opacity .15s ease !important;
}

body.woocommerce-shop ul.products li.product:hover img {
    opacity: 0.88 !important;
}

/* Sale badge */
body.woocommerce-shop ul.products li.product .onsale {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    background: var(--shim-red) !important;
    color: #fff !important;
    font-family: var(--shim-mono) !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    padding: 4px 8px !important;
    border-radius: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    line-height: 1.4 !important;
}

/* Product title */
body.woocommerce-shop ul.products li.product .woocommerce-loop-product__title,
body.woocommerce-shop ul.products li.product h2 {
    font-family: var(--shim-display) !important;
    font-weight: 700 !important;
    font-size: 22px !important;
    text-transform: uppercase !important;
    color: var(--shim-text) !important;
    margin: 16px 20px 6px !important;
    line-height: 1 !important;
    padding: 0 !important;
}

/* Product price */
body.woocommerce-shop ul.products li.product .price {
    margin: 0 20px 14px !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    color: var(--shim-text) !important;
}

body.woocommerce-shop ul.products li.product .price .amount {
    font-family: var(--shim-display) !important;
    font-weight: 700 !important;
    font-size: 20px !important;
    color: var(--shim-text) !important;
}

body.woocommerce-shop ul.products li.product .price del .amount {
    font-size: 16px !important;
    color: var(--shim-text-mute) !important;
}

body.woocommerce-shop ul.products li.product .price ins {
    text-decoration: none !important;
    background: transparent !important;
}

body.woocommerce-shop ul.products li.product .price ins .amount {
    color: var(--shim-text) !important;
}

/* Card spacer — pushes add-to-cart to bottom */
body.woocommerce-shop ul.products li.product a.woocommerce-loop-product__link {
    flex: 1 !important;
}

/* Add to cart button on card */
body.woocommerce-shop ul.products li.product .button,
body.woocommerce-shop ul.products li.product a.button {
    margin: auto 20px 20px !important;
    align-self: flex-start !important;
    font-size: 11px !important;
    padding: 10px 16px !important;
    letter-spacing: 0.14em !important;
}

body.woocommerce-shop ul.products li.product .added_to_cart {
    margin: 0 20px 8px !important;
    font-family: var(--shim-mono) !important;
    font-size: 10px !important;
    color: #4ade80 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
}

/* ---- No products found -------------------------------------------- */

body.woocommerce-shop .woocommerce-info {
    margin-top: 0 !important;
}

/* ---- Pagination ---------------------------------------------------- */

body.woocommerce-shop nav.woocommerce-pagination {
    margin-top: 48px !important;
    text-align: center !important;
}

body.woocommerce-shop nav.woocommerce-pagination ul {
    display: inline-flex !important;
    gap: 0 !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid var(--shim-line) !important;
}

body.woocommerce-shop nav.woocommerce-pagination ul li {
    border-right: 1px solid var(--shim-line) !important;
    margin: 0 !important;
}

body.woocommerce-shop nav.woocommerce-pagination ul li:last-child {
    border-right: none !important;
}

body.woocommerce-shop nav.woocommerce-pagination ul li a,
body.woocommerce-shop nav.woocommerce-pagination ul li span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important;
    height: 44px !important;
    padding: 0 14px !important;
    font-family: var(--shim-mono) !important;
    font-size: 12px !important;
    letter-spacing: 0.1em !important;
    color: var(--shim-text-mute) !important;
    background: var(--shim-bg-3) !important;
    text-decoration: none !important;
    transition: background .15s ease, color .15s ease !important;
}

body.woocommerce-shop nav.woocommerce-pagination ul li a:hover {
    background: var(--shim-bg-2) !important;
    color: var(--shim-text) !important;
}

body.woocommerce-shop nav.woocommerce-pagination ul li span.current {
    background: var(--shim-red) !important;
    color: #fff !important;
    font-weight: 700 !important;
}

/* ---- Filters / widgets (if sidebar is active) --------------------- */

body.woocommerce-shop .widget_price_filter .price_slider_wrapper .ui-widget-content {
    background: var(--shim-line) !important;
}

body.woocommerce-shop .widget_price_filter .ui-slider .ui-slider-range {
    background: var(--shim-red) !important;
}

body.woocommerce-shop .widget_price_filter .ui-slider .ui-slider-handle {
    background: var(--shim-text) !important;
    border-color: var(--shim-text) !important;
}

/* ---- Responsive ---------------------------------------------------- */

@media (max-width: 1024px) {
    body.woocommerce-shop ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    body.woocommerce-shop ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }

    body.woocommerce-shop .woocommerce > .woocommerce-result-count,
    body.woocommerce-shop .woocommerce > .woocommerce-ordering {
        float: none !important;
        display: block !important;
        width: 100% !important;
        margin-bottom: 12px !important;
    }

    body.woocommerce-shop .woocommerce-ordering select {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    body.woocommerce-shop ul.products {
        grid-template-columns: 1fr !important;
    }
}
