/* ==========================================================================
   Fastex Distribution - Wholesale Catalog Dedicated Stylesheet (products.css)
   B2B E-Commerce Standards | High Density | Pixel-Perfect Alignment
   ========================================================================== */

html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* 1. Page Header & Breadcrumbs */
.catalog-breadcrumbs .breadcrumb {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.catalog-breadcrumbs .breadcrumb-item a {
    color: #6B7280;
    text-decoration: none;
    transition: color 0.15s ease;
}

.catalog-breadcrumbs .breadcrumb-item a:hover {
    color: var(--fastex-red, #BB0027);
}

.catalog-header-bar {
    background: #FFFFFF;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    border: 1px solid #E5E7EB;
    margin-bottom: 1.5rem;
}

.catalog-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.catalog-subtitle {
    font-size: 0.85rem;
    color: #6B7280;
    margin-bottom: 0;
}

/* 2. Filter Sidebar Card */
.catalog-filter-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.catalog-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #E5E7EB;
}

.catalog-filter-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.catalog-filter-title i {
    color: #BB0027;
}

.catalog-filter-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* 3. Drill-Down Category Tree (Option 2 - Clean & Focused) */
.category-tree-container {
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

.category-tree-container::-webkit-scrollbar {
    width: 4px;
}

.category-tree-container::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

.category-tree-node {
    margin-bottom: 4px;
}

.category-tree-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-size: 0.86rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.category-tree-row:hover {
    background-color: #FEE2E2;
    color: #BB0027;
}

.category-tree-row.is-active {
    background-color: #FEE2E2;
    color: #BB0027;
    font-weight: 700;
}

.category-tree-row-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.category-indicator-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 0.75rem;
    color: #9CA3AF;
    flex-shrink: 0;
}

.category-node-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-subcats-pill {
    font-size: 0.72rem;
    color: #6B7280;
    font-weight: normal;
    white-space: nowrap;
    margin-left: 2px;
}

.category-badge-count {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 12px;
    background: #F3F4F6;
    color: #4B5563;
    border: 1px solid #E5E7EB;
    flex-shrink: 0;
    margin-left: 6px;
}

.category-tree-row.is-active .category-badge-count {
    background: #BB0027;
    color: #FFFFFF;
    border-color: #BB0027;
}

/* Drill-Down Selected Category Header */
.category-drilldown-header {
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-drilldown-title {
    font-weight: 800;
    color: #BB0027;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-back-link {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6B7280;
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 4px;
    margin-bottom: 8px;
    transition: color 0.15s ease;
}

.category-back-link:hover {
    color: #BB0027;
    background: #F3F4F6;
}

.subcategory-child-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #4B5563;
    font-size: 0.84rem;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.subcategory-child-row:hover {
    background-color: #FFF1F2;
    color: #BB0027;
}

.subcategory-child-row.is-active {
    background-color: #FEE2E2;
    color: #BB0027;
    font-weight: 700;
}

.subcategory-child-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.subcategory-child-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    background: #F3F4F6;
    color: #6B7280;
    border: 1px solid #E5E7EB;
    margin-left: 6px;
    flex-shrink: 0;
}

.subcategory-child-row.is-active .subcategory-child-badge {
    background: #BB0027;
    color: #FFFFFF;
    border-color: #BB0027;
}

/* 4. Active Filters Badges Bar */
.catalog-active-filters-bar {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #FEE2E2;
    color: #BB0027;
    border: 1px solid #FCA5A5;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 600;
}

.filter-pill a {
    color: #BB0027;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    line-height: 1;
    margin-left: 3px;
}

.filter-pill a:hover {
    color: #7F1D1D;
}

/* 5. Product Card Component (B2B Grid Layout) */
.catalog-product-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

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

/* Image Container */
.catalog-card-image-box {
    position: relative;
    height: 190px;
    background-color: #FAFAFA;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow: hidden;
    border-bottom: 1px solid #F3F4F6;
}

.catalog-card-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.catalog-product-card:hover .catalog-card-image {
    transform: scale(1.05);
}

/* Brand Pill Tag on Top-Left of Image */
.catalog-brand-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card Body Content */
.catalog-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.catalog-card-meta {
    font-size: 0.72rem;
    font-weight: 700;
    color: #BB0027;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.catalog-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    height: 2.5rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.catalog-card-title:hover {
    color: #BB0027;
}

/* Stock & SKU Status Row */
.catalog-card-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
}

