/**
 * navico-prdct-sidebar.css
 * Shop/category layout: sidebar + grid + banners + Load More + drawer.
 * Colors come ONLY from navico-prdct-root.css variables.
 *
 * BREAKPOINTS (4):
 *  - Large screen : >= 1400px  -> sidebar 300px, grid 3 columns
 *  - Laptop       : 992-1399px -> sidebar 260px, grid 3 columns
 *  - Tablet       : 768-991px  -> sidebar becomes drawer, grid 2 columns
 *  - Mobile       : < 768px    -> drawer, grid 1 column
 */

/* ---------- Layout shell ---------- */
.navico_prdct_layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.navico_prdct_main { flex: 1; min-width: 0; }


@media (min-width: 1200px) {
    .woocommerce.tax-product_cat .container,
    .woocommerce.post-type-archive-product .container {
        max-width: 1200px;
    }
}
@media (min-width: 1600px) {
    .woocommerce.tax-product_cat .container,
    .woocommerce.post-type-archive-product .container {
        max-width: 90vw;
    }
}

/* ---------- Banners ---------- */
.navico_prdct_banner {
    margin-bottom: 30px;
    border-radius: var(--navico_prdct_radius);
    overflow: hidden;
}
.navico_prdct_banner img {
    display: block;
    width: 100%;
    height: auto;
}
.navico_prdct_banner--mid { margin: 30px 0; }

/* ---------- Sidebar ---------- */
.navico_prdct_sidebar {
    width: 30%;
    flex-shrink: 0;
    background: var(--navico_prdct_secondary);
    border: 1px solid var(--navico_prdct_border);
    border-radius: var(--navico_prdct_radius);
    padding: 20px;
    position: sticky;
    top: 100px;
}
.navico_prdct_sidebar_close { display: none; }
.navico_prdct_sidebar_block { margin-bottom: 24px; }
.navico_prdct_sidebar_block:last-child { margin-bottom: 0; }
.navico_prdct_sidebar_title {
    font-size: 15px;
    font-weight: 700;
    color: var(--navico_prdct_headings);
    margin: 0 0 12px;
}

/* ---------- Live search ---------- */
.navico_prdct_search_wrap { position: relative; }
.navico_prdct_search_input {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    border: 1px solid var(--navico_prdct_border);
    border-radius: var(--navico_prdct_radius_sm);
    background: var(--navico_prdct_surface);
    color: var(--navico_prdct_text);
}
.navico_prdct_search_input:focus {
    outline: 2px solid var(--navico_prdct_heading_accent);
    outline-offset: 1px;
    background: var(--navico_prdct_secondary);
}
.navico_prdct_search_results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--navico_prdct_secondary);
    border: 1px solid var(--navico_prdct_border);
    border-radius: var(--navico_prdct_radius_sm);
    box-shadow: 0 10px 24px rgba(0,0,0,.1);
    z-index: 30;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}
.navico_prdct_search_results.is-open { display: block; }
.navico_prdct_search_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--navico_prdct_text);
    text-decoration: none;
    border-bottom: 1px solid var(--navico_prdct_border);
}
.navico_prdct_search_item:last-child { border-bottom: 0; }
.navico_prdct_search_item:hover,
.navico_prdct_search_item:focus {
    background: var(--navico_prdct_surface);
    color: var(--navico_prdct_heading_accent);
}
.navico_prdct_search_thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.navico_prdct_search_empty {
    display: block;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--navico_prdct_muted);
}

/* ---------- Category tree ---------- */
.navico_prdct_cat_tree { list-style: none; margin: 0; padding: 0; }
.navico_prdct_cat_tree--depth1 { padding-left: 14px; }
.navico_prdct_cat_tree--depth2 { padding-left: 14px; }
.navico_prdct_cat_row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.navico_prdct_cat_link {
    flex: 1;
    display: block;
    padding: 7px 0;
    font-size: 13.5px;
    color: var(--navico_prdct_text);
    text-decoration: none;
}
.navico_prdct_cat_link:hover { color: var(--navico_prdct_heading_accent); }
.navico_prdct_cat_item.is-current > .navico_prdct_cat_row > .navico_prdct_cat_link {
    color: var(--navico_prdct_heading_accent);
    font-weight: 700;
}
.navico_prdct_cat_count { font-size: 11px; color: var(--navico_prdct_muted); }
.navico_prdct_cat_toggle {
    background: none;
    border: 0;
    padding: 6px;
    cursor: pointer;
    line-height: 1;
}
.navico_prdct_chev {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--navico_prdct_muted);
    border-bottom: 2px solid var(--navico_prdct_muted);
    transform: rotate(45deg);
    transition: transform .2s;
}
.navico_prdct_cat_toggle[aria-expanded="true"] .navico_prdct_chev,
.navico_prdct_accordion_head[aria-expanded="true"] .navico_prdct_chev {
    transform: rotate(-135deg);
}

