/* =========================================================
   ORSWELL MARKETPLACE CATEGORY — V1
   Amazon-inspired lightweight layout
   ========================================================= */


/* =========================================================
   MASTER WIDTH
   ========================================================= */

body.tax-product_cat #main-content .container,
body.post-type-archive-product #main-content .container {
    width: 90%;
    max-width: 1080px;
    padding-top: 28px;
}

body.tax-product_cat #left-area,
body.post-type-archive-product #left-area {
    width: 100% !important;
    padding: 0 !important;
    float: none !important;
}

body.tax-product_cat #sidebar,
body.post-type-archive-product #sidebar {
    display: none !important;
}


/* =========================================================
   CATEGORY HEADER
   ========================================================= */

body.tax-product_cat .woocommerce-products-header {
    margin-bottom: 18px;
}

body.tax-product_cat .woocommerce-products-header__title {
    margin: 0 0 10px;
    padding: 0;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    color: #111;
}

body.tax-product_cat .term-description {
    max-width: 900px;
    margin: 0;
    color: #444;
    font-size: 15px;
    line-height: 1.55;
}

body.tax-product_cat .term-description p {
    margin: 0;
    padding: 0;
}


/* =========================================================
   MARKETPLACE LAYOUT
   ========================================================= */

.orswell-marketplace-layout {
    display: flex;
    align-items: flex-start;
    width: 100%;
    gap: 28px;
    margin-top: 20px;
}


/* =========================================================
   LEFT FILTER SIDEBAR
   ========================================================= */

