﻿/* shop.css — Halaman Toko Produk */


/* ============================================================
   SHOP LAYOUT (sidebar + content)
   ============================================================ */
.oec-shop-layout {
    display: grid;
    grid-template-columns: 264px 1fr;
    gap: 1.75rem;
    padding: 1.75rem 0 3rem;
    align-items: start;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.oec-shop-sidebar {
    background: var(--oec-surface);
    border: 1.5px solid var(--oec-border);
    border-radius: var(--oec-radius-lg);
    overflow: hidden;
    position: sticky;
    top: calc(var(--oec-topnav-h) + var(--oec-nav-h) + 1rem);
    max-height: calc(100vh - var(--oec-topnav-h) - var(--oec-nav-h) - 2rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--oec-border-dark) transparent;
}

.oec-shop-sidebar::-webkit-scrollbar { width: 4px; }
.oec-shop-sidebar::-webkit-scrollbar-thumb { background: var(--oec-border-dark); border-radius: 4px; }

/* header */
.oec-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--oec-border);
    position: sticky;
    top: 0;
    background: var(--oec-surface);
    z-index: 1;
}

.oec-sidebar-title {
    font-size: .9375rem;
    font-weight: 700;
    color: var(--oec-dark);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.oec-sidebar-title i { color: var(--oec-primary); }

.oec-sidebar-reset {
    font-size: .75rem;
    font-weight: 600;
    color: var(--oec-primary-dark);
    padding: .25rem .625rem;
    border-radius: var(--oec-radius-sm);
    border: 1px solid var(--oec-primary);
    transition: background var(--oec-transition), color var(--oec-transition);
}
.oec-sidebar-reset:hover { background: var(--oec-primary); color: #fff; }

/* group */
.oec-sidebar-group {
    border-bottom: 1px solid var(--oec-border);
}

.oec-sidebar-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .875rem 1.25rem;
    font-size: .875rem;
    font-weight: 700;
    color: var(--oec-dark);
    transition: background var(--oec-transition);
}
.oec-sidebar-group-toggle:hover { background: var(--oec-surface-alt); }

.oec-sidebar-chevron {
    font-size: .6rem;
    color: var(--oec-text-muted);
    transition: transform var(--oec-transition);
    flex-shrink: 0;
}
.oec-sidebar-group-toggle[aria-expanded="false"] .oec-sidebar-chevron {
    transform: rotate(-90deg);
}

/* checklist */
.oec-sidebar-checklist {
    padding: .25rem 1.25rem .875rem;
    display: flex;
    flex-direction: column;
    gap: .125rem;
}
.oec-sidebar-group-toggle[aria-expanded="false"] + .oec-sidebar-checklist,
.oec-sidebar-group-toggle[aria-expanded="false"] + .oec-sidebar-price-wrap {
    display: none;
}

.oec-sidebar-check-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .375rem .5rem;
    border-radius: var(--oec-radius-sm);
    cursor: pointer;
    transition: background var(--oec-transition);
}
.oec-sidebar-check-item:hover { background: var(--oec-primary-light); }

