/* Hide compare checkboxes on shop-by-brands pages */
.view-id-brand_products .product-card__compare-wrap,
.view-brand-products .product-card__compare-wrap,
.path-shop-by-brands .product-card__compare-wrap {
    display: none !important;
}

/* =================================================
   SIDEBAR FILTERS (EXPOSED FILTERS)
   ================================================= */

.sidebar_first {
    padding-right: 30px;
    padding-top: 30px;
}

.sidebar_first .views-exposed-form {
    background: #ffffff !important;
    border: 1px solid #eee !important;
    border-radius: 12px;
    padding: 25px 25px 0px 25px;
}

.sidebar_first .views-exposed-form::before {
    content: "Filters";
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.sidebar_first .views-exposed-form form>div.d-flex {
    display: block !important;
    flex-direction: column !important;
}

.sidebar_first .fieldset-legend {
    text-transform: capitalize;
}

.sidebar_first .fieldset-wrapper ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.sidebar_first .fieldset-wrapper ul::-webkit-scrollbar {
    width: 4px;
}

.sidebar_first .fieldset-wrapper ul::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.sidebar_first .form-check {
    display: flex !important;
    align-items: center !important;
    padding-left: 0 !important;
    margin: 0 !important;
    cursor: pointer;
}

.sidebar_first .form-check-input {
    width: 18px !important;
    height: 18px !important;
    margin: 0 12px 0 0 !important;
    cursor: pointer;
    border: 1.5px solid #d1d1d1 !important;
    border-radius: 4px !important;
    background-color: #fff !important;
    transition: all 0.2s ease;
    float: none !important;
}

.sidebar_first .form-check-input:checked {
    background-color: #c40000 !important;
    border-color: #c40000 !important;
}

.sidebar_first .form-check-label {
    font-size: 14px !important;
    cursor: pointer !important;
    transition: color 0.2s ease;
    margin: 0 !important;
}

.sidebar_first .form-check:hover .form-check-label {
    color: #c40000 !important;
}

.sidebar_first .fieldset-legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
    color: #444 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
}

.sidebar_first .form-check {
    margin-bottom: 12px !important;
}

.sidebar_first .form-check-label {
    letter-spacing: -0.2px;
    color: #666 !important;
    font-weight: 500 !important;
}

.sidebar_first .views-exposed-form::before {
    color: #222 !important;
    font-size: 20px !important;
}

/* Hide Drupal's native Sort by / Order fields — sorting is handled
   by the custom toolbar dropdown which sets URL params directly. */
.sidebar_first .form-item--sort-by,
.sidebar_first .form-item--sort-order,
.sidebar_first .js-form-item-sort-by,
.sidebar_first .js-form-item-sort-order,
.sidebar_first [data-drupal-selector="edit-sort-by-wrapper"],
.sidebar_first [data-drupal-selector="edit-sort-order-wrapper"],
.sidebar_first .form-item.form-item-sort-by,
.sidebar_first .form-item.form-item-sort-order,
.sidebar_first label[for="edit-sort-by"],
.sidebar_first label[for="edit-sort-order"],
.sidebar_first #edit-sort-by,
.sidebar_first #edit-sort-order {
    display: none !important;
}

.sidebar_first .form-check-input:hover {
    border-color: #c40000 !important;
}

.sidebar_first input[type="range"] {
    accent-color: #c40000;
}

.sidebar_first .form-check-input:focus {
    box-shadow: none;
}

@media (min-width: 992px) {
    .sidebar_first.col-md-4 {
        flex: 0 0 28% !important;
        max-width: 28% !important;
    }

    .col-md-8.main-content {
        flex: 0 0 72% !important;
        max-width: 72% !important;
    }
}

/* =================================================
   PRODUCT LISTING (BRAND / CATEGORY PRODUCTS PAGE)
   ================================================= */

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    padding: 30px 0 20px 0;
}

.product-card {
    background: #ffffff;
    border: 1px solid #000;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    min-width: 0;
    box-sizing: border-box;
}

