body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

img {
    max-width: 100%;
    display: block;
}

button,
select,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--text-main);
    outline-offset: 3px;
}

.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 5%;
}

h1,
h2,
h3 {
    font-weight: 500;
    letter-spacing: -0.02em;
}

/* Header */
header {
    position: fixed;
    top: 20px;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius-pill);
    padding: 0.75rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
}

.logo-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-main);
    border-radius: 50%;
    display: inline-block;
    margin: 0 1px;
}

/* Jarak antar link sedikit dirapatkan karena link sekarang punya padding sendiri */
.nav-links {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* Beri bentuk pil dan padding pada semua link */
.nav-links a {
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-pill);
    transition:
        background 0.3s ease,
        opacity 0.3s ease;
}

/* Efek hover: muncul lingkaran transparan tipis */
.nav-links a:hover {
    background: rgba(255, 255, 255, 0.08);
    opacity: 1;
}

/* Menu yang sedang aktif: muncul pil iOS (tanpa garis bawah) */
.nav-links a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.15);
    color: var(--accent-text);
    opacity: 1;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-actions > a {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.nav-actions svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Halaman */
main {
    position: relative;
    padding: calc(75px + 3rem) 0 100px;
    overflow: hidden;
}

main::before {
    content: "";
    position: absolute;
    top: -150px;
    left: 50%;
    width: 1000px;
    height: 500px;
    transform: translateX(-50%);
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.07),
        transparent 65%
    );
    pointer-events: none;
}

.page-head {
    position: relative;
    margin-bottom: 3rem;
    max-width: 640px;
}

.page-head h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.page-head p {
    color: #cccccc;
    font-size: 1rem;
}

/* Toolbar */
.toolbar {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: grid;
    gap: 1rem;
}

.toolbar-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
}

.search {
    position: relative;
}

.search svg {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 0.8rem 1.25rem 0.8rem 2.9rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition:
        border-color 0.3s,
        background 0.3s;
}

.search input::placeholder {
    color: #666666;
}

.search input:hover {
    border-color: var(--border-hover);
}

.search input:focus {
    outline: none;
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.sort {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 0.8rem 1.25rem;
    color: var(--text-main);
    font-size: 0.9rem;
}

.sort option {
    background: #121212;
    color: #ffffff;
}

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.3s;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.filter-btn[aria-pressed="true"] {
    background: var(--text-main);
    color: var(--bg-color);
    border-color: var(--text-main);
}

.filter-sep {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 0.5rem;
}

.result-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.reset-btn {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: 0.85rem;
}

.reset-btn:hover {
    color: var(--text-main);
}

/* Grid produk */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.product-card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.product-card:hover {
    background: var(--surface-hover);
    opacity: 1;
}

.product-badge {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    z-index: 2;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-pill);
    background: rgba(5, 5, 5, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--ok);
}

.product-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.product-badge.sedikit {
    color: var(--warn);
}

.product-badge.habis {
    color: var(--bad);
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1.25rem;
    background: var(--surface-color);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.3s,
        opacity 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card.is-habis .product-image img {
    opacity: 0.45;
}

.product-category {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.product-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 0.5rem;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent-text);
}

.detail-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--text-main);
    color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.product-card:hover .detail-link {
    transform: scale(1.1);
    background: var(--accent-ink);
    color: var(--accent-text);
}

.detail-link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ask-label {
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
}

/* Kosong */
.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 1.5rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
}

.empty h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.empty p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 0.9rem 2rem;
    border-radius: var(--radius-pill);
    font-weight: 500;
    transition: background 0.3s;
}

.btn-outline:hover {
    background: var(--surface-color);
}

.more-wrap {
    text-align: center;
    margin-top: 3rem;
}

/* Banner bawah */
.help-card {
    margin-top: 5rem;
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.help-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.help-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 50ch;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--accent);
    color: var(--accent-ink);
    padding: 1rem 2rem;
    border-radius: var(--radius-pill);
    font-weight: 500;
    transition: transform 0.2s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
    opacity: 1;
}

footer {
    padding: 60px 0 40px;
    border-top: 1px solid var(--border-color);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-bottom address {
    font-style: normal;
}

.legal-links {
    display: flex;
    gap: 1.5rem;
}

.legal-links a:hover {
    color: var(--accent-text);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

@media (max-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .nav-container {
        width: 90%;
    }
    main {
        padding-top: calc(75px + 3rem);
    }
    .page-head h1 {
        font-size: 2.75rem;
    }
    .toolbar-top {
        grid-template-columns: 1fr;
    }
    .filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .product-card {
        padding: 0.75rem;
    }
    .product-badge {
        top: 1.1rem;
        left: 1.1rem;
    }
    .product-title {
        font-size: 0.95rem;
    }
    .product-desc {
        display: none;
    }
    .help-card {
        padding: 1.5rem;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}