.catalog-instock-pill {
    background-color: #DEF7EC;
    color: #03543F;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.catalog-sku-text {
    color: #9CA3AF;
    font-size: 0.72rem;
    font-weight: 500;
}

/* Pricing Row */
.catalog-card-pricing-row {
    padding-top: 0.65rem;
    border-top: 1px solid #F3F4F6;
    margin-bottom: 0.75rem;
}

.catalog-card-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #BB0027;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.catalog-card-unit {
    font-size: 0.72rem;
    color: #6B7280;
    font-weight: 500;
}

/* Bottom Actions Row */
.catalog-card-actions-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.catalog-stepper {
    display: flex;
    align-items: center;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    overflow: hidden;
    background: #FFFFFF;
    flex-shrink: 0;
}

.catalog-stepper-btn {
    background: #F9FAFB;
    border: none;
    color: #374151;
    font-weight: bold;
    width: 28px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    cursor: pointer;
    font-size: 0.85rem;
}

.catalog-stepper-btn:hover {
    background: #E5E7EB;
}

.catalog-stepper-input {
    width: 38px;
    height: 32px;
    border: none;
    border-left: 1px solid #E5E7EB;
    border-right: 1px solid #E5E7EB;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #111827;
    padding: 0;
}

.catalog-stepper-input:focus {
    outline: none;
}

.catalog-btn-add {
    flex: 1;
    height: 32px;
    background: #BB0027;
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.catalog-btn-add:hover {
    background: #990020;
    color: #FFFFFF;
}

.catalog-btn-add.is-added {
    background: #059669;
}

/* 6. List View Mode */
#catalog-grid.is-list-view .col-product-item,
#catalog-products-container.is-list-view .col-product-item {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

#catalog-grid.is-list-view .catalog-product-card,
#catalog-products-container.is-list-view .catalog-product-card,
.catalog-product-card.is-list-view {
    flex-direction: row;
    height: auto;
}

#catalog-grid.is-list-view .catalog-card-image-box,
#catalog-products-container.is-list-view .catalog-card-image-box,
.catalog-product-card.is-list-view .catalog-card-image-box {
    width: 220px;
    min-width: 220px;
    height: 200px;
    border-bottom: none;
    border-right: 1px solid #F3F4F6;
}

#catalog-grid.is-list-view .catalog-card-body,
#catalog-products-container.is-list-view .catalog-card-body,
.catalog-product-card.is-list-view .catalog-card-body {
    flex: 1;
}

/* 7. Pagination Styling */
.catalog-pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid #E5E7EB;
}

.catalog-pagination-info {
    font-size: 0.85rem;
    color: #6B7280;
    font-weight: 500;
}

.catalog-pagination-list .page-item .page-link {
    color: #374151;
    border-color: #E5E7EB;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.catalog-pagination-list .page-item.active .page-link {
    background-color: #BB0027;
    border-color: #BB0027;
    color: #FFFFFF;
    font-weight: 700;
}

.catalog-pagination-list .page-item .page-link:hover:not(.active) {
    background-color: #FEE2E2;
    color: #BB0027;
    border-color: #FCA5A5;
}

/* 8. Responsive Design & Mobile Breakpoints */
@media (max-width: 991.98px) {
    .category-navbar .nav {
        flex-wrap: nowrap;
        overflow-x: hidden;
        white-space: nowrap;
        justify-content: flex-start !important;
    }
    .category-dropdown-menu {
        min-width: 280px;
        max-width: calc(100vw - 24px) !important;
    }
}

