/* ==========================================================================
   SHOP / CATEGORY / TAG PAGES ONLY — classic WooCommerce loop
   (ul.products li.product), custom AJAX filters, price slider, mobile
   filter drawer. None of this markup appears on the block-based homepage.
   ========================================================================== */

/* Shop Add to Cart button */
.woocommerce ul.products li.product .button {
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Product cards */
ul.products li.product {
    background: #ffffff !important;
    border: 1px solid #e5e0d8;
    border-radius: 8px;
    padding: 16px !important;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.40);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    display: flex !important;
    flex-direction: column;
    height: 100%;
}

ul.products li.product:hover {
    box-shadow: 6px 6px 16px rgba(0, 0, 0, 0.55);
    transform: translateY(-3px);
}

ul.products li.product img {
    border-radius: 4px;
}

/* Push the button to the bottom of the card so heights align */
ul.products li.product .button {
    margin-top: auto;
}

/* Make sure the grid stretches items to equal height */
ul.products.columns-4 {
    display: grid;
    align-items: stretch;
    gap: 24px;
}

/* Price slider (shop filters) */
#cravio-price-slider {
    position: relative;
    height: 6px;
    background: #e5e0d8;
    border-radius: 3px;
    margin: 16px 8px;
}

#cravio-price-slider .ui-slider-range {
    position: absolute;
    height: 100%;
    background: #c9a227;
    border-radius: 3px;
}

#cravio-price-slider .ui-slider-handle {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    margin-top: -8px;
    background: #ffffff;
    border: 2px solid #c9a227;
    border-radius: 50%;
    cursor: pointer;
    outline: none;
}

#cravio-price-slider,
#cravio-price-slider .ui-slider-handle {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    touch-action: none;
}

#cravio-price-slider .ui-slider-handle {
    z-index: 2;
}

.price-inputs {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.price-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-input-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.price-input-group input[type="number"] {
    width: 90px;
    padding: 7px 2px;
    border: 1px solid #e5e0d8;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.price-input-sep {
    color: #999;
    padding-bottom: 2px;
}

.price-currency-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.price-currency-wrap .currency-symbol {
    position: absolute;
    left: 8px;
    font-size: 13px;
    color: #999;
    pointer-events: none;
}

.price-currency-wrap input[type="number"] {
    padding-left: 22px !important;
}

.price-range-note {
    font-size: 12px;
    color: #8a8470;
    margin: 14px 0 14px 0;
    line-height: 1.4;
}

.price-range-note strong {
    color: #c9a227;
    font-weight: 600;
}

/* Shop filter cards */
.cravio-shop-filters {
    background: transparent;
}

.cravio-shop-filters .filter-card {
    background: #ffffff;
    border: 1px solid #e5e0d8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.10);
}

.cravio-shop-filters .filter-card h4 {
    margin: 0 0 14px 0;
    font-size: 15px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #1a1814;
}

.cravio-shop-filters .filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cravio-shop-filters .filter-list li {
    margin-bottom: 10px;
}

.cravio-shop-filters .filter-list li:last-child {
    margin-bottom: 0;
}

.cravio-shop-filters .filter-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4a4636;
    cursor: pointer;
}

.cravio-shop-filters .filter-list input[type="checkbox"],
.cravio-shop-filters .filter-list input[type="radio"] {
    accent-color: #c9a227;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

#cravio-result-count {
    display: block;
    margin-bottom: 16px;
}

.cravio-no-products {
    display: block;
    width: 100%;
    padding: 40px 0;
    text-align: center;
    color: #999;
}

/* Mobile filter drawer (base state — hidden until small screens) */
.cravio-filter-toggle-btn {
    display: none;
}

#cravio-filter-overlay {
    display: none;
}

#cravio-filter-close {
    display: none;
    position: fixed;
    top: 16px;
    left: calc(min(85vw, 360px) - 110px);
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #e5e0d8;
    border-radius: 20px;
    padding: 6px 14px 6px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #1a1814;
    z-index: 10000;
}

#cravio-filter-close .close-icon {
    font-size: 18px;
    line-height: 1;
}


/* ==========================================================================
   MIN-WIDTH QUERIES
   ========================================================================== */

@media (min-width: 1201px) {
    .ast-separate-container .ast-woocommerce-container {
        padding: 4.34em 3em;
    }
}


/* ==========================================================================
   TABLET & BELOW  (max-width: 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
    .woocommerce-page .site-content .ast-container {
        display: flex;
        flex-direction: column !important;
    }

    .cravio-filter-toggle-btn {
        display: flex !important;
        align-items: center;
        gap: 8px;
        background: #ffffff;
        border: 1px solid #e5e0d8;
        border-radius: 6px;
        padding: 10px 18px;
        font-size: 14px;
        font-weight: 600;
        color: #1a1814;
        cursor: pointer;
        margin-bottom: 20px;
    }

    .cravio-filter-icon {
        font-size: 16px;
    }

    /* Tighter grid gap once column count drops from 4 */
    ul.products.columns-4 {
        gap: 16px;
    }

    /* Filter sidebar cards don't need full desktop padding */
    .cravio-shop-filters .filter-card {
        padding: 16px;
    }

    #secondary {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 85% !important;
        max-width: 360px !important;
        height: 100% !important;
        background: #f7f2e7 !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        padding: 20px !important;
        margin-bottom: 0 !important;
        transition: left 0.3s ease !important;
        margin-top: 0px;
    }

    body.cravio-sidebar-open #secondary {
        left: 0 !important;
    }

    #cravio-filter-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    body.cravio-sidebar-open #cravio-filter-overlay {
        opacity: 1;
        pointer-events: all;
    }

    body.cravio-sidebar-open #cravio-filter-close {
        display: flex;
    }

    #primary {
        width: 100% !important;
    }
}


/* ==========================================================================
   MOBILE  (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
    .woocommerce ul.products li.product .button {
        padding: 10px 0px;
        font-size: 12px;
        white-space: nowrap;
        width: 100%;
        text-align: center;
        border-radius: 4px;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    ul.products li.product {
        padding: 16px 12px !important;
    }

    ul.products.columns-4 {
        gap: 12px;
    }

    .cravio-shop-filters .filter-card {
        padding: 14px;
    }

    /* Prevent the min/max price inputs from overflowing the
       85vw-wide mobile filter drawer */
    .price-input-group input[type="number"] {
        width: 72px;
    }

    #secondary {
        padding: 15px !important;
    }
}