/* NovaCategory 2.0 premium styling namespaced under .nova-category-page */

.nova-category-page {
    --nova-primary: #121016;
    --nova-accent: #c9a227;
    --nova-accent-rgb: 201, 162, 39;
    --nova-bg-light: #f9f9fb;
    --nova-text-dark: #121016;
    --nova-text-muted: #75727c;
    --nova-card-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    --nova-card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.08);
    --nova-border-radius: 16px;
    --nova-transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Category Page layout enhancements */
.nova-category-page .card-nova {
    border: 1px solid #f1eff5;
    background: #ffffff;
    border-radius: var(--nova-border-radius);
    box-shadow: var(--nova-card-shadow);
    transition: var(--nova-transition);
}

.nova-category-page .card-nova:hover {
    box-shadow: var(--nova-card-shadow-hover);
}

/* Filter groups: quieter panels (avoid heavy nested-card look) */
.nova-category-page .nova-filter-drawer-body > .card-nova,
.nova-filter-drawer .nova-filter-drawer-body > .card-nova {
    box-shadow: none;
    border-color: #eceaf1;
}

.nova-category-page .nova-filter-drawer-body .form-check,
.nova-filter-drawer .nova-filter-drawer-body .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.45rem 0.35rem;
    margin-bottom: 0 !important;
    border-radius: 10px;
    min-height: 2.35rem;
}

.nova-category-page .nova-filter-drawer-body .form-check:hover,
.nova-filter-drawer .nova-filter-drawer-body .form-check:hover {
    background: #faf9fc;
}

.nova-category-page .nova-filter-drawer-body .form-check-input,
.nova-filter-drawer .nova-filter-drawer-body .form-check-input {
    margin-top: 0.28rem;
    margin-left: 0;
    margin-right: 0;
    float: none;
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    position: relative;
}

.nova-category-page .nova-filter-drawer-body .form-check-label,
.nova-filter-drawer .nova-filter-drawer-body .form-check-label {
    line-height: 1.4;
    word-break: break-word;
    flex: 1 1 auto;
    padding-top: 0.05rem;
    text-align: start;
}

/* Mobile filter bar (scrolls with page — not sticky) */
.nova-category-page .nova-mobile-filterbar {
    position: static;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #eceaf1;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.75rem;
}

.nova-category-page .nova-active-filter-chips {
    margin-bottom: 1rem;
}

.nova-category-page .nova-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.35rem 0.65rem;
    border: 1px solid #e2dee8;
    border-radius: 999px;
    background: #fff;
    color: var(--nova-text-dark, #2b2436);
    font-size: 0.8125rem;
    line-height: 1.2;
    text-decoration: none;
}

.nova-category-page .nova-filter-chip:hover {
    border-color: var(--nova-accent, #c9a227);
    color: var(--nova-accent, #c9a227);
}

.nova-category-page .nova-filter-chip-x {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.65;
}

.nova-category-page .nova-filter-chip-clear {
    color: #6c6578;
    text-decoration: none;
    white-space: nowrap;
}

.nova-category-page .nova-filter-chip-clear:hover {
    color: var(--nova-accent, #c9a227);
    text-decoration: underline;
}

/* Scrollbar styles */
.nova-category-page .custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.nova-category-page .custom-scrollbar::-webkit-scrollbar-track {
    background: #f1eff5;
    border-radius: 10px;
}
.nova-category-page .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #d4cfdd;
    border-radius: 10px;
}
.nova-category-page .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--nova-accent);
}

/* Loading Skeleton Shimmer Animation */
@keyframes novaShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.nova-category-page .nova-skeleton-item {
    background: linear-gradient(90deg, #f3f1f6 25%, #e8e5ed 50%, #f3f1f6 75%);
    background-size: 200% 100%;
    animation: novaShimmer 1.5s infinite;
}

/* Sidebar scrolls with the page (no sticky filters on desktop) */
@media (min-width: 992px) {
    .nova-category-page .nova-filter-drawer {
        position: static;
        max-height: none;
        overflow: visible;
        padding-inline-end: 4px;
    }

    .nova-category-page .nova-filter-drawer-content {
        display: block;
        max-height: none;
        overflow: visible;
        padding-inline-end: 4px;
    }

    .nova-category-page .nova-filter-drawer-body {
        padding: 0 !important;
    }
}

/* Custom Luxury Checkbox Inputs & Labels */
.nova-category-page .form-check-input {
    border-color: #d4cfdd;
    cursor: pointer;
    transition: var(--nova-transition);
}
.nova-category-page .form-check-input:checked {
    background-color: var(--nova-accent);
    border-color: var(--nova-accent);
}
.nova-category-page .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(201, 162, 39, 0.25);
    border-color: var(--nova-accent);
}
.nova-category-page .form-check-label {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--nova-text-dark);
    user-select: none;
    transition: var(--nova-transition);
}
.nova-category-page .form-check-input:checked + .form-check-label {
    font-weight: 600;
}