@media (max-width: 767.98px) {
    #catalog-grid.is-list-view .catalog-product-card,
    #catalog-products-container.is-list-view .catalog-product-card,
    .catalog-product-card.is-list-view {
        flex-direction: column;
    }
    #catalog-grid.is-list-view .catalog-card-image-box,
    #catalog-products-container.is-list-view .catalog-card-image-box,
    .catalog-product-card.is-list-view .catalog-card-image-box {
        width: 100%;
        min-width: 100%;
        height: 160px;
        border-right: none;
        border-bottom: 1px solid #F3F4F6;
    }
    .catalog-header-bar {
        padding: 1rem;
    }
    .catalog-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 575.98px) {
    .catalog-card-image-box {
        height: 140px;
        padding: 8px;
    }
    .catalog-brand-badge {
        font-size: 0.58rem;
        padding: 2px 6px;
        top: 6px;
        left: 6px;
    }
    .catalog-card-body {
        padding: 0.65rem;
    }
    .catalog-card-meta {
        font-size: 0.65rem;
    }
    .catalog-card-title {
        font-size: 0.8rem;
        height: 2.1rem;
        margin-bottom: 0.25rem;
    }
    .catalog-card-status-row {
        font-size: 0.68rem;
        margin-bottom: 0.4rem;
    }
    .catalog-instock-pill {
        font-size: 0.65rem;
        padding: 1px 5px;
    }
    .catalog-card-price {
        font-size: 1.05rem;
    }
    .catalog-card-unit {
        font-size: 0.65rem;
    }
    .catalog-card-actions-row {
        gap: 0.35rem;
    }
    .catalog-stepper-btn {
        width: 22px;
        height: 28px;
        font-size: 0.75rem;
    }
    .catalog-stepper-input {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    .catalog-btn-add {
        height: 28px;
        font-size: 0.72rem;
        padding: 0 4px;
        gap: 2px;
    }
    .catalog-header-bar {
        padding: 0.75rem 0.85rem;
    }
    .catalog-title {
        font-size: 1.15rem;
    }
    .catalog-subtitle {
        font-size: 0.78rem;
    }
}

/* 9. Fixed Dark Universal Footer */
.footer-main {
    background-color: #12151A !important;
    color: #94A3B8 !important;
    font-size: 0.82rem;
    padding-top: 2.5rem;
    padding-bottom: 1.5rem;
    margin-top: 3rem;
}

.footer-main .logo-footer {
    height: 42px;
    max-height: 42px;
    width: auto;
    border-radius: 6px;
    background: white;
    padding: 3px;
    display: inline-block;
}

.footer-main h5 {
    color: #FFFFFF !important;
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-main h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 3px;
    background-color: #BB0027;
    border-radius: 2px;
}

.footer-main a {
    color: #94A3B8;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-main a:hover {
    color: #FFFFFF;
}

.footer-main .compliance-notice-box {
    background-color: #1A1D24;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    color: #94A3B8;
    font-size: 0.75rem;
    line-height: 1.45;
    margin-top: 1.5rem;
}

/* ==========================================================================
   Offcanvas & Modal Layering Architecture
   Guarantees that all Slide-out Drawers (Cart, Mobile Filters) and Backdrops
   strictly sit ABOVE all Navbars, Headers, and Page Elements
   ========================================================================== */
.category-navbar {
    z-index: 100 !important;
}

.offcanvas-backdrop,
.offcanvas-backdrop.show {
    z-index: 10400 !important;
}

.offcanvas,
.offcanvas.show,
#cartDrawer,
#filterSidebarMobile {
    z-index: 10450 !important;
}

.modal-backdrop,
.modal-backdrop.show {
    z-index: 10500 !important;
}

.modal,
.modal.show,
#ageVerificationModal {
    z-index: 10550 !important;
}