.oec-sidebar-checkbox {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--oec-border-dark);
    border-radius: 3px;
    accent-color: var(--oec-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.oec-sidebar-check-label {
    flex: 1;
    font-size: .8375rem;
    color: var(--oec-text);
    line-height: 1.3;
}

.oec-sidebar-check-count {
    font-size: .75rem;
    color: var(--oec-text-muted);
    background: var(--oec-surface-alt);
    padding: .1rem .4rem;
    border-radius: 999px;
    flex-shrink: 0;
}

/* price filter */
.oec-sidebar-price-wrap {
    padding: .25rem 1.25rem .875rem;
}

.oec-sidebar-price-row {
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    margin-bottom: .875rem;
}

.oec-sidebar-price-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.oec-sidebar-price-label {
    font-size: .7rem;
    font-weight: 600;
    color: var(--oec-text-muted);
    letter-spacing: .02em;
}

.oec-sidebar-price-input {
    width: 100%;
    height: 36px;
    padding: 0 .625rem;
    border: 1.5px solid var(--oec-border-dark);
    border-radius: var(--oec-radius-sm);
    font-size: .8125rem;
    font-family: inherit;
    color: var(--oec-text);
    outline: none;
    transition: border-color var(--oec-transition), box-shadow var(--oec-transition);
}
.oec-sidebar-price-input:focus {
    border-color: var(--oec-primary);
    box-shadow: 0 0 0 3px var(--oec-primary-light);
}
.oec-sidebar-price-input::placeholder { color: var(--oec-text-muted); }

.oec-sidebar-price-dash {
    font-size: .8125rem;
    color: var(--oec-text-muted);
    padding-bottom: .5rem;
    flex-shrink: 0;
}

.oec-sidebar-price-presets {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.oec-sidebar-price-preset {
    text-align: left;
    font-size: .8125rem;
    color: var(--oec-text-muted);
    padding: .35rem .5rem;
    border-radius: var(--oec-radius-sm);
    transition: background var(--oec-transition), color var(--oec-transition);
}
.oec-sidebar-price-preset:hover,
.oec-sidebar-price-preset.oec--active {
    background: var(--oec-primary-light);
    color: var(--oec-primary-dark);
    font-weight: 600;
}

/* apply btn (mobile only) */
.oec-sidebar-apply-btn {
    display: none;
    width: calc(100% - 2.5rem);
    margin: 1rem 1.25rem;
    height: 44px;
    background: var(--oec-primary);
    color: #fff;
    border-radius: var(--oec-radius);
    font-size: .9rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: background var(--oec-transition);
}
.oec-sidebar-apply-btn:hover { background: var(--oec-primary-hover); }

/* ============================================================
   SHOP CONTENT
   ============================================================ */
.oec-shop-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.oec-shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--oec-surface);
    border: 1.5px solid var(--oec-border);
    border-radius: var(--oec-radius-lg);
    padding: .75rem 1.125rem;
}

.oec-shop-toolbar-left {
    display: flex;
    align-items: center;
    gap: .875rem;
    flex-wrap: wrap;
}

.oec-shop-toolbar-right {
    display: flex;
    align-items: center;
    gap: .875rem;
}

.oec-shop-filter-toggle {
    display: none;
    align-items: center;
    gap: .4rem;
    padding: .5rem .875rem;
    border: 1.5px solid var(--oec-border-dark);
    border-radius: var(--oec-radius);
    font-size: .875rem;
    font-weight: 600;
    color: var(--oec-dark);
    transition: background var(--oec-transition), border-color var(--oec-transition);
}
.oec-shop-filter-toggle:hover,
.oec-shop-filter-toggle[aria-expanded="true"] {
    background: var(--oec-primary-light);
    border-color: var(--oec-primary);
    color: var(--oec-primary-dark);
}

.oec-shop-result-count {
    font-size: .875rem;
    color: var(--oec-text-muted);
}
.oec-shop-result-count strong { color: var(--oec-dark); }

/* sort */
.oec-shop-sort-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.oec-shop-sort-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--oec-text-muted);
    white-space: nowrap;
}

.oec-shop-sort-select {
    height: 36px;
    padding: 0 .75rem;
    border: 1.5px solid var(--oec-border-dark);
    border-radius: var(--oec-radius);
    font-size: .875rem;
    font-family: inherit;
    color: var(--oec-dark);
    background: var(--oec-surface);
    cursor: pointer;
    outline: none;
    transition: border-color var(--oec-transition);
}
.oec-shop-sort-select:focus { border-color: var(--oec-primary); }

/* view toggle */
.oec-shop-view-toggle {
    display: flex;
    border: 1.5px solid var(--oec-border-dark);
    border-radius: var(--oec-radius);
    overflow: hidden;
}

.oec-shop-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: .875rem;
    color: var(--oec-text-muted);
    transition: background var(--oec-transition), color var(--oec-transition);
}
.oec-shop-view-btn:hover { background: var(--oec-surface-alt); color: var(--oec-dark); }
.oec-shop-view-btn.oec--active {
    background: var(--oec-primary);
    color: #fff;
}
.oec-shop-view-btn + .oec-shop-view-btn {
    border-left: 1.5px solid var(--oec-border-dark);
}

