/* G7 Catalog Sidebar v8.4.8 — Casa Portum */
:root {
    --g7-cat-brand: #FF751F;
    --g7-cat-border: #E8E8E8;
    --g7-cat-bg: #FFFFFF;
    --g7-cat-text: #1A1A1A;
    --g7-cat-muted: #777;
    --g7-cat-sidebar-w: 260px;
}

/* ---- 2-column layout wrapper ---- */
#g7-catalog-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    width: 100%;
}

/* ---- Sidebar ---- */
#g7-catalog-sidebar {
    flex: 0 0 var(--g7-cat-sidebar-w);
    width: var(--g7-cat-sidebar-w);
    background: var(--g7-cat-bg);
    border-radius: 14px;
    border: 1px solid var(--g7-cat-border);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

/* ---- Products column ---- */
#g7-catalog-products {
    flex: 1 1 0%;
    min-width: 0;
}

/* ---- Sidebar title ---- */
.g7-sidebar-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--g7-cat-muted);
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--g7-cat-border);
}

/* ---- Category item ---- */
.g7-cat-item {
    position: relative;
}

.g7-cat-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 44px 9px 20px;
    font-size: 14px;
    line-height: 1.3;
    color: var(--g7-cat-text);
    text-decoration: none !important;
    border-left: 3px solid transparent;
    transition: color .15s, background .15s, border-left-color .15s;
}

.g7-cat-link.no-children {
    padding-right: 20px;
}

.g7-cat-link:hover {
    color: var(--g7-cat-brand) !important;
    background: rgba(255,117,31,.05);
    border-left-color: var(--g7-cat-brand);
    text-decoration: none !important;
}

.g7-cat-link.g7-cat-active {
    color: var(--g7-cat-brand) !important;
    font-weight: 600;
    border-left-color: var(--g7-cat-brand);
    background: rgba(255,117,31,.07);
}

.g7-cat-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.g7-cat-count {
    font-size: 11px;
    color: var(--g7-cat-muted);
    background: #F2F2F2;
    border-radius: 20px;
    padding: 1px 7px;
    flex-shrink: 0;
    min-width: 22px;
    text-align: center;
}

/* ---- Expand/collapse toggle (span, not button) ---- */
.g7-cat-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #BBB;
    transition: color .15s;
    z-index: 1;
    user-select: none;
}

.g7-cat-toggle:hover {
    color: var(--g7-cat-brand);
}

.g7-cat-toggle svg {
    transition: transform .2s ease;
    flex-shrink: 0;
}

.g7-cat-toggle.open svg {
    transform: rotate(90deg);
}

/* ---- Sub-list ---- */
.g7-sub-list {
    display: none;
    background: #FAFAFA;
    border-top: 1px solid #F0F0F0;
    border-bottom: 1px solid #F0F0F0;
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.g7-sub-list.open {
    display: block;
}

/* Level 2 */
.g7-sub-list > .g7-cat-item > .g7-cat-link {
    padding-left: 34px;
    font-size: 13.5px;
}
.g7-sub-list > .g7-cat-item > .g7-cat-link.no-children {
    padding-right: 20px;
}

/* Level 3 */
.g7-sub-list .g7-sub-list > .g7-cat-item > .g7-cat-link {
    padding-left: 50px;
    font-size: 13px;
    color: #555;
}

/* ---- Mobile toggle ---- */
#g7-sidebar-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--g7-cat-bg);
    border: 1.5px solid var(--g7-cat-border);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--g7-cat-text);
    cursor: pointer;
    margin-bottom: 14px;
    width: 100%;
    transition: border-color .15s, color .15s;
}

#g7-sidebar-toggle:hover {
    border-color: var(--g7-cat-brand);
    color: var(--g7-cat-brand);
}

#g7-sidebar-toggle:focus,
#g7-sidebar-toggle:active {
    outline: none !important;
    box-shadow: none !important;
}

#g7-sidebar-toggle svg {
    color: var(--g7-cat-brand);
    flex-shrink: 0;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    #g7-catalog-layout {
        flex-direction: column;
        gap: 0;
    }

    #g7-catalog-sidebar {
        width: 100%;
        flex: 0 0 auto;
        position: static;
        max-height: none;
        overflow-y: visible;
        display: none;
        margin-bottom: 14px;
        border-radius: 10px;
    }

    #g7-catalog-sidebar.g7-mobile-open {
        display: block;
    }

    #g7-sidebar-toggle {
        display: flex;
    }
}

@media (min-width: 992px) {
    #g7-catalog-layout {
        flex-direction: row;
    }
}
