/* Only styles impossible to achieve with Bootstrap utilities */

/* Tabbed viewport layout */
.tabbed-container {
    display: flex;
    height: calc(100vh - 130px);
    overflow: hidden;
}

/* Left category tabs column */
.category-tabs {
    width: 70px;
    flex-shrink: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    cursor:pointer;
}
.category-tabs::-webkit-scrollbar { width: 3px; }
.category-tabs::-webkit-scrollbar-track { background: #f8f9fa; }
.category-tabs::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 2px; }
.category-tabs.hidden { display: none !important; }

/* Active tab arrow */
.category-tab.active::after {
    content: '';
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid #f8f9fa;
}

/* Tiny font for tab labels */
.category-name {
    font-size: 8px;
    font-weight: 600;
    line-height: 1.3;
    display: block;
    word-break: keep-all;
    overflow-wrap: normal;
    white-space: normal;
}

/* Scrollable content panel */
.content-area {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
}
.content-area::-webkit-scrollbar { width: 3px; }
.content-area::-webkit-scrollbar-track { background: #f8f9fa; }
.content-area::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 2px; }

/* 3-column subcategory grid */
.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 0 12px 12px;
}

/* Subcategory card min height & word wrap */
.subcategory-card {
    min-height: 110px;
    word-break: keep-all;
    overflow-wrap: normal;
    transition: transform .2s, box-shadow .2s, border-color .2s;
    cursor: pointer;
}
.subcategory-card:hover { transform: translateY(-2px); }

.subcategory-name {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    word-break: keep-all;
    overflow-wrap: normal;
    white-space: normal;
}

/* Brand chip checked state */
.brand-chip:has(input:checked) {
    background-color: var(--theme-color) !important;
    color: #fff !important;
    border-color: var(--theme-color) !important;
}

#absoluet { display: none; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE SCALE-UP
   The layout is designed mobile-first; these breakpoints scale the
   same tabbed design up for tablet and desktop so it stays good
   looking and usable on every screen size.
   ═══════════════════════════════════════════════════════════════ */

/* ── Tablet (≥ 768px) ── */
@media (min-width: 768px) {
    .tabbed-container { height: calc(100vh - 140px); }

    .category-tabs { width: 100px; }
    .category-tab img { width: 52px !important; height: 52px !important; }
    .category-name { font-size: 11px; }

    .subcategory-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
        padding: 4px 20px 20px;
    }
    .subcategory-card { min-height: 150px; }
    .subcategory-card img { width: 74px !important; height: 74px !important; }
    .subcategory-name { font-size: 13px; }
}

/* ── Desktop (≥ 992px) ── */
@media (min-width: 992px) {
    /* Use one natural page scroll instead of the mobile app-shell's nested
       scroll, so the desktop page shows a single scrollbar (not two). */
    .tabbed-container { height: auto; overflow: visible; align-items: flex-start; }
    .category-tabs   { overflow: visible; }
    .content-area    { overflow: visible; }

    .category-tabs { width: 130px; }
    .category-tab img { width: 60px !important; height: 60px !important; }
    .category-name { font-size: 12px; }

    /* Desktop: always keep the category rail visible, even while viewing
       products (mobile hides it via the .hidden class to reclaim space). */
    .category-tabs.hidden { display: block !important; }

    .subcategory-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 16px;
        padding: 8px 28px 28px;
    }
    .subcategory-card { min-height: 160px; }
    .subcategory-card:hover { box-shadow: 0 .5rem 1rem rgba(0,0,0,.12) !important; }
    .subcategory-card img { width: 84px !important; height: 84px !important; }
    .subcategory-name { font-size: 14px; }
}

