/* ============================================
   Adera Shop Page — archive-product.php
   ============================================ */

/* ── GeneratePress overrides ──────────────────────────────────────────────── */
.woocommerce-shop .site-content,
.tax-product_cat .site-content {
    display: block !important;
    word-wrap: normal !important;
}

/* Banner styles live in page-banner.css — loaded site-wide wherever the banner appears */

/* ── Page Wrapper ─────────────────────────────────────────────────────────── */
.adera-shop-page {
    background: #ffffff;
    padding: 36px 0 60px;
    min-height: 500px;
}

/* ── Layout: Sidebar + Main ───────────────────────────────────────────────── */
.adera-shop-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    align-items: start;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.adera-shop-sidebar {
    position: sticky;
    top: 90px;
}

.adera-shop-sidebar-card {
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    box-shadow: 0px 1px 11px 3px #B2B2B240;
    overflow: hidden;
}

.adera-sidebar-all-btn {
    display: block;
    font-family: var(--font-poppins);
    font-size: 20px;
    font-weight: 500;
    line-height: 20px;
    color: #ffffff;
    text-decoration: none;
    text-align: center;
    padding: 0 16px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-gradient);
    border-radius: 10px;
    margin-bottom: 18px;
    transition: background 0.2s ease;
    box-shadow: 0px 1px 11px 3px #B2B2B240;
    width: 100%;
    box-sizing: border-box;
}

.adera-sidebar-all-btn:hover {
    background: var(--brand-gradient-hover);
    color: #ffffff;
}

.adera-sidebar-all-btn.active {
    background: var(--brand-gradient);
    color: #ffffff;
}

.adera-sidebar-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.adera-sidebar-cat-list li {
    margin: 0;
    border-top: 1px solid #f0f1f3;
}

.adera-sidebar-cat-link {
    display: block;
    font-family: var(--font-inter);
    font-size: 13px;
    font-weight: 400;
    color: #9ca3af;
    text-decoration: none;
    padding: 13px 16px;
    transition: color 0.18s ease;
}

.adera-sidebar-cat-link:hover {
    color: var(--secondary-navy);
    font-weight: 600;
}

.adera-sidebar-cat-link.active {
    color: var(--secondary-navy);
    font-weight: 600;
}

/* ── Main Content ─────────────────────────────────────────────────────────── */
.adera-shop-main {
    min-width: 0;
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */
.adera-shop-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0 20px;
    height: 60px;
    margin-bottom: 20px;
    box-shadow: 0px 1px 11px 3px #B2B2B240;
}

.adera-shop-result-count {
    font-family: var(--font-inter);
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

.adera-shop-result-count .woocommerce-result-count {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

/* WooCommerce ordering select */
.adera-shop-toolbar .woocommerce-ordering {
    margin: 0;
}

.adera-shop-toolbar .woocommerce-ordering select,
.adera-shop-toolbar select.orderby {
    font-family: var(--font-inter);
    font-size: 13px;
    font-weight: 400;
    color: var(--secondary-navy);
    background-color: #f5f6f8;
    border: 1px solid #e0e3e8;
    border-radius: 6px;
    padding: 0 36px 0 16px;
    height: 44px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%234a5568' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    min-width: 0;
    outline: none;
    transition: border-color 0.2s ease;
}

.adera-shop-toolbar .woocommerce-ordering select:focus,
.adera-shop-toolbar select.orderby:focus {
    border-color: var(--secondary-navy);
}

/* Search in toolbar */
.adera-shop-search-wrap {
    flex-shrink: 1;
    min-width: 0;
    margin-left: auto;
}

.adera-shop-search-form {
    display: flex;
    align-items: center;
    background: #f5f6f8;
    border: 1px solid #e0e3e8;
    border-radius: 6px;
    height: 44px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.adera-shop-search-form:focus-within {
    border-color: var(--secondary-navy);
    background: #ffffff;
}

.adera-shop-search-btn {
    flex-shrink: 0;
    width: 40px;
    height: 100%;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s ease;
}

.adera-shop-search-form:focus-within .adera-shop-search-btn {
    color: var(--secondary-navy);
}

.adera-shop-search-input {
    flex: 1;
    min-width: 80px;
    width: 200px;
    height: 100%;
    border: none;
    background: transparent;
    font-family: var(--font-inter);
    font-size: 13px;
    color: var(--secondary-navy);
    padding: 0 16px 0 4px;
    outline: none;
}

.adera-shop-search-input::placeholder {
    color: #9ca3af;
}

/* ── Products Grid ────────────────────────────────────────────────────────── */
ul.adera-shop-products-grid::before,
ul.adera-shop-products-grid::after {
    content: none !important;
    display: none !important;
}

ul.adera-shop-products-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    column-gap: 22px !important;
    row-gap: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    float: none !important;
    width: 100% !important;
}

/* ── Pagination Bar ───────────────────────────────────────────────────────── */
.adera-shop-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 36px;
    flex-wrap: wrap;
}

/* Per-page selector */
.adera-shop-perpage {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-inter);
    font-size: 13px;
    color: #6b7280;
}

.adera-perpage-form {
    display: inline-flex;
    align-items: center;
}

