/* ================================================
   GRACEFUL MOTION — 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: 320px;
    max-width: 85vw;
    height: 100vh;
    background: #ffffff;
    /* Clean white background for a professional feel */
    z-index: 9100;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
}

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

/* ── HEADER ─────────────────────────────────── */
.csb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px;
    background: #FFD700;
    /* Matching the contact bar yellow */
    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: 1rem;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.csb-brand-sub {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
}

.csb-close {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: #1a1a1a;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.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: 16px 20px;
    background: #f8f8f8;
    border-bottom: 1px solid #e5e5ea;
    flex-shrink: 0;
}

.csb-search-icon {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: #8e8e93;
    font-size: 0.9rem;
    pointer-events: none;
}

.csb-search-input {
    width: 100%;
    background: #ffffff;
    border: 1px solid #d1d1d6;
    border-radius: 8px;
    padding: 12px 16px 12px 40px;
    color: #1a1a1a;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s ease;
}

.csb-search-input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
}

/* ── 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.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #8E8E93;
    padding: 24px 20px 12px;
    text-transform: uppercase;
}

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

.csb-cat-item {
    border-bottom: 1px solid #F2F2F7;
    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: #F2F2F7;
}

/* 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: #1a1a1a;
    font-family: 'Inter', sans-serif;
}

.csb-cat-item.active>.csb-cat-row .csb-cat-label {
    color: #B8860B;
}

/* 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: #B8860B;
}

/* ── 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.165, 0.84, 0.44, 1);
    background: #ffffff;
}

.csb-sub-list.open {
    /* max-height set via JS */
}

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

.csb-view-all {
    font-size: 0.78rem;
    font-weight: 700;
    color: #B8860B;
    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: 12px 10px;
    color: #48484a;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.csb-sub-link:hover {
    color: #000;
    background: #F2F2F7;
    padding-left: 16px;
}

/* ── FOOTER ─────────────────────────────────── */
.csb-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: #ffffff;
    border-top: 1px solid #e5e5ea;
    flex-shrink: 0;
}

.csb-footer-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    color: #1a1a1a;
    background: #f2f2f7;
    border: 1px solid #d1d1d6;
    transition: all 0.2s ease;
}

.csb-footer-link.csb-whatsapp {
    background: #25D366;
    border-color: #25D366;
    color: #fff;
}

/* ── 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;
    }
}