/* Collapsible Filter Groups */
.nova-category-page .nova-filter-toggle,
.nova-filter-drawer .nova-filter-toggle {
    background: none;
    border: none;
    width: 100%;
    text-align: inherit;
    padding: 0;
    font-weight: 700;
    color: #121016;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.nova-category-page .nova-filter-toggle .bi-chevron-down,
.nova-filter-drawer .nova-filter-toggle .bi-chevron-down {
    transition: transform 0.3s ease;
    font-size: 0.95rem;
    color: #75727c;
    flex-shrink: 0;
}
.nova-category-page .nova-filter-toggle.collapsed .bi-chevron-down,
.nova-filter-drawer .nova-filter-toggle.collapsed .bi-chevron-down {
    transform: rotate(-90deg);
}
.nova-category-page .nova-filter-content,
.nova-filter-drawer .nova-filter-content {
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, margin-top 0.3s ease;
    overflow: hidden;
    max-height: 800px;
    opacity: 1;
}
.nova-category-page .nova-filter-content.collapsed,
.nova-filter-drawer .nova-filter-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Inline Search Filters */
.nova-category-page .nova-filter-search-box,
.nova-filter-drawer .nova-filter-search-box {
    position: relative;
}
.nova-category-page .nova-filter-search-box input,
.nova-filter-drawer .nova-filter-search-box input {
    padding-left: 30px;
    background: #f8f6fb;
    border: 1px solid #f1eff5;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.nova-category-page .nova-filter-search-box input:focus,
.nova-filter-drawer .nova-filter-search-box input:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
    border-color: #c9a227;
}
.nova-category-page .nova-filter-search-box i,
.nova-filter-drawer .nova-filter-search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #75727c;
    font-size: 0.85rem;
    pointer-events: none;
}
html[dir="rtl"] .nova-category-page .nova-filter-search-box input,
html[dir="rtl"] .nova-filter-drawer .nova-filter-search-box input {
    padding-left: 12px;
    padding-right: 30px;
}
html[dir="rtl"] .nova-category-page .nova-filter-search-box i,
html[dir="rtl"] .nova-filter-drawer .nova-filter-search-box i {
    left: auto;
    right: 10px;
}

/* Hierarchical category filter (RTL-aware nesting) */
.nova-cat-filter-tree {
    text-align: start;
    direction: inherit;
}
.nova-cat-filter-node.form-check {
    direction: inherit;
    text-align: start;
    /* Flex layout replaces Bootstrap’s float padding; indent via margin */
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
    margin-inline-start: calc(var(--nova-cat-depth, 0) * 0.85rem);
}
.nova-cat-filter-node .form-check-label {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.2rem 0.35rem;
    text-align: start;
}
.nova-cat-filter-branch {
    display: inline-block;
    color: #94a3b8;
    font-weight: 600;
    line-height: 1;
    margin-inline-end: 0.15rem;
}
.nova-cat-filter-branch::before {
    content: "↳";
}
html[dir="rtl"] .nova-cat-filter-branch {
    transform: scaleX(-1);
}
.nova-cat-filter-name {
    text-align: start;
}

/* Override Bootstrap float radio/checkbox when we use flex row layout.
   Styles must live under .nova-filter-drawer — drawer is portaled to <body> on mobile. */
.nova-filter-drawer .form-check,
.nova-category-page .nova-filter-drawer-body .form-check {
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
}
html[dir="rtl"] .nova-filter-drawer .form-check-input,
html[dir="rtl"] .nova-category-page .nova-filter-drawer-body .form-check-input {
    float: none;
    margin-left: 0;
    margin-right: 0;
}