/* ============================================================
   ACTIVE FILTERS CHIPS
   ============================================================ */
.oec-shop-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    min-height: 0;
}

.oec-shop-active-filters:empty { display: none; }

.oec-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .3rem .625rem .3rem .75rem;
    background: var(--oec-primary-light);
    border: 1px solid var(--oec-primary);
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--oec-primary-dark);
}

.oec-filter-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: .6rem;
    color: var(--oec-primary-dark);
    transition: background var(--oec-transition), color var(--oec-transition);
}
.oec-filter-chip-remove:hover { background: var(--oec-primary); color: #fff; }

/* ============================================================
   SHOP GRID (override for shop page — 4 cols default)
   ============================================================ */
.oec-shop-grid {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* ---- LIST VIEW ---- */
.oec-shop-grid.oec--list-view {
    grid-template-columns: 1fr !important;
    gap: .75rem;
}

.oec-shop-grid.oec--list-view .oec-product-card {
    flex-direction: row;
    align-items: stretch;
    min-height: 140px;
}

/* gambar — kotak kecil di kiri */
.oec-shop-grid.oec--list-view .oec-product-card-img-wrap {
    width: 160px;
    min-width: 160px;
    height: auto;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border-right: 1px solid var(--oec-border);
    border-radius: var(--oec-radius-lg) 0 0 var(--oec-radius-lg);
}

/* badge tetap di pojok kiri atas gambar */
.oec-shop-grid.oec--list-view .oec-product-card-badge {
    font-size: .65rem;
    padding: .2rem .5rem;
}

/* body — nama + harga, tumbuh mengisi ruang */
.oec-shop-grid.oec--list-view .oec-product-card-body {
    flex: 1;
    padding: 1rem 1.25rem;
    justify-content: center;
    gap: .5rem;
    min-width: 0;
}

.oec-shop-grid.oec--list-view .oec-product-card-name {
    font-size: .9375rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.oec-shop-grid.oec--list-view .oec-product-card-price {
    font-size: 1.125rem;
}

/* actions — dua tombol vertikal, rata kanan */
.oec-shop-grid.oec--list-view .oec-product-card-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .5rem;
    padding: 1rem;
    width: 148px;
    min-width: 148px;
    flex-shrink: 0;
    border-left: 1px solid var(--oec-border);
    grid-template-columns: unset;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.oec-shop-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding-top: .5rem;
}

.oec-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 .5rem;
    border: 1.5px solid var(--oec-border);
    border-radius: var(--oec-radius);
    font-size: .875rem;
    font-weight: 600;
    color: var(--oec-text);
    background: var(--oec-surface);
    transition: border-color var(--oec-transition), background var(--oec-transition),
                color var(--oec-transition), transform var(--oec-transition);
}
.oec-page-btn:hover:not(:disabled) {
    border-color: var(--oec-primary);
    color: var(--oec-primary-dark);
    background: var(--oec-primary-light);
    transform: translateY(-1px);
}
.oec-page-btn.oec--active {
    background: var(--oec-primary);
    border-color: var(--oec-primary);
    color: #fff;
}
.oec-page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.oec-page-ellipsis {
    padding: 0 .25rem;
    color: var(--oec-text-muted);
    font-size: .875rem;
    line-height: 40px;
}

/* ============================================================
   MOBILE OVERLAY
   ============================================================ */
.oec-shop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--oec-overlay);
    z-index: 200;
    opacity: 0;
    transition: opacity var(--oec-transition);
}
.oec-shop-overlay.oec--open {
    display: block;
    opacity: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet: sidebar + 3-col grid */
@media (max-width: 1100px) {
    .oec-shop-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* < 960px: collapse sidebar to drawer */
@media (max-width: 959px) {
    .oec-shop-layout {
        grid-template-columns: 1fr;
        padding-top: 1.25rem;
    }

    .oec-shop-filter-toggle { display: inline-flex; }

    .oec-shop-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        max-height: 100%;
        z-index: 210;
        border-radius: 0;
        border: none;
        border-right: 1px solid var(--oec-border);
        transition: left 180ms ease;
    }

    .oec-shop-sidebar.oec--open {
        left: 0;
    }

    .oec-sidebar-apply-btn { display: inline-flex; }
}

/* Mobile: 2-col grid */
@media (max-width: 600px) {
    .oec-shop-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* Toolbar mobile — 2 baris rapi */
    .oec-shop-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: .625rem;
        padding: .625rem .875rem;
    }
    .oec-shop-toolbar-left {
        justify-content: space-between;
        width: 100%;
    }
    .oec-shop-toolbar-right {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: .5rem;
    }
    .oec-shop-sort-wrap {
        flex: 1;
    }
    .oec-shop-sort-label { display: none; }
    .oec-shop-sort-select { width: 100%; font-size: .8125rem; }

    /* View toggle — pastikan icon muncul semua */
    .oec-shop-view-toggle { flex-shrink: 0; }
    .oec-shop-view-btn { width: 38px; height: 38px; font-size: .9rem; }

    /* Result count — lebih kecil */
    .oec-shop-result-count { font-size: .8rem; }

    /* List view mobile — fallback ke column */
    .oec-shop-grid.oec--list-view { grid-template-columns: 1fr !important; }
    .oec-shop-grid.oec--list-view .oec-product-card { flex-direction: column; }
    .oec-shop-grid.oec--list-view .oec-product-card-img-wrap {
        width: 100%; min-width: unset; height: 180px;
        border-right: none; border-bottom: 1px solid var(--oec-border);
        border-radius: var(--oec-radius-lg) var(--oec-radius-lg) 0 0;
    }
    .oec-shop-grid.oec--list-view .oec-product-card-actions {
        width: 100%; min-width: unset; flex-direction: row;
        border-left: none; border-top: 1px solid var(--oec-border);
    }
}

