/* ================================================
   TWAKAS HARDWARE — Category Sidebar v3
   Premium slide-in sidebar panel
   ================================================ */

/* ── OLD MEGA MENU — hide completely ──────────── */
.mega-menu,
.mega-menu-content,
.mega-sidebar,
.mega-category-item,
.mega-main,
.mega-title,
.mega-grid,
.mega-subcategory-link {
    display: none !important;
}

/* ── OVERLAY ────────────────────────────────── */
.csb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.csb-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

/* ── SIDEBAR PANEL ──────────────────────────── */
.csb-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    background: #1A1D1E;
    z-index: 9100;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    box-shadow: 6px 0 40px rgba(0, 0, 0, 0.5);
}

.csb-panel.open {
    transform: translateX(0);
}

/* ── HEADER ─────────────────────────────────── */
.csb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    background: linear-gradient(135deg, #1a0000 0%, #0d0d1a 100%);
    border-bottom: 2px solid var(--accent-primary);
    flex-shrink: 0;
}

.csb-header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.csb-header-logo img {
    height: 44px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.csb-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.csb-brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.csb-brand-sub {
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.csb-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.csb-close:hover {
    background: rgba(211, 47, 47, 0.3);
    border-color: rgba(211, 47, 47, 0.5);
    color: #fff;
    transform: rotate(90deg);
}

/* ── SEARCH ─────────────────────────────────── */
.csb-search-wrap {
    position: relative;
    padding: 14px 16px;
    background: #1a1a24;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.csb-search-icon {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    pointer-events: none;
}

.csb-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 10px 16px 10px 40px;
    color: #fff;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.25s ease;
}

.csb-search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.csb-search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(45, 52, 54, 0.12);
}

/* ── SCROLLABLE BODY ─────────────────────────── */
.csb-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 0 12px;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(184, 134, 11, 0.3) transparent;
}

.csb-body::-webkit-scrollbar {
    width: 4px;
}

.csb-body::-webkit-scrollbar-track {
    background: transparent;
}

.csb-body::-webkit-scrollbar-thumb {
    background: rgba(184, 134, 11, 0.3);
    border-radius: 4px;
}

.csb-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.25);
    padding: 16px 20px 8px;
    text-transform: uppercase;
}

/* ── CATEGORY LIST ──────────────────────────── */
.csb-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.csb-cat-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

/* The clickable row */
.csb-cat-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.csb-cat-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.csb-cat-item.active>.csb-cat-row {
    background: rgba(184, 134, 11, 0.08);
}

/* Icon */
.csb-cat-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.csb-cat-item.active>.csb-cat-row .csb-cat-icon-wrap {
    transform: scale(1.1);
}

/* Label */
.csb-cat-label {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Inter', sans-serif;
}

.csb-cat-item.active>.csb-cat-row .csb-cat-label {
    color: var(--accent-primary);
}

/* Item count badge */
.csb-cat-count {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 2px 8px;
    flex-shrink: 0;
}

/* Chevron */
.csb-chevron {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.25);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-shrink: 0;
}

.csb-cat-item.active>.csb-cat-row .csb-chevron {
    transform: rotate(90deg);
    color: var(--accent-primary);
}

/* ── SUBCATEGORY LIST (ACCORDION) ───────────── */
.csb-sub-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}


/* "View all" header row */
.csb-sub-header {
    padding: 10px 20px 6px 56px;
}

.csb-view-all {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.csb-view-all i {
    font-size: 0.65rem;
    transition: transform 0.2s;
}

.csb-view-all:hover {
    color: #d4a017;
}

.csb-view-all:hover i {
    transform: translateX(3px);
}

/* Individual subcategory */
.csb-sub-item {
    padding: 0 16px 0 56px;
}

.csb-sub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.csb-sub-link i {
    font-size: 0.6rem;
    color: rgba(184, 134, 11, 0.5);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.csb-sub-link:hover {
    color: #fff;
    background: rgba(184, 134, 11, 0.1);
    padding-left: 14px;
}

.csb-sub-link:hover i {
    transform: translateX(2px);
    color: var(--accent-primary);
}

/* ── FOOTER ─────────────────────────────────── */
.csb-footer {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    background: #0d0d16;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.csb-footer-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
}

.csb-footer-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateY(-2px);
}

.csb-footer-link.csb-whatsapp {
    background: rgba(37, 211, 102, 0.1);
    border-color: rgba(37, 211, 102, 0.2);
    color: #25D366;
}

.csb-footer-link.csb-whatsapp:hover {
    background: rgba(37, 211, 102, 0.2);
    color: #25D366;
}

/* ── MOBILE ─────────────────────────────────── */
@media (max-width: 600px) {
    .csb-panel {
        width: 100vw;
        max-width: 100vw;
    }

    .csb-cat-label {
        font-size: 0.9rem;
    }

    .csb-sub-link {
        font-size: 0.85rem;
    }
}