/* Cards inside drawer (works when portaled outside .nova-category-page) */
.nova-filter-drawer .card-nova {
    border: 1px solid #f1eff5;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: none;
}
.nova-filter-drawer .nova-filter-drawer-body > .card-nova,
.nova-filter-drawer .nova-catalog-filters > .card-nova,
.nova-filter-drawer-body.nova-catalog-filters > .card-nova {
    border-color: #eceaf1;
    /* Collapsible groups already pad via inner .p-3; cancel redesign card padding */
    padding: 0 !important;
    transform: none !important;
    box-shadow: none !important;
}
.nova-filter-drawer .nova-filter-drawer-body > .card-nova.p-3,
.nova-filter-drawer-body.nova-catalog-filters > .card-nova.p-3 {
    padding: 1rem !important;
}
.nova-filter-drawer .form-check-input:checked {
    background-color: #c9a227;
    border-color: #c9a227;
}
.nova-filter-drawer .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}
.nova-filter-drawer .custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.nova-filter-drawer .custom-scrollbar::-webkit-scrollbar-track {
    background: #f1eff5;
    border-radius: 10px;
}
.nova-filter-drawer .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #d4cfdd;
    border-radius: 10px;
}

/* Mobile drawer hierarchical menu indent */
.nova-mobile-drawer__nav a.nova-mobile-nav-nested {
    text-align: start;
}

/* Mobile Bottom-Sheet Drawer
   Keep display:flex always so slide transitions work; hide with visibility/opacity. */