.product-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-color: #c40000;
    transform: translateY(-5px);
}

.product-card__image-wrapper {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.product-card__image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
    margin: 0 !important;
    display: block;
}

.product-card__content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
}

.product-card__brand {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    text-transform: capitalize;
    margin-bottom: 4px;
    line-height: 1.2;
}

.product-card__title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    width: 100%;
}

.product-card__title a {
    color: #000 !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-card__title a:hover {
    color: #c40000 !important;
}

.product-card__price-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: auto;
    margin-bottom: 14px;
    width: 100%;
}

.product-card__price-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.product-card__price {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.product-card__list-price {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 400;
}

.product-card__status {
    font-size: 12px;
    color: #28a745;
    font-weight: 600;
}

.product-card__stock-status {
    font-size: 13px;
    font-weight: 600;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-card__stock-status::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
}

.product-card__action {
    width: 100%;
}

.product-card__action .btn-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: #c40000;
    color: #ffffff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(196, 0, 0, 0.15);
    box-sizing: border-box;
}

.product-card__action .btn-add-to-cart:hover {
    background: #a80000;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(196, 0, 0, 0.25);
    color: #ffffff;
}

/* Container/Layout Tweaks for Brands Page */
#main-wrapper .container #main.col {
    padding-top: 40px;
}

/* Padding on #main.container — brand & category products pages ONLY */
.path-shop-by-brands #main.container,
.path-shop-by-category #main.container {
    padding-left: 30px;
    padding-right: 30px;
}

/* Responsive Grid for Products */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 15px 0;
    }

    .product-card {
        padding: 12px;
    }

    .product-card__title {
        font-size: 13px;
    }

    .product-card__price {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px 0;
    }

    .product-card {
        padding: 10px;
    }
}

/* =================================================
   PRODUCT LISTING (SEARCH PAGE SPECIFIC)
   ================================================= */

.product-grid--search {
    grid-template-columns: repeat(5, 1fr);
    padding: 30px 0 20px 0;
}

.product-card--search {
    padding: 12px;
}

.product-card--search .product-card__image-wrapper {
    padding: 5px;
}

