/* =========================================================
   ETALASE LISTING — WISHLIST-LIKE (FINAL)
   - Style card mengikuti wishlist
   - Mobile: 2 kolom (tetap 2 kolom bahkan <=420px)
   - Media wrapper stabil (block) + gambar promo aman (contain)
   ========================================================= */

/* =========================
   TOKENS
   ========================= */
:root {
    --brand: #1b3c53;
    --brand-dark: #213c51;
    --brand-soft: rgba(27, 60, 83, 0.1);

    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;

    --card: #ffffff;
    --bg: #ffffff;

    /* fallback tokens */
    --white: #ffffff;
    --heading: #0f172a;
    --primary: var(--brand);
    --primary-dark: var(--brand-dark);
    --background-3: #f3f9fb;
    --rc-r12: 12px;
    --rc-text: var(--text);
}

/* =========================
   PAGE
   ========================= */
.etalase-listing {
    background: transparent;
}

/* =========================
   TOP TOOLBAR
   ========================= */
.etalase-toolbar-wrap {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}

.etalase-toolbar-container {
    padding-left: 12px;
    padding-right: 12px;
}

.etalase-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
}

.etalase-count {
    font-size: 13px;
    color: var(--muted);
}

.etalase-toolbar__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
}

@media (min-width: 992px) {
    .etalase-toolbar__right {
        gap: 12px;
    }
}

@media (max-width: 991.98px) {
    .etalase-toolbar {
        align-items: flex-start;
    }
    .etalase-count {
        display: none;
    }
    .etalase-toolbar__right {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* =========================
   CHIPS ROW
   ========================= */
.etalase-chips-row {
    display: flex;
    gap: 8px;
    padding: 8px 0 12px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.etalase-chips-row::-webkit-scrollbar {
    height: 6px;
}

.etalase-chip {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    font-size: 13px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #111;
}

.etalase-chip--primary {
    border-color: var(--brand);
    color: var(--brand);
}

.etalase-chip__badge {
    background: rgba(27, 60, 83, 0.12);
    color: var(--brand);
    border-radius: 999px;
    padding: 1px 8px;
    font-weight: 700;
    font-size: 12px;
}

/* =========================
   SELECT (native)
   ========================= */
.etalase-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.etalase-select__label {
    font-size: 13px;
    color: var(--muted);
}

.etalase-select__control {
    border-radius: 999px !important;
    border: 1px solid var(--line) !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    height: 34px;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px !important;

    cursor: pointer;
    transition: all 0.2s ease;
}

.etalase-select__control:hover {
    border-color: var(--brand) !important;
}
.etalase-select__control:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(27, 60, 83, 0.1) !important;
    outline: none;
}
.etalase-select__control--xs {
    width: 92px;
    min-width: 92px;
}
.etalase-select__control--sm {
    width: 86px;
    min-width: 86px;
}
.etalase-select__control--md {
    width: 160px;
    min-width: 160px;
}

/* =========================
   SIDEBAR FILTER (RESTORED)
   ========================= */
.etalase-sidebar {
    position: relative !important;
    padding-bottom: 20px;
    background: transparent;
}

.etalase-filter-card {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--rc-r12);
    background: var(--white);
    margin-bottom: 12px;
    overflow: hidden;
    /* box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06); */
}

.etalase-filter-head {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(180deg, var(--background-3), var(--white));
}

.etalase-filter-toggle {
    width: 100%;
    background: transparent;
    border: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 900;
    font-size: 14px;
    color: var(--heading);
    gap: 10px;
}

.etalase-filter-toggle i {
    font-size: 16px;
    color: var(--primary);
    transition: transform 0.2s ease;
}
.etalase-filter-toggle[aria-expanded="false"] i {
    transform: rotate(-180deg);
}

.etalase-filter-body {
    padding: 10px 12px 12px;
}

.etalase-check {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
}
.etalase-check__text {
    font-size: 13px;
    color: var(--rc-text);
    font-weight: 600;
}
.etalase-check input {
    display: none;
}

.etalase-check__box {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: #fff;
    display: inline-block;
    position: relative;
    transition: all 0.18s ease;
}

.etalase-check input:checked + .etalase-check__box {
    border-color: rgba(27, 60, 83, 0.55);
    background: rgba(27, 60, 83, 0.1);
}
.etalase-check input:checked + .etalase-check__box::after {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 4px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.etalase-check:hover .etalase-check__text {
    color: var(--primary);
}

.etalase-link {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--primary);
    font-weight: 900;
    font-size: 13px;
    text-decoration: none;
}
.etalase-link:hover {
    text-decoration: underline;
}

.etalase-btn-primary {
    background: var(--primary) !important;
    border-color: rgba(27, 60, 83, 0.35) !important;
    color: #fff !important;
    border-radius: var(--rc-r12) !important;
    padding: 10px 12px !important;
    font-weight: 900;
    box-shadow: 0 10px 20px rgba(27, 60, 83, 0.18);
}
.etalase-btn-primary:hover {
    background: var(--primary-dark) !important;
}

.etalase-reset {
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
    font-weight: 700;
}
.etalase-reset:hover {
    color: var(--primary);
    text-decoration: underline;
}

.etalase-offcanvas .offcanvas-header {
    border-bottom: 1px solid var(--line);
}
.etalase-offcanvas .offcanvas-title {
    font-weight: 800;
}

/* =========================================================
   PRODUCTS GRID — WISHLIST-LIKE
   ========================================================= */
.etalase-products {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

/* desktop 4 kolom (wishlist feel) */
@media (min-width: 992px) {
    .etalase-products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
    }
}

/* jangan pernah jadi 1 kolom di <=420px (hapus rule lama 1fr) */
@media (max-width: 420px) {
    .etalase-products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }
}