.orswell-filter-sidebar {
    flex: 0 0 220px;
    width: 220px;
    min-width: 220px;
    color: #0f1111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}


/* =========================================================
   FILTER SECTIONS
   ========================================================= */

.orswell-filter-section {
    margin: 0 0 18px;
    padding: 0 0 17px;
    border-bottom: 1px solid #ddd;
}

.orswell-filter-section:last-child {
    border-bottom: 0;
}

.orswell-filter-section h3 {
    margin: 0 0 9px;
    padding: 0;
    color: #0f1111;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 700;
}


/* =========================================================
   RELATED CATEGORIES
   ========================================================= */

.orswell-category-list,
.orswell-filter-links {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.orswell-category-list li,
.orswell-filter-links li {
    margin: 0 0 6px !important;
    padding: 0 !important;
    list-style: none !important;
    color: #0f1111;
    font-size: 14px;
}

.orswell-category-list a {
    color: #0f1111;
    text-decoration: none;
}

.orswell-category-list a:hover {
    color: #c40000;
    text-decoration: underline;
}

.orswell-current-category {
    font-weight: 600;
}

.orswell-current-category::before {
    content: "›";
    display: inline-block;
    margin-right: 5px;
    color: #555;
    font-weight: 700;
}


/* =========================================================
   CUSTOMER RATINGS
   ========================================================= */

.orswell-rating-filter {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.orswell-rating-filter > div {
    display: flex;
    align-items: center;
    color: #0f1111;
    cursor: default;
    white-space: nowrap;
}

.orswell-stars {
    margin-right: 5px;
    color: #ff9900;
    font-size: 17px;
    line-height: 1;
    letter-spacing: -2px;
}

.orswell-star-empty {
    margin-right: 5px;
    color: #b5b5b5;
    font-size: 17px;
    line-height: 1;
    letter-spacing: -2px;
}


/* =========================================================
   PRICE FILTER
   ========================================================= */

.orswell-filter-links span {
    color: #0f1111;
}

.orswell-price-custom {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.orswell-price-custom input {
    width: 67px;
    height: 34px;
    margin: 0;
    padding: 5px 7px;
    border: 1px solid #888;
    border-radius: 5px;
    outline: none;
    background: #fff;
    color: #111;
    font-size: 13px;
    box-shadow: none;
}

.orswell-price-custom input:focus {
    border-color: #111;
}

.orswell-price-custom button {
    height: 34px;
    margin: 0;
    padding: 0 11px;
    border: 1px solid #888;
    border-radius: 7px;
    background: #fff;
    color: #111;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.orswell-price-custom button:hover {
    background: #f3f3f3;
}


/* =========================================================
   CHECKBOXES
   ========================================================= */

.orswell-checkbox {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 6px 0;
    color: #0f1111;
    font-size: 14px;
    cursor: pointer;
}

.orswell-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #d90000;
    cursor: pointer;
}


/* =========================================================
   RIGHT PRODUCT AREA
   ========================================================= */

.orswell-product-results {
    flex: 1 1 auto;
    width: calc(100% - 248px);
    min-width: 0;
}


/* =========================================================
   RESULT COUNT + SORT
   ========================================================= */

.orswell-product-results .woocommerce-result-count {
    margin: 5px 0 20px;
    color: #565959;
    font-size: 13px;
}

.orswell-product-results .woocommerce-ordering {
    margin: 0 0 20px;
}

.orswell-product-results .woocommerce-ordering select {
    min-height: 34px;
    padding: 5px 30px 5px 10px;
    border: 1px solid #aaa;
    border-radius: 7px;
    background: #f7f8f8;
    color: #111;
    font-size: 13px;
}


/* =========================================================
   PRODUCT GRID
   Keep native WooCommerce functionality
   ========================================================= */

.orswell-product-results ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 18px;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

.orswell-product-results ul.products::before,
.orswell-product-results ul.products::after {
    display: none !important;
}

.orswell-product-results ul.products li.product {
    float: none !important;
    clear: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* =========================================================
   PRODUCT CARD
   ========================================================= */

.orswell-product-results li.product {
    background: #fff;
}

.orswell-product-results li.product a {
    text-decoration: none;
}

.orswell-product-results li.product img {
    display: block;
    width: 100%;
    height: 210px;
    margin: 0 0 12px !important;
    padding: 0;
    object-fit: contain;
    background: #fff;
}

.orswell-product-results li.product .woocommerce-loop-product__title {
    margin: 0 0 7px !important;
    padding: 0 !important;
    color: #0f1111;
    font-size: 15px !important;
    line-height: 1.35;
    font-weight: 500;
}

.orswell-product-results li.product a:hover .woocommerce-loop-product__title {
    color: #c40000;
}

.orswell-product-results li.product .price {
    display: block;
    margin: 5px 0 0 !important;
    color: #0f1111 !important;
    font-size: 19px !important;
    line-height: 1.2;
    font-weight: 600;
}

.orswell-product-results li.product .price del {
    margin-right: 4px;
    color: #666 !important;
    font-size: 13px;
    font-weight: 400;
}

.orswell-product-results li.product .price ins {
    color: #0f1111 !important;
    text-decoration: none;
    font-weight: 600;
}


/* =========================================================
   SALE BADGE
   ========================================================= */

.orswell-product-results .onsale {
    min-width: auto !important;
    min-height: auto !important;
    top: 8px !important;
    left: 8px !important;
    right: auto !important;
    margin: 0 !important;
    padding: 5px 8px !important;
    border-radius: 3px !important;
    background: #d90000 !important;
    color: #fff !important;
    font-size: 11px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 980px) {

    body.tax-product_cat #main-content .container,
    body.post-type-archive-product #main-content .container {
        width: 92%;
    }

    .orswell-marketplace-layout {
        gap: 20px;
    }

    .orswell-filter-sidebar {
        flex-basis: 190px;
        width: 190px;
        min-width: 190px;
    }

    .orswell-product-results {
        width: calc(100% - 210px);
    }

    .orswell-product-results ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   MOBILE
   V1: filters stack above products
   Later we'll make this a Filter button/drawer.
   ========================================================= */

@media (max-width: 767px) {

    body.tax-product_cat #main-content .container,
    body.post-type-archive-product #main-content .container {
        width: 92%;
        padding-top: 20px;
    }

    body.tax-product_cat .woocommerce-products-header__title {
        font-size: 25px;
    }

    .orswell-marketplace-layout {
        display: block;
        margin-top: 18px;
    }

    .orswell-filter-sidebar {
        width: 100%;
        min-width: 0;
        margin: 0 0 25px;
    }

    .orswell-product-results {
        width: 100%;
    }

    .orswell-product-results ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 12px;
    }

    .orswell-product-results li.product img {
        height: 180px;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .orswell-product-results ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .orswell-product-results li.product img {
        height: 150px;
    }

    .orswell-product-results li.product .woocommerce-loop-product__title {
        font-size: 14px !important;
    }

    .orswell-product-results li.product .price {
        font-size: 17px !important;
    }
}

/* =========================================================
   HIDE WOOCOMMERCE DEFAULT SORTING
   ========================================================= */

body.tax-product_cat .woocommerce-ordering,
body.post-type-archive-product .woocommerce-ordering {
    display: none !important;
}

/* =========================================================
   ORSWELL PRODUCT RESULTS — V2
   Amazon-inspired marketplace grid
   ========================================================= */


/* REMOVE DEFAULT SORTING */

body.tax-product_cat .woocommerce-ordering,
body.post-type-archive-product .woocommerce-ordering {
    display: none !important;
}


/* RESULTS AREA */

.orswell-product-results {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 0;
}


/* RESULT COUNT */

.orswell-product-results .woocommerce-result-count {
    display: block;
    width: 100%;
    margin: 2px 0 18px !important;
    padding: 0 0 10px;
    border-bottom: 1px solid #ddd;
    color: #565959;
    font-size: 13px;
    line-height: 1.4;
}


/* =========================================================
   PRODUCT GRID — 4 ACROSS
   ========================================================= */

.orswell-product-results ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    column-gap: 18px !important;
    row-gap: 34px !important;

    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;

    list-style: none !important;
}

.orswell-product-results ul.products::before,
.orswell-product-results ul.products::after {
    display: none !important;
}


/* PRODUCT */

.orswell-product-results ul.products li.product {
    position: relative !important;

    float: none !important;
    clear: none !important;

    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;

    text-align: left !important;
}


/* =========================================================
   PRODUCT IMAGE
   ========================================================= */

.orswell-product-results ul.products li.product a img {
    display: block !important;

    width: 100% !important;
    height: 210px !important;

    margin: 0 0 12px !important;
    padding: 8px !important;

    object-fit: contain !important;

    background: #fff !important;
    border: 0 !important;
}


/* =========================================================
   PRODUCT TITLE
   ========================================================= */

.orswell-product-results ul.products li.product
.woocommerce-loop-product__title {

    margin: 0 0 6px !important;
    padding: 0 !important;

    color: #0f1111 !important;

    font-size: 14px !important;
    line-height: 1.35 !important;
    font-weight: 500 !important;

    text-align: left !important;
}

.orswell-product-results ul.products li.product a:hover
.woocommerce-loop-product__title {

    color: #c40000 !important;
}


/* =========================================================
   STAR RATINGS
   Native WooCommerce reviews
   ========================================================= */

.orswell-product-results .star-rating {

    float: none !important;

    margin: 5px 0 6px !important;

    color: #ff9900 !important;

    font-size: 13px !important;
}


/* =========================================================
   PRICE
   ========================================================= */

.orswell-product-results ul.products li.product .price {

    display: flex !important;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;

    margin: 5px 0 0 !important;

    color: #0f1111 !important;

    font-size: 20px !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;

    text-align: left !important;
}


/* OLD PRICE */

.orswell-product-results ul.products li.product .price del {

    order: 2;

    margin: 0 !important;

    color: #777 !important;

    font-size: 12px !important;
    font-weight: 400 !important;

    opacity: 1 !important;
}


/* SALE PRICE */

.orswell-product-results ul.products li.product .price ins {

    order: 1;

    margin: 0 !important;

    color: #0f1111 !important;

    font-size: 20px !important;
    font-weight: 600 !important;

    text-decoration: none !important;
}


/* =========================================================
   SALE BADGE
   ========================================================= */

.orswell-product-results ul.products li.product .onsale {

    position: absolute !important;

    top: 8px !important;
    left: 8px !important;
    right: auto !important;

    z-index: 5;

    min-width: auto !important;
    min-height: auto !important;

    margin: 0 !important;
    padding: 5px 8px !important;

    border-radius: 2px !important;

    background: #d90000 !important;
    color: #fff !important;

    font-size: 11px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
}


/* =========================================================
   BUTTONS
   Hide default archive Add to Cart for cleaner
   Amazon-style browsing.
   Customer clicks product for full details.
   ========================================================= */

.orswell-product-results ul.products li.product .button {
    display: none !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .orswell-product-results ul.products {
        grid-template-columns:
            repeat(3, minmax(0, 1fr)) !important;
    }

}


/* =========================================================
   SMALL TABLET
   ========================================================= */

@media (max-width: 850px) {

    .orswell-product-results ul.products {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .orswell-product-results ul.products {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        column-gap: 12px !important;
        row-gap: 28px !important;
    }

    .orswell-product-results ul.products li.product a img {
        height: 170px !important;
        padding: 5px !important;
    }

    .orswell-product-results ul.products li.product
    .woocommerce-loop-product__title {

        font-size: 13px !important;
    }

    .orswell-product-results ul.products li.product .price,
    .orswell-product-results ul.products li.product .price ins {

        font-size: 18px !important;
    }

}

/* =========================================================
   ORSWELL CATEGORY PAGE — AMAZON-LIKE WIDE LAYOUT
   ========================================================= */

body.tax-product_cat #main-content .container {
    width: calc(100% - 40px) !important;
    max-width: 1600px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.tax-product_cat #left-area {
    width: 100% !important;
    max-width: none !important;
    padding-right: 0 !important;
}

body.tax-product_cat #main-content .container:before {
    display: none !important;
}