/* ================================
   PRODUCTS PAGE
================================ */

.products-page {
    min-height: 100vh;
    background: var(--cream);
}

/* ── PAGE HEADER ── */
.page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 40px 48px 28px;
}

.page-header__left {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.page-header__title {
    font-size: 30px;
    font-weight: 400;
    letter-spacing: .3px;
    color: var(--text);
}

.page-header__sub {
    font-size: 13px;
    color: var(--muted);
    letter-spacing: .5px;
    font-weight: 400;
}

/* ── FILTER TRIGGER ── */
.filter-trigger-wrap { position: relative; }

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color .2s;
}
.filter-btn:hover { color: var(--text); }
.filter-btn svg { width: 14px; height: 14px; }

/* ── FILTER POPUP ── */
.filter-popup {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: 220px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.10);
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    z-index: 200;
    padding: 20px 20px 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transform-origin: top right;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
.filter-popup.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.filter-popup__close {
    position: absolute;
    top: 10px; right: 12px;
    width: 24px; height: 24px;
    border: 0; background: transparent;
    cursor: pointer; font-size: 18px;
    color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    line-height: 1; padding: 0; font-family: inherit; transition: color .2s;
}
.filter-popup__close:hover { color: var(--text); }

.filter-popup__section { margin-bottom: 14px; }

.filter-popup__section-label {
    font-size: 12px; font-weight: 700;
    color: var(--text);
    text-decoration: underline; text-underline-offset: 3px;
    display: block; margin-bottom: 6px; letter-spacing: .3px;
}

.filter-popup__links {
    list-style: none;
    display: flex; flex-direction: column; gap: 4px; padding-left: 10px;
}
.filter-popup__links a {
    font-size: 13px; color: var(--text);
    letter-spacing: .2px; transition: opacity .2s; display: block; padding: 1px 0;
}
.filter-popup__links a:hover { opacity: .55; }
.filter-popup__links a.is-active { font-weight: 700; }

.filter-popup__standalone {
    display: block; font-size: 13px; font-weight: 700;
    color: var(--text); text-decoration: underline; text-underline-offset: 3px;
    margin-bottom: 10px; letter-spacing: .2px; transition: opacity .2s;
}
.filter-popup__standalone:hover { opacity: .6; }

.filter-popup__divider { height: 1px; background: rgba(0,0,0,.08); margin: 12px 0; }

.filter-popup__actions { display: flex; flex-direction: column; gap: 8px; }

.btn-enforce {
    width: 100%; height: 38px; background: #7a7a65; color: #fff;
    border: 0; font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; cursor: pointer; font-family: inherit; transition: background .2s;
}
.btn-enforce:hover { background: #5f5f4d; }

.btn-reset-filter {
    width: 100%; height: 38px; background: transparent; color: var(--text);
    border: 1px solid rgba(0,0,0,.18); font-size: 12px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer;
    font-family: inherit; text-align: center;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: border-color .2s, color .2s;
}
.btn-reset-filter:hover { border-color: var(--text); }

/* ── PRODUCT GRID ── */
.products-grid-wrap {
    padding: 0 48px 80px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;          /* gap antar card */
}

/* ── PRODUCT CARD ── */
.prod-card {
    position: relative;
    background: var(--cream);
    cursor: pointer;
}

/* ── MEDIA — tinggi dikontrol, tidak kepotong ── */
.prod-card__media {
    position: relative;
    width: 100%;
    height: 650px;
    overflow: hidden;
    background: #e2d9cc;
}

.prod-card__media > a {
    display: block;
    width: 100%;
    height: 100%;
}

.prod-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform .65s cubic-bezier(.4,0,.2,1);
}

.prod-card:hover .prod-card__img { transform: scale(1.03); }

.prod-card__overlay {
    position: absolute; inset: 0;
    background: rgba(15,13,10,0);
    transition: background .38s ease;
    pointer-events: none; z-index: 1;
}
.prod-card:hover .prod-card__overlay { background: rgba(15,13,10,.28); }