/* ---------- Select by Type accordion ---------- */
.navico_prdct_accordion_head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: 0;
    padding: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--navico_prdct_headings);
    cursor: pointer;
    text-align: left;
}
.navico_prdct_type_scroll {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--navico_prdct_border);
    border-radius: var(--navico_prdct_radius_sm);
    padding: 8px;
}
.navico_prdct_type_list { list-style: none; margin: 0; padding: 0; }
.navico_prdct_type_link {
    display: block;
    padding: 6px 8px;
    font-size: 13px;
    color: var(--navico_prdct_text);
    text-decoration: none;
    border-radius: 4px;
}
.navico_prdct_type_link:hover { background: var(--navico_prdct_surface); color: var(--navico_prdct_heading_accent); }
.navico_prdct_type_link.is-active {
    background: var(--navico_prdct_accent);
    color: var(--navico_prdct_secondary);
    font-weight: 600;
}
.navico_prdct_type_empty { font-size: 12px; color: var(--navico_prdct_muted); margin: 0; }

/* ---------- Grid columns (our layout only) ---------- */
.navico_prdct_main ul.products {
    display: grid !important;
    gap: 24px;
    margin: 0 0 30px;
    padding: 0;
    width: 100%;
}
.navico_prdct_main ul.products::before,
.navico_prdct_main ul.products::after { display: none; }
.navico_prdct_main ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

/* ---------- Load More ---------- */
.navico_prdct_loadmore_wrap { text-align: center; margin: 10px 0 30px; }
.navico_prdct_loadmore { min-width: 200px; display: inline-block; cursor: pointer; }
.navico_prdct_loadmore[disabled] { opacity: .6; cursor: wait; }
.navico_prdct_loadmore_spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 10px;
    border: 2px solid var(--navico_prdct_border);
    border-top-color: var(--navico_prdct_heading_accent);
    border-radius: 50%;
    animation: navico_prdct_spin .7s linear infinite;
    vertical-align: middle;
}
@keyframes navico_prdct_spin { to { transform: rotate(360deg); } }

/* ---------- End content ---------- */
.navico_prdct_end_content {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--navico_prdct_border);
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--navico_prdct_text);
}

/* ---------- Filter toggle button (hidden on desktop) ---------- */
.navico_prdct_filter_toggle {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--navico_prdct_accent);
    color: var(--navico_prdct_secondary);
    border: 0;
    border-radius: var(--navico_prdct_radius_sm);
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    cursor: pointer;
}

/* ---------- Overlay ---------- */
.navico_prdct_sidebar_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 998;
}

@media (min-width: 1400px) {
    .navico_prdct_sidebar { width: 20%; }
    .navico_prdct_main ul.products { grid-template-columns: repeat(4, 1fr) !important; }
}

@media (min-width: 992px) and (max-width: 1399px) {
    .navico_prdct_sidebar { width: 25%; padding: 16px; }
    .navico_prdct_main ul.products { grid-template-columns: repeat(3, 1fr) !important; gap: 18px; }
}

@media (min-width: 768px) and (max-width: 991px) {
    .navico_prdct_filter_toggle { display: inline-flex; }
    .navico_prdct_main ul.products { grid-template-columns: repeat(2, 1fr) !important; gap: 18px; }
}

@media (max-width: 767px) {
    .navico_prdct_filter_toggle { display: inline-flex; width: 100%; justify-content: center; }
    .navico_prdct_main ul.products { grid-template-columns: repeat(2, 1fr) !important; gap: 16px; }
    .navico_prdct_banner { margin-bottom: 20px; }
}

/* ---------- Drawer behaviour (tablet + mobile shared) ---------- */
@media (max-width: 991px) {
    .navico_prdct_sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 320px;
        max-width: 85vw;
        z-index: 999;
        border-radius: 0;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform .3s ease;
    }
    .navico_prdct_sidebar.is-open { transform: translateX(0); }
    .navico_prdct_sidebar_close {
        display: block;
        position: absolute;
        top: 10px;
        right: 12px;
        background: none;
        border: 0;
        font-size: 26px;
        line-height: 1;
        color: var(--navico_prdct_headings);
        cursor: pointer;
        padding: 4px 8px;
    }
    body.navico_prdct_drawer_open { overflow: hidden; }
}

/* ---------- Retina / sharp rendering ---------- */
.navico_prdct_banner img,
.navico_prdct_thumb_img {
    image-rendering: -webkit-optimize-contrast;
}

/* ---------- Reduced motion (accessibility) ---------- */
@media (prefers-reduced-motion: reduce) {
    .navico_prdct_sidebar,
    .navico_prdct_chev,
    .navico_prdct_thumb_img { transition: none; }
    .navico_prdct_loadmore_spinner { animation: none; }
}