/* ============================================================
   MOBILE NAV DRAWER — hanya mobile
   ============================================================ */
@media (min-width: 768px) {
    .oec-mobile-nav,
    .oec-mobile-nav-overlay { display: none !important; }
}

.oec-mobile-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--oec-surface);
    z-index: 300;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,.15);
    transition: left 200ms ease;
    overflow-y: auto;
}
.oec-mobile-nav.oec--open { left: 0; }

.oec-mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--oec-border);
    flex-shrink: 0;
}
.oec-mobile-nav-logo { height: 28px; width: auto; }
.oec-mobile-nav-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--oec-radius-sm);
    color: var(--oec-text-muted);
    font-size: 1.125rem;
    transition: background var(--oec-transition), color var(--oec-transition);
}
.oec-mobile-nav-close:hover { background: var(--oec-danger-light); color: var(--oec-danger); }

.oec-mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: .75rem 0;
    flex: 1;
}
.oec-mobile-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .875rem 1.25rem;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--oec-text);
    border-bottom: 1px solid var(--oec-border);
    transition: background var(--oec-transition), color var(--oec-transition);
}
.oec-mobile-nav-link:last-child { border-bottom: none; }
.oec-mobile-nav-link:hover { background: var(--oec-primary-light); color: var(--oec-primary-dark); }
.oec-mobile-nav-link i { width: 18px; text-align: center; color: var(--oec-primary); font-size: .9rem; }

.oec-mobile-nav-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--oec-border);
    display: flex;
    flex-direction: column;
    gap: .625rem;
    flex-shrink: 0;
}
.oec-mobile-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 44px;
    border-radius: var(--oec-radius);
    font-size: .9375rem;
    font-weight: 700;
    transition: background var(--oec-transition);
}
.oec-mobile-nav-btn--wa { background: #25D366; color: #fff; }
.oec-mobile-nav-btn--wa:hover { background: #1ebe5d; }
.oec-mobile-nav-btn--login { background: var(--oec-secondary); color: #fff; }
.oec-mobile-nav-btn--login:hover { background: var(--oec-secondary-hover); }

/* Overlay untuk mobile nav */
.oec-mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--oec-overlay);
    z-index: 290;
}
.oec-mobile-nav-overlay.oec--open { display: block; }