/* ── Large desktop (≥ 1400px) ── */
@media (min-width: 1400px) {
    .subcategory-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM FILTER — top-bar button, active chips, off-canvas drawer
   ═══════════════════════════════════════════════════════════════ */

/* Filters button (lives in the back bar) */
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    border: none;
    /* background: var(--theme-color); */
    color: #fff;
    border-radius: 0.2rem;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.filter-btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.filter-btn:active { transform: translateY(0); }
.filter-btn .f-count {
    background: #fff;
    color: var(--theme-color);
    font-size: 11px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0 5px;
}

/* Product-type pills (live in the back bar, top of the products view) */
.type-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.type-pills::-webkit-scrollbar { display: none; }
.type-pill {
    flex-shrink: 0;
    padding: 6px 14px;
    border: 1px solid #e3e6ea;
    background: #fff;
    color: #374151;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.type-pill:hover { border-color: var(--theme-color); color: var(--theme-color); }
.type-pill.active { background: var(--theme-color); color: #fff; border-color: var(--theme-color); }

/* Active filter chips row */
.filter-active-row { row-gap: 8px !important; }
.f-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 13px;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    line-height: 1.4;
    transition: border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.f-chip:hover { border-color: var(--theme-color); color: var(--theme-color); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.f-chip .f-x { font-size: 15px; line-height: 1; opacity: .55; }
.f-chip:hover .f-x { opacity: 1; }
.f-clear-all {
    font-size: 12px;
    font-weight: 700;
    color: #e2504f;
    text-decoration: none;
    white-space: nowrap;
}
.f-clear-all:hover { text-decoration: underline; }

/* Backdrop + drawer */
.filter-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease;
    z-index: 1055;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.filter-backdrop.open { opacity: 1; visibility: visible; }

.filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 370px;
    max-width: 88vw;
    background: #fff;
    z-index: 1060;
    transform: translateX(100%);
    transition: transform .34s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    box-shadow: -14px 0 44px rgba(0,0,0,.18);
}
.filter-drawer.open { transform: translateX(0); }

.filter-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #eef0f2;
    flex-shrink: 0;
}
.filter-drawer__head h5 {
    margin: 0;
    font-weight: 700;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 9px;
}
.filter-drawer__head h5 i { color: var(--theme-color); font-size: 15px; }
.filter-drawer__close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #555;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, transform .15s ease;
}
.filter-drawer__close:hover { background: #e5e7eb; transform: rotate(90deg); }

.filter-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0 12px;
    scrollbar-width: thin;
}
.filter-drawer__body::-webkit-scrollbar { width: 5px; }
.filter-drawer__body::-webkit-scrollbar-thumb { background: #dfe3e8; border-radius: 5px; }

.f-section { border-bottom: 1px solid #f1f3f5; }
.f-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
}
.f-section__head .f-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
}
.f-section__head .f-title i { color: var(--theme-color); font-size: 13px; width: 16px; text-align: center; }
.f-section__head .f-caret { transition: transform .25s ease; color: #adb5bd; font-size: 12px; }
.f-section.collapsed .f-caret { transform: rotate(-90deg); }
.f-section__content { padding: 0 16px 14px; }
.f-section.collapsed .f-section__content { display: none; }

/* Category / sub-category nav links */
.f-navlist { display: flex; flex-direction: column; gap: 4px; }
.f-navlink {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: #444;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.f-navlink:hover { background: #f6f8f9; color: var(--theme-color); }
.f-navlink.active { background: #f0faf8; border-color: var(--theme-color); color: var(--theme-color); font-weight: 600; }
.f-navlink img { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.f-navlink > span { line-height: 1.3; }
.f-navlink .f-check { margin-left: auto; color: var(--theme-color); opacity: 0; font-size: 12px; }
.f-navlink.active .f-check { opacity: 1; }

/* Product type / brand check rows */
.f-check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 6px;
    margin: 0;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    border-radius: 8px;
    transition: background .15s ease;
}
.f-check-row:hover { background: #f8f9fa; }
.f-check-row input { position: absolute; opacity: 0; pointer-events: none; }
.f-check-box {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #cfd4da;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font: 900 11px/1 'Font Awesome 5 Free';
    transition: background .15s ease, border-color .15s ease;
}
.f-check-row input:checked + .f-check-box { background: var(--theme-color); border-color: var(--theme-color); }
.f-check-row input:checked + .f-check-box::after { content: '\f00c'; }

/* Sticky footer actions */
.filter-drawer__foot {
    display: flex;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid #eef0f2;
    flex-shrink: 0;
    background: #fff;
}
.f-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.f-btn-ghost { background: #fff; border-color: #dee2e6; color: #555; }
.f-btn-ghost:hover { background: #f8f9fa; }
.f-btn-primary { background: var(--theme-color); color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.f-btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }

body.filter-open { overflow: hidden; }

/* ═══ PRODUCT CARD CTA BUTTONS ═══
   cart.js re-renders the Add-to-Quote button (dropping inline styles), so size
   it by class. Mobile-first: compact so text never wraps on 2-col cards;
   larger on tablet/desktop where there's room. */

   .prod-card .add-to-quote-btn i{
    font-size: 20px;
    color:red;
   }

.prod-card .add-to-quote-btn {
    background: var(--theme-color) !important;
    color: #fff !important;
    border: none !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    padding: 8px 6px !important;
    border-radius: 8px !important;
    min-height: 38px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: none !important;
}
.prod-card .add-to-quote-btn:hover { filter: brightness(1.06); color: #fff !important; }
.prod-card .prod-wa-btn {
    font-size: 11.5px !important;
    font-weight: 600;
    padding: 8px 6px !important;
    border-radius: 8px !important;
    min-height: 38px;
    white-space: nowrap;
}
.prod-card .prod-wa-btn:hover { filter: brightness(1.06); color: #fff; }

/* Tablet & desktop: roomier buttons */
@media (min-width: 768px) {
    .prod-card .add-to-quote-btn,
    .prod-card .prod-wa-btn {
        font-size: 13px !important;
        padding: 10px !important;
        border-radius: 9px !important;
        min-height: 44px;
        gap: 7px;
    }
}