.adera-perpage-select {
    font-family: var(--font-inter);
    font-size: 13px;
    font-weight: 500;
    color: var(--secondary-navy);
    background-color: #f5f6f8;
    border: 1px solid #e0e3e8;
    border-radius: 6px;
    padding: 5px 26px 5px 10px;
    height: 34px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%234a5568' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    outline: none;
    transition: border-color 0.2s ease;
}

.adera-perpage-select:focus {
    border-color: var(--secondary-navy);
}

.adera-perpage-total strong {
    color: var(--secondary-navy);
    font-weight: 600;
}

/* Page numbers */
.adera-shop-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.adera-shop-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-family: var(--font-inter);
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    background: #ffffff;
    border: 1px solid #e0e3e8;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.adera-shop-pagination .page-numbers:hover {
    background: #670EAA;
    color: #ffffff;
    border-color: #670EAA;
}

.adera-shop-pagination .page-numbers.current {
    background: #670EAA;
    color: #ffffff;
    border-color: #670EAA;
    font-weight: 600;
    pointer-events: none;
}

.adera-shop-pagination .page-numbers.prev,
.adera-shop-pagination .page-numbers.next {
    color: var(--secondary-navy);
}

.adera-shop-pagination .page-numbers.prev:hover,
.adera-shop-pagination .page-numbers.next:hover {
    color: #ffffff;
}

.adera-shop-pagination .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    color: #9ca3af;
    pointer-events: none;
    width: auto;
    padding: 0 4px;
}

/* ── Empty State ──────────────────────────────────────────────────────────── */
.adera-shop-empty {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
}

.adera-shop-empty p {
    font-family: var(--font-inter);
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 20px;
}

.adera-shop-empty-back {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-poppins);
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: var(--brand-purple-deep);
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.adera-shop-empty-back:hover {
    background: var(--accent-red);
    color: #ffffff;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .adera-shop-layout {
        grid-template-columns: 200px 1fr;
        gap: 20px;
    }

    ul.adera-shop-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        column-gap: 14px !important;
        row-gap: 18px !important;
    }
}

@media (max-width: 860px) {
    .adera-shop-layout {
        grid-template-columns: 1fr;
    }


    .adera-shop-page {
        padding: 20px 0 40px;
    }

    /* Sidebar → horizontal scrollable pill row */
    .adera-shop-sidebar {
        position: static !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .adera-shop-sidebar::-webkit-scrollbar { display: none; }

    .adera-sidebar-all-btn {
        white-space: nowrap !important;
        height: 36px !important;
        padding: 0 20px !important;
        font-family: var(--font-poppins) !important;
        font-size: 12px !important;
        font-weight: 400 !important;
        border-radius: 4px !important;
        margin-bottom: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        flex-shrink: 0 !important;
        background: #ffffff !important;
        color: #A7A7A7 !important;
        box-shadow: none !important;
        border: 1px solid #E2E2E2 !important;
    }

    .adera-sidebar-all-btn.active {
        background: #670EAA !important;
        color: #ffffff !important;
        border-color: #670EAA !important;
    }

    .adera-shop-sidebar-card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .adera-sidebar-cat-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px;
        border-top: none !important;
        padding-top: 0 !important;
        border-left: none;
        padding-left: 0 !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .adera-sidebar-cat-list::-webkit-scrollbar { display: none; }

    .adera-sidebar-cat-list li {
        border-top: none !important;
        flex-shrink: 0;
    }

    .adera-sidebar-cat-link {
        white-space: nowrap;
        padding: 0 20px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #E2E2E2;
        border-radius: 4px;
        font-family: var(--font-poppins);
        font-size: 12px;
        font-weight: 400;
        background: #ffffff;
        color: #A7A7A7;
    }

    .adera-sidebar-cat-link.active {
        background: #670EAA !important;
        color: #ffffff !important;
        border-color: #670EAA !important;
        font-weight: 400 !important;
    }

    /* Toolbar — grid: search full-width top, count + sort on same row below */
    .adera-shop-toolbar {
        display: grid !important;
        grid-template-areas:
            "search search"
            "count  sort";
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        height: auto !important;
        padding: 14px 16px !important;
        gap: 10px 12px !important;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
        overflow: visible;
    }

    .adera-shop-search-wrap {
        grid-area: search;
        width: 100%;
        min-width: 0;
    }

    .adera-shop-result-count {
        grid-area: count;
        flex: none;
        min-width: 0;
        white-space: normal;
        word-break: break-word;
        font-size: 12px;
        line-height: 1.4;
    }

    .adera-shop-result-count .woocommerce-result-count {
        font-size: 12px;
        white-space: normal;
        word-break: break-word;
    }

    .adera-shop-toolbar .woocommerce-ordering {
        grid-area: sort;
        margin: 0;
    }

    .adera-shop-toolbar .woocommerce-ordering select,
    .adera-shop-toolbar select.orderby {
        min-width: 0;
        max-width: 150px;
        width: auto;
        font-size: 12px;
    }

    .adera-shop-search-form {
        width: 100%;
        height: 50px;
        border-radius: 30px;
    }

    .adera-shop-search-btn {
        width: 44px;
        border-right: none;
        color: #9ca3af;
    }

    .adera-shop-search-input {
        width: 100%;
        font-size: 14px;
    }

    ul.adera-shop-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        column-gap: 12px !important;
        row-gap: 20px !important;
    }

    /* Ensure consistent left/right padding on mobile */
    .adera-shop-page .container-custom {
        padding-left: 16px;
        padding-right: 16px;
    }
}