/* Wishlist — di luar <a>, absolute di atas media */
.prod-card__wish {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 3;
    width: 32px; height: 32px;
    border: 0;
    background: rgba(255,255,255,.88);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: 50%;
    opacity: 0; transform: scale(.75);
    transition: opacity .28s ease, transform .28s ease, background .2s;
}
.prod-card__wish img { width: 14px; height: 14px; object-fit: contain; }
.prod-card:hover .prod-card__wish { opacity: 1; transform: scale(1); }
.prod-card__wish:hover { background: #fff; }
.prod-card__wish.is-wishlisted { opacity: 1; transform: scale(1); }

/* Info */
.prod-card__info {
    padding: 10px 0 20px;
    text-decoration: none;
    display: block;
    color: inherit;
}

.prod-card__name {
    font-size: 20px;
    font-weight: 500;
    color: black;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.prod-card__price {
    font-size: 16px;
    color: var(--muted);
    letter-spacing: .3px;
}

/* ── EMPTY STATE ── */
.products-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 20px;
    color: var(--muted);
    font-size: 14px;
}

/* ================================
   RESPONSIVE — SMALL LAPTOP (≤ 1280px)
================================ */
@media (max-width: 1280px) {
    .page-header { padding: 32px 36px 22px; }
    .page-header__title { font-size: 26px; }
    .products-grid-wrap { padding: 0 36px 70px; }
    .products-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .prod-card__media { height: 520px; }
    .prod-card__name { font-size: 17px; }
    .prod-card__price { font-size: 14px; }
}

/* ================================
   RESPONSIVE — MEDIUM LAPTOP (≤ 1024px)
   update dari yang sudah ada
================================ */
@media (max-width: 1024px) {
    .page-header { padding: 28px 28px 20px; }
    .page-header__title { font-size: 22px; }
    .products-grid-wrap { padding: 0 28px 56px; }
    .products-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .prod-card__media { height: 420px; }
    .prod-card__name { font-size: 15px; }
    .prod-card__price { font-size: 13px; }
}

@media (max-width: 768px) {
    .page-header { padding: 24px 20px 20px; }
    .page-header__title { font-size: 22px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .products-grid-wrap { padding: 0 20px 60px; }
    /* Di mobile 2 kolom, ratio bisa lebih portrait */
    .prod-card__media { aspect-ratio: 2 / 3; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .products-grid-wrap { padding: 0 12px 60px; }
}
/* ================================================
   MOBILE RESPONSIVE PATCH
================================================ */

@media (max-width: 768px) {

    /* Clear fixed height dari rule 1024px supaya aspect-ratio bisa kerja */
    .prod-card__media {
        height: auto !important;
        aspect-ratio: 3 / 4;
    }

    /* Page header */
    .page-header         { padding: 20px 16px 16px; flex-wrap: wrap; gap: 8px; }
    .page-header__title  { font-size: 20px; }
    .page-header__sub    { font-size: 12px; }

    /* Grid & wrap */
    .products-grid-wrap  { padding: 0 16px 56px; }
    .products-grid       { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* Card text */
    .prod-card__name     { font-size: 14px; letter-spacing: .3px; margin-bottom: 2px; }
    .prod-card__price    { font-size: 12px; }
    .prod-card__info     { padding: 8px 0 14px; }

    /* Wishlist: selalu visible di touch (no hover) */
    .prod-card__wish     { opacity: 1; transform: scale(1); }

    /* Filter popup: full width di mobile */
    .filter-popup {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        transform: translateY(8px);
        transform-origin: bottom center;
        border-radius: 14px 14px 0 0;
        max-height: 80vh;
        overflow-y: auto;
        box-shadow: 0 -8px 32px rgba(0,0,0,.15);
        padding: 24px 24px 32px;
    }
    .filter-popup.is-open { transform: translateY(0); }
}

@media (max-width: 480px) {

    .page-header         { padding: 16px 14px 14px; }
    .page-header__title  { font-size: 18px; }

    .products-grid-wrap  { padding: 0 10px 48px; }
    .products-grid       { grid-template-columns: repeat(2, 1fr); gap: 8px; }

    .prod-card__media    { aspect-ratio: 3 / 4; }
    .prod-card__name     { font-size: 12px; letter-spacing: .2px; }
    .prod-card__price    { font-size: 11px; }
    .prod-card__info     { padding: 6px 0 12px; }

    /* Wish button sedikit lebih kecil */
    .prod-card__wish     { width: 28px; height: 28px; top: 10px; right: 10px; }
    .prod-card__wish img { width: 12px; height: 12px; }
}

@media (max-width: 390px) {

    .products-grid-wrap  { padding: 0 8px 40px; }
    .products-grid       { gap: 6px; }

    .prod-card__name     { font-size: 11px; }
    .prod-card__price    { font-size: 11px; }
    .prod-card__info     { padding: 5px 0 10px; }
}