@media (max-width: 991.98px) {
    .nova-category-page .col-filter-sidebar {
        width: 0 !important;
        max-width: 0 !important;
        flex: 0 0 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        min-height: 0 !important;
        border: 0 !important;
    }

    .nova-category-page .col-filter-sidebar + [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .nova-filter-drawer,
    .nova-category-page .nova-filter-drawer {
        position: fixed;
        inset: 0;
        z-index: 1080;
        margin: 0;
        background: rgba(18, 16, 22, 0.42);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        display: flex;
        align-items: flex-end;
        justify-content: stretch;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }
    .nova-filter-drawer.open,
    .nova-category-page .nova-filter-drawer.open {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
    .nova-filter-drawer-content,
    .nova-category-page .nova-filter-drawer-content {
        background: #fff;
        width: 100%;
        max-height: min(90vh, 100dvh);
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        display: flex;
        flex-direction: column;
        min-height: 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
        transform: translateY(110%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .nova-filter-drawer.open .nova-filter-drawer-content,
    .nova-category-page .nova-filter-drawer.open .nova-filter-drawer-content {
        transform: translateY(0);
    }
    .nova-filter-drawer-header,
    .nova-category-page .nova-filter-drawer-header {
        flex-shrink: 0;
        position: relative;
        padding-top: 1.15rem !important;
        background: #fff !important;
        border-bottom: 1px solid #f1eff5 !important;
    }
    .nova-filter-drawer-header::before {
        content: "";
        position: absolute;
        top: 0.45rem;
        left: 50%;
        transform: translateX(-50%);
        width: 42px;
        height: 4px;
        border-radius: 999px;
        background: #d9d4e0;
    }
    .nova-filter-drawer-body,
    .nova-category-page .nova-filter-drawer-body {
        overflow-y: auto;
        overflow-x: hidden;
        flex: 1 1 auto;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 0.85rem !important;
        background: #f7f6f9;
    }
    .nova-filter-drawer-body > .card-nova {
        margin-bottom: 0.65rem !important;
        border-radius: 14px;
        background: #fff;
        /* Collapsible groups use inner .p-3 — don't add outer card padding */
        padding: 0 !important;
        transform: none !important;
        box-shadow: none !important;
    }
    .nova-filter-drawer-body > .card-nova.p-3 {
        padding: 0.85rem !important;
    }
    .nova-filter-drawer .nova-filter-toggle {
        min-height: 1.5rem;
        font-size: 0.95rem;
    }
    .nova-filter-drawer .custom-scrollbar {
        padding-inline-end: 0.35rem;
        max-height: min(220px, 40vh);
    }
    .nova-filter-drawer .input-group .form-control,
    .nova-filter-drawer .input-group .btn {
        min-height: 42px;
    }
    .nova-filter-drawer .row.g-2 > [class*="col-"] {
        min-width: 0;
    }
    .nova-filter-drawer input[type="number"].form-control-sm {
        min-height: 38px;
        font-size: 0.9rem;
    }
    .nova-filter-drawer-footer,
    .nova-category-page .nova-filter-drawer-footer {
        flex-shrink: 0;
        background: #ffffff;
        box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.06);
        padding: 0.85rem !important;
        padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px)) !important;
        gap: 0.65rem !important;
    }
    .nova-filter-drawer-footer .btn {
        border-radius: 12px;
        min-height: 46px;
    }

    /* Toolbar: stack cleanly on phones */
    .nova-category-page .nova-toolbar {
        padding: 0.85rem !important;
        gap: 0.75rem !important;
        margin-bottom: 1rem !important;
    }
    .nova-category-page .nova-toolbar > .d-flex:first-child {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    .nova-category-page .nova-toolbar .nova-toolbar-controls {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem !important;
    }
    .nova-category-page .nova-toolbar .form-select {
        max-width: none;
        min-width: 0;
        flex: 1 1 auto;
        font-size: 0.82rem;
        border-radius: 10px !important;
    }
    .nova-category-page .nova-toolbar .btn-group .btn {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }
    .nova-category-page .nova-toolbar .badge.rounded-pill {
        font-weight: 500;
        max-width: 100%;
        white-space: normal;
        text-align: start;
        line-height: 1.3;
    }
    .nova-category-page .nova-pagesize-wrap {
        display: none !important;
    }
}

/* Scroll Blockers when Drawer is open */
html.drawer-open {
    overflow: hidden !important;
}
body.drawer-open {
    overflow: hidden !important;
    position: fixed !important;
    inset-inline: 0;
    width: 100%;
}

/* Pagination Custom Styles */
.nova-category-page .pagination-nova .page-item {
    margin: 0 3px;
}
.nova-category-page .pagination-nova .page-link {
    border: none;
    background: #f8f6fb;
    color: var(--nova-text-muted);
    border-radius: 8px !important;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: var(--nova-transition);
}
.nova-category-page .pagination-nova .page-item.active .page-link {
    background: var(--nova-accent);
    color: white;
    box-shadow: 0 4px 10px rgba(201, 162, 39, 0.3);
}
.nova-category-page .pagination-nova .page-link:hover:not(.active) {
    background: #f1eff5;
    color: var(--nova-text-dark);
}

/* Toolbar scrolls with the page (no floating sticky bar) */
.nova-category-page .nova-toolbar {
    position: static;
    border-radius: var(--nova-border-radius);
    transition: var(--nova-transition);
}

.nova-category-page .nova-toolbar .btn-group .btn {
    border: none !important;
    background: #f8f6fb;
    color: var(--nova-text-muted);
    transition: var(--nova-transition);
}

.nova-category-page .nova-toolbar .btn-group .btn.active {
    background: var(--nova-accent);
    color: #ffffff !important;
}
.nova-category-page .nova-toolbar .btn-group .btn.active i {
    color: #ffffff !important;
}

/* Horizontal List View Mode */
.nova-category-page #productsGrid.nova-list-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nova-category-page #productsGrid.nova-list-view .product-item {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

.nova-category-page #productsGrid.nova-list-view .nova-product-card {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    padding: 16px;
    gap: 20px;
}

.nova-category-page #productsGrid.nova-list-view .nova-product-card__media {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
    margin-bottom: 0 !important;
}

.nova-category-page #productsGrid.nova-list-view .card-body {
    flex: 1;
    padding: 0 !important;
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.nova-category-page #productsGrid.nova-list-view .card-body .mt-auto {
    margin-top: 0 !important;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

@media (max-width: 576px) {
    .nova-category-page #productsGrid.nova-list-view .nova-product-card {
        flex-direction: column !important;
        align-items: stretch;
    }
    .nova-category-page #productsGrid.nova-list-view .nova-product-card__media {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }
    .nova-category-page #productsGrid.nova-list-view .card-body {
        flex-direction: column !important;
        align-items: stretch;
    }
    .nova-category-page #productsGrid.nova-list-view .card-body .mt-auto {
        align-items: stretch;
        min-width: auto;
    }
}



