/* PAGE */
.product-page {
    padding: 40px 0 80px;
    background: #f5f7fb;
}

/* BREADCRUMB */
.breadcrumb {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.breadcrumb a {
    color: #2563eb;
}

/* ===============================
   FILTER OVERLAY
=============================== */
.filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 9999;

    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.filter-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===============================
   FILTER BOX (DESKTOP)
=============================== */
.filter-box {
    position: absolute;
    top: 80px;
    right: 24px;

    width: 420px;
    max-width: 92%;
    max-height: calc(100vh - 120px);

    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,.2);

    display: flex;
    flex-direction: column;
    overflow: hidden;

    transform: translateY(10px);
    transition: transform .25s ease;
}

.filter-overlay.active .filter-box {
    transform: translateY(0);
}

/* ===============================
   HEADER
=============================== */
.filter-header {
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    border-bottom: 1px solid #e5e7eb;
}

.filter-header h4 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.filter-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

/* ===============================
   CONTENT
=============================== */
.filter-content {
    padding: 20px;
    overflow-y: auto;
}

.filter-group {
    margin-bottom: 26px;
}

.filter-group h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    color: #111827;
}

/* OPTION */
.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 14px;
    cursor: pointer;
}

.filter-option input {
    accent-color: #16a34a;
}

/* ===============================
   FOOTER
=============================== */
.filter-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.filter-footer button {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

/* ===============================
   MOBILE MODE (BOTTOM SHEET)
=============================== */
@media (max-width: 768px) {

    .filter-box {
        top: auto;
        right: 0;
        left: 0;
        bottom: -100%;

        width: 100%;
        max-width: 100%;
        max-height: 85vh;

        border-radius: 18px 18px 0 0;
        transition: bottom .3s ease;
        overflow: hidden;
    }

    .filter-overlay.active .filter-box {
        bottom: 0;
    }

    .filter-header {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #fff;
        padding: 26px 20px 16px;
    }

    .filter-header::before {
        content: "";
        width: 48px;
        height: 4px;
        background: #d1d5db;
        border-radius: 999px;
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
    }

    .filter-content {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;

        padding: 16px 20px;
        max-height: 55vh;
        overflow-y: auto;
    }

    .filter-content label {
        display: flex;
        align-items: center;
        gap: 10px;

        width: 100%;
        padding: 12px 14px;

        border: 1px solid #e5e7eb;
        border-radius: 12px;
        background: #fff;

        font-size: 14px;
        line-height: 1.3;
        cursor: pointer;
    }

    .filter-content label input {
        flex-shrink: 0;
        accent-color: #2563eb;
    }

    .filter-content label:has(input:checked) {
        border-color: #2563eb;
        background: #eff6ff;
        color: #1d4ed8;
        font-weight: 600;
    }

    .filter-footer {
        position: sticky;
        bottom: 0;
        z-index: 2;

        background: #fff;
        padding: 14px 20px 18px;
        border-top: 1px solid #e5e7eb;
    }

    .filter-footer button {
        width: 100%;
        height: 46px;
        border-radius: 12px;
    }
}


/* HEADER */
.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.product-header h1 {
    font-size: 26px;
    font-weight: 800;
}

/* HEADER ACTION */
.product-header-actions {
    display: flex;
    gap: 12px;
}

.btn-filter {
    height: 40px;
    padding: 0 18px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-weight: 600;
}

.sort-select {
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
}

/* FILTER BAR */
.filter-bar {
    display: flex;
    gap: 12px;
    background: #eef2ff;
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 18px;
}

.filter-bar input,
.filter-bar select {
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 14px;
}

/* INFO */
.product-info {
    font-size: 14px;
    color: #374151;
    margin-bottom: 16px;
}

/* GRID */
.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

/* CARD */
.product-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,.12);
}

/* THUMB */
.product-thumb {
    position: relative;
}

.product-thumb img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #16a34a;
    color: #fff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

/* BODY */
.product-body {
    padding: 14px;
}

.product-body h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.product-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.product-price {
    font-size: 16px;
    font-weight: 800;
    color: #f97316;
    margin-bottom: 10px;
}

.product-extra {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
}

/* ===== MOBILE FILTER ===== */
.mobile-filter {
    display: none;
    margin-bottom: 16px;
}

/* SEARCH */
.mobile-search input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

/* ROW */
.mobile-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* SCROLL PILL */
.filter-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
}

.filter-scroll::-webkit-scrollbar {
    display: none;
}

/* PILL */
.filter-pill {
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #d1d5db;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ICON ACTION */
.filter-actions {
    display: flex;
    gap: 6px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #2563eb;
    background: #fff;
    color: #2563eb;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .filter-bar {
        display: none; /* hide desktop filter */
    }

    .mobile-filter {
        display: block;
    }
}


/* RESPONSIVE */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .filter-bar {
        display: none;
    }
}

@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    #overlayGame .filter-content,
    #overlayType .filter-content,
    #overlaySort .filter-content {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        padding: 16px 20px !important;
    }

    #overlayGame .filter-content label,
    #overlayType .filter-content label,
    #overlaySort .filter-content label {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 13px 14px !important;
        gap: 10px !important;

        border: 1px solid #e5e7eb !important;
        border-radius: 12px !important;
        background: #fff !important;

        font-size: 14px !important;
        line-height: 1.3 !important;
        white-space: normal !important;
    }

    #overlayGame .filter-content label:has(input:checked),
    #overlayType .filter-content label:has(input:checked),
    #overlaySort .filter-content label:has(input:checked) {
        border-color: #2563eb !important;
        background: #eff6ff !important;
        color: #1d4ed8 !important;
        font-weight: 700 !important;
    }
}