/* pastikan item grid bisa mengecil */
.etalase-products > * {
    min-width: 0;
}

/* =========================================================
   CARD — WISHLIST-LIKE
   ========================================================= */
.etalase-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.etalase-card:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* =========================================================
   MEDIA WRAP — pakai gaya wishlist (stabil + promo aman)
   ========================================================= */
.etalase-card__img {
    position: relative;
    display: block; /* penting: jangan flex */
    width: 100%;
    overflow: hidden;
    background: #f8f9fa;
    border-bottom: 1px solid var(--line);

    /* portrait konsisten seperti wishlist */
    aspect-ratio: 4 / 5;

    /* matikan height fixed */
    height: auto !important;
    min-height: 0 !important;
}

/* gambar: ikut wrapper + contain */
.etalase-img {
    width: 100% !important;
    height: 100% !important;
    display: block;
    object-position: center;

    /* KUNCI: banner/promo tidak kepotong */
    object-fit: contain !important;

    padding: 6px;
    background: #fff;
    transition: transform 0.25s ease;
}

.etalase-card:hover .etalase-img {
    transform: scale(1.01);
}

/* Desktop: sedikit lebih tinggi tapi tetap compact */
@media (min-width: 992px) {
    .etalase-card__img {
        aspect-ratio: 4 / 5;
    }
}

