/* ============================================================
   CATEGORY SIDEBAR OFFCANVAS
   ============================================================ */

/* ---- Offcanvas container ---- */
.cat-sidebar-offcanvas {
    width: 300px !important;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-right: none;
    box-shadow: 4px 0 32px rgba(15, 23, 42, 0.12);
}

@media (min-width: 992px) {
    .cat-sidebar-offcanvas {
        width: 320px !important;
    }
}

/* ---- Header ---- */
.cat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 16px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
    background: #0f172a;
    color: #ffffff;
}

.cat-sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #ffffff;
}

.cat-sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #ffffff;
    flex-shrink: 0;
}

.cat-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.18s ease;
    flex-shrink: 0;
}

.cat-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---- All categories shortcut ---- */
.cat-sidebar-all {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
    flex-shrink: 0;
}

.cat-sidebar-all-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #0f766e;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.18s ease, color 0.18s ease;
}

.cat-sidebar-all-link:hover {
    background: #f0fdf9;
    color: #0d5c55;
}

.cat-all-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0f766e;
    flex-shrink: 0;
}

.cat-all-arrow {
    margin-left: auto;
    opacity: 0.6;
    transition: transform 0.18s ease;
}

.cat-sidebar-all-link:hover .cat-all-arrow {
    transform: translateX(3px);
    opacity: 1;
}

/* ---- Scrollable body ---- */
.cat-sidebar-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

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

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

.cat-sidebar-body::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.cat-sidebar-body::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* ---- Category list ---- */
.cat-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0 8px;
}

.cat-sidebar-item {
    margin-bottom: 2px;
}

/* Shared row styles (both <a> and <button>) */
.cat-sidebar-row {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
}

.cat-sidebar-row:hover {
    background: #f1f5f9;
    color: #0f172a;
    text-decoration: none;
}

/* Parent row: link fills most of the row, chevron button on the right */
.cat-sidebar-row--parent {
    display: flex;
    align-items: center;
    padding: 0;
    gap: 0;
}

.cat-sidebar-row-link {
    display: flex;
    align-items: center;
    gap: 11px;
    flex: 1;
    min-width: 0;
    padding: 9px 8px 9px 10px;
    border-radius: 10px 0 0 10px;
    text-decoration: none;
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.cat-sidebar-row-link:hover {
    background: #f1f5f9;
    color: #0f172a;
    text-decoration: none;
}

.cat-sidebar-chevron-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 100%;
    min-height: 44px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 0 10px 10px 0;
    padding: 0;
    color: #94a3b8;
    transition: background 0.15s ease, color 0.15s ease;
}

.cat-sidebar-chevron-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Active state when accordion is open */
.cat-sidebar-chevron-btn[aria-expanded="true"] {
    background: #f0fdf9;
    color: #0f766e;
}

.cat-sidebar-chevron-btn[aria-expanded="true"] .cat-sidebar-chevron {
    transform: rotate(180deg);
}

.cat-sidebar-row--parent:has(.cat-sidebar-chevron-btn[aria-expanded="true"]) .cat-sidebar-row-link {
    background: #f0fdf9;
    color: #0f766e;
}

/* ---- Thumbnail ---- */
.cat-sidebar-thumb {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cat-sidebar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cat-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: inherit;
}

/* ---- Category name ---- */
.cat-sidebar-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

/* ---- Product count badge ---- */
.cat-sidebar-count {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 20px;
    padding: 2px 7px;
    flex-shrink: 0;
    line-height: 1.5;
}

.cat-sidebar-toggle[aria-expanded="true"] .cat-sidebar-count {
    background: #d1fae5;
    color: #0f766e;
}

/* ---- Chevron ---- */
.cat-sidebar-chevron {
    display: flex;
    align-items: center;
    color: #94a3b8;
    transition: transform 0.22s ease;
    flex-shrink: 0;
}

/* ---- Subcategory list ---- */
.cat-sub-list {
    padding: 2px 0 4px 16px;
}

.cat-sub-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid #e2e8f0;
    padding-left: 12px;
}

.cat-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px 7px 0;
    font-size: 13px;
    color: #475569;
    text-decoration: none;
    transition: color 0.15s ease;
    border-radius: 6px;
}

.cat-sub-item:hover {
    color: #0f766e;
    text-decoration: none;
}

.cat-sub-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.cat-sub-item:hover .cat-sub-dot {
    background: #0f766e;
}

.cat-sub-count {
    margin-left: auto;
    font-size: 11px;
    color: #94a3b8;
}

/* ---- Empty state ---- */
.cat-sidebar-empty {
    padding: 24px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* ---- Footer ---- */
.cat-sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.cat-sidebar-shop-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: #0f172a;
    color: #ffffff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease, transform 0.18s ease;
}

.cat-sidebar-shop-btn:hover {
    background: #0f766e;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ============================================================
   HEADER TRIGGER BUTTONS
   ============================================================ */

/* Desktop categories hamburger button — left column, icon only */
.cat-nav-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.cat-nav-trigger:hover {
    background: #0f766e;
    transform: translateY(-1px);
}

/* Hamburger lines inside trigger */
.cat-nav-hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 18px;
    flex-shrink: 0;
}

.cat-nav-hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 2px;
    transition: width 0.2s ease;
}

.cat-nav-hamburger span:nth-child(2) {
    width: 75%;
}

.cat-nav-hamburger span:nth-child(3) {
    width: 50%;
}

.cat-nav-trigger:hover .cat-nav-hamburger span {
    width: 100%;
}

/* Mobile category grid icon button */
.cat-nav-trigger-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #0f172a;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    flex-shrink: 0;
    padding: 0;
}

.cat-nav-trigger-mobile:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* ---- Backdrop tint override ---- */
.offcanvas-backdrop {
    background: rgba(15, 23, 42, 0.5);
}