@media (max-width: 1200px) {
    .product-grid--search {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .product-grid--search {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid--search {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
        padding: 15px 0;
    }
}

@media (max-width: 480px) {
    .product-grid--search {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
        padding: 10px 0;
    }
}

/* Empty view message */
.view-empty {
    padding-top: 30px;
}

.view-empty h2 {
    font-size: 24px;
    font-weight: 600;
    color: #444;
    margin: 0;
}

/* =================================================
   PAGINATION — Modern Red Pill Design (.xp-pager-wrapper)
   ================================================= */

.xp-pager-wrapper {
    margin-top: 36px;
    margin-bottom: 24px;
    border-top: 1px solid #f0f0f0;
    padding-top: 28px;
}

.xp-pager-wrapper nav {
    display: flex;
    justify-content: center;
}

.xp-pager-wrapper ul.pagination,
.xp-pager-wrapper .pager,
.xp-pager-wrapper ul.js-pager__items {
    display: flex !important;
    align-items: center;
    gap: 6px;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-wrap: wrap;
    justify-content: center;
    border: none !important;
}

.xp-pager-wrapper .page-item .page-link,
.xp-pager-wrapper .pager__item a,
.xp-pager-wrapper .pager__item span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 42px;
    height: 42px;
    padding: 0 14px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border: 1.5px solid #e8e8e8 !important;
    background: #ffffff !important;
    color: #222 !important;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    line-height: 1 !important;
}

.xp-pager-wrapper .page-item:not(.active) .page-link:hover,
.xp-pager-wrapper .pager__item a:hover {
    background: #fff5f5 !important;
    border-color: #c40000 !important;
    color: #c40000 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196,0,0,0.12) !important;
}

.xp-pager-wrapper .page-item.active .page-link,
.xp-pager-wrapper .page-item.active span.page-link,
.xp-pager-wrapper .pager__item.is-active a,
.xp-pager-wrapper .pager__item.is-active span {
    background: #c40000 !important;
    border-color: #c40000 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(196,0,0,0.32) !important;
    transform: translateY(-1px);
    cursor: default;
}

.xp-pager-wrapper .page-item:first-child .page-link,
.xp-pager-wrapper .page-item:last-child .page-link,
.xp-pager-wrapper .page-item .page-link[rel="next"],
.xp-pager-wrapper .page-item .page-link[rel="prev"],
.xp-pager-wrapper .pager__item--next a,
.xp-pager-wrapper .pager__item--previous a,
.xp-pager-wrapper .pager__item--first a,
.xp-pager-wrapper .pager__item--last a {
    padding: 0 16px !important;
    font-weight: 700 !important;
    color: #c40000 !important;
    border-color: #c40000 !important;
    background: #ffffff !important;
}

.xp-pager-wrapper .page-item:first-child .page-link:hover,
.xp-pager-wrapper .page-item:last-child .page-link:hover,
.xp-pager-wrapper .page-item .page-link[rel="next"]:hover,
.xp-pager-wrapper .page-item .page-link[rel="prev"]:hover,
.xp-pager-wrapper .pager__item--next a:hover,
.xp-pager-wrapper .pager__item--previous a:hover,
.xp-pager-wrapper .pager__item--first a:hover,
.xp-pager-wrapper .pager__item--last a:hover {
    background: #c40000 !important;
    color: #ffffff !important;
}

/* =================================================
   SORT TOOLBAR (.search-results-toolbar)
   ================================================= */

.search-results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fdfdfd;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 10px 18px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.search-results-toolbar .cat-results-toolbar__count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.search-results-toolbar .cat-results-toolbar__count svg {
    color: #c40000;
}

.search-results-toolbar .cat-sort-select {
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    padding: 8px 36px 8px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 170px;
}

.search-results-toolbar .cat-sort-select:hover,
.search-results-toolbar .cat-sort-select:focus {
    border-color: #c40000;
    box-shadow: 0 0 0 3px rgba(196, 0, 0, 0.08);
}


/* =================================================
   MOBILE FILTER DRAWER (off-canvas slide-in)
   ================================================= */

/* "Filter Products" sticky bar at top on mobile */
.mobile-filter-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 8px 0;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.mobile-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #c40000;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease;
}

.mobile-filter-toggle:hover,
.mobile-filter-toggle:active {
    background: #a30000;
}

/* Dimming overlay */
.sidebar-filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.filters-open .sidebar-filter-overlay {
    display: block;
    opacity: 1;
}

/* Off-canvas sidebar drawer — mobile & tablet only */
@media (max-width: 991.98px) {

    /* Prevent horizontal scroll on the page */
    body,
    #page-wrapper,
    #page,
    #main-wrapper {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Main content takes full width — sidebar is off-canvas */
    .main-content {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-top: 0 !important;
    }

    /* Remove normal sidebar spacing */
    .sidebar_first {
        padding-right: 0 !important;
        padding-top: 0 !important;
    }

    /* Sidebar hidden off-screen to the left */
    #sidebar_first {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 290px !important;
        max-width: 85vw !important;
        height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        background: #fff !important;
        z-index: 1050 !important;
        padding: 20px !important;
        transform: translateX(-100%) !important;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15) !important;
        border-radius: 0 !important;
        border-right: 1px solid #eee !important;
    }

    /* Slide sidebar in when open */
    body.filters-open #sidebar_first {
        transform: translateX(0) !important;
    }
}

/* Close button inside the drawer */
.sidebar-close-btn {
    display: block;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #444;
    cursor: pointer;
    margin-bottom: 12px;
    padding: 0;
    text-align: right;
    width: 100%;
    font-weight: 300;
    transition: color 0.2s ease;
}

.sidebar-close-btn:hover {
    color: #c40000;
}