/* Ribbon habis (samakan wishlist) */
.etalase-oos-badge {
    position: absolute;
    top: 10px;
    left: -34px;
    transform: rotate(-45deg);
    background: #ef4444;
    color: #fff;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.3px;
    padding: 6px 46px;
    z-index: 5;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* =========================================================
   BODY — kecil seperti wishlist
   ========================================================= */
.etalase-card__body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
@media (min-width: 992px) {
    .etalase-card__body {
        padding: 12px;
    }
}

/* Title */
.etalase-title a {
    font-weight: 900;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.25;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.etalase-title a:hover {
    color: var(--brand);
}

/* Sub */
.etalase-sub {
    font-size: 11px;
    color: var(--muted);
}

/* Categories */
.etalase-meta__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}
.etalase-pill {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 10px;
    color: var(--text);
}

/* Footer row: price + actions */
.etalase-bottom-row {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    padding-top: 4px;
}

.etalase-price {
    font-size: 14px;
    font-weight: 900;
    color: var(--brand);
    line-height: 1.1;
}
@media (min-width: 992px) {
    .etalase-price {
        font-size: 15px;
    }
}

/* Harga dengan Diskon */
.etalase-price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.etalase-price--original {
    color: #999;
    font-size: 11px;
    font-weight: 400;
    text-decoration: line-through;
    line-height: 1;
}

.etalase-price--discounted {
    color: var(--brand);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
}

@media (min-width: 992px) {
    .etalase-price--discounted {
        font-size: 16px;
    }
}

.etalase-discount-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Actions */
.etalase-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Icon button (wishlist-like) */
.etalase-iconbtn {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    color: #111;
}

.etalase-iconbtn i {
    font-size: 14px;
    line-height: 1;
}

.etalase-iconbtn--cart {
    border-color: rgba(27, 60, 83, 0.22);
    background: rgba(27, 60, 83, 0.04);
}

.etalase-iconbtn:hover {
    border-color: rgba(27, 60, 83, 0.45);
    color: var(--brand);
    transform: translateY(-1px);
}

.etalase-iconbtn.disabled,
.etalase-iconbtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* loading stabil */
.etalase-iconbtn.is-loading {
    pointer-events: none;
}
.etalase-iconbtn.is-loading i {
    font-size: 14px !important;
}

/* =========================
   EMPTY STATE
   ========================= */
.etalase-empty {
    grid-column: 1 / -1;
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 26px 16px;
    text-align: center;
    color: var(--muted);
}

/* =========================
   AMAZON-LIKE MOBILE CHIPS BAR (biarkan)
   ========================= */
.etalase-chipsbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 12px;
}

.etalase-chipsbar__left {
    flex: 0 0 auto;
    min-width: 84px;
    height: 35px;
    padding: 0 10px;

    border-radius: 999px;
    border: 1px solid var(--brand);
    background: #fff;
    margin-bottom: 6px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.etalase-chipsbar__badge {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.etalase-chipsbar__scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    padding-bottom: 2px;
}
.etalase-chipsbar__scroll::-webkit-scrollbar {
    height: 6px;
}

.etalase-chipsbar__icon {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}
.etalase-chipsbar__icon i {
    font-size: 12px;
    color: var(--brand);
}
.etalase-chipsbar__label {
    font-size: 12px;
    font-weight: 400;
    color: var(--brand);
    line-height: 1;
}

/* =========================
   CUSTOM SELECT DROPDOWN (biarkan)
   ========================= */
.etalase-custom-select {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.etalase-custom-select__trigger {
    border-radius: 999px !important;
    border: 1px solid var(--line) !important;
    padding: 6px 30px 6px 10px !important;
    font-size: 13px !important;
    height: 34px;
    min-width: 86px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
}

.etalase-custom-select__trigger--sm {
    width: 86px;
    min-width: 86px;
}
.etalase-custom-select__trigger--md {
    width: 160px;
    min-width: 160px;
}

.etalase-custom-select__trigger::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--muted);
    transition: transform 0.2s ease;
}
.etalase-custom-select--open .etalase-custom-select__trigger::after {
    transform: translateY(-50%) rotate(180deg);
}
.etalase-custom-select__trigger:hover {
    border-color: var(--brand) !important;
}
.etalase-custom-select--open .etalase-custom-select__trigger {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(27, 60, 83, 0.1);
}

.etalase-custom-select__options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;

    max-height: 280px;
    overflow-y: auto;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.etalase-custom-select--open .etalase-custom-select__options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.etalase-custom-select__option {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid var(--line);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.etalase-custom-select__option:first-child {
    border-radius: 12px 12px 0 0;
}
.etalase-custom-select__option:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.etalase-custom-select__option:hover {
    background: rgba(27, 60, 83, 0.06);
    color: var(--brand);
    font-weight: 600;
}
.etalase-custom-select__option--selected {
    background: rgba(27, 60, 83, 0.12);
    color: var(--brand);
    font-weight: 700;
}

.etalase-custom-select__options::-webkit-scrollbar {
    width: 6px;
}
.etalase-custom-select__options::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 0 0 12px 12px;
}
.etalase-custom-select__options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
.etalase-custom-select__options::-webkit-scrollbar-thumb:hover {
    background: #999;
}
