@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,300&family=Playfair+Display:wght@600;700&display=swap');

:root {
    --bg: #fafaf8;
    --surface: #ffffff;
    --border: #e8e4de;
    --accent: #1a1a1a;
    --gold: #c9a84c;
    --gold-light: #f0e6cc;
    --text: #1a1a1a;
    --muted: #8a8680;
    --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ── Nav / Header ── */
.site-header {
    padding: 24px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
    text-decoration: none;
}

.logo span {
    color: var(--gold);
}

.header-tag {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
}

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 64px 20px 48px;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--gold);
    background: var(--gold-light);
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 20px;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero p {
    font-size: 16px;
    color: var(--muted);
    font-weight: 400;
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Product Grid ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 64px;
    width: 100%;
}


.product-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    text-align: left;
}

.product-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.08);
}

.product-box img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius) var(--radius) 0 0;
}

.product-box-body {
    padding: 18px 20px 20px;
}

.product-box h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}

.product-box p {
    font-size: 13px;
    color: var(--muted);
    font-weight: 400;
}

.product-box-price {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gold);
    background: var(--gold-light);
    padding: 4px 12px;
    border-radius: 100px;
}

/* ── Footer ── */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: auto;
    padding: 40px 40px 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto 32px;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-section h4 {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 12px;
}

.footer-section a {
    text-decoration: none;
    color: var(--muted);
    font-size: 13px;
    display: block;
    margin-bottom: 8px;
    transition: color 0.2s;
    font-weight: 400;
}

.footer-section a:hover { color: var(--text); }

.footer-bottom {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}



/* ── Auth header buttons ── */
.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-nav-login {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.btn-nav-login:hover { color: var(--text); }

.btn-nav-register {
    font-size: 13px;
    font-weight: 600;
    color: var(--surface);
    background: var(--accent);
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-nav-register:hover { opacity: 0.82; }

.user-nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-nav-name {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.user-nav-name strong { color: var(--text); }

.btn-nav-portal {
    font-size: 13px;
    font-weight: 600;
    color: var(--gold);
    text-decoration: none;
    border: 1px solid var(--gold-light);
    padding: 7px 16px;
    border-radius: 8px;
    background: var(--gold-light);
    transition: opacity 0.2s;
}

.btn-nav-portal:hover { opacity: 0.8; }

.btn-nav-logout {
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.btn-nav-logout:hover { color: var(--text); }

/* ── Wallet pill in header ── */
.wallet-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--gold-light);
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #8a6010;
    text-decoration: none;
    transition: opacity 0.2s;
}

.wallet-pill:hover { opacity: 0.8; }

.wallet-add {
    font-size: 11px;
    font-weight: 600;
    color: var(--gold);
    background: white;
    padding: 2px 8px;
    border-radius: 100px;
    margin-left: 2px;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .site-header {
        padding: 10px 14px;
        height: auto;
        min-height: 52px;
        flex-wrap: nowrap;
        overflow: visible;
    }

    .logo { font-size: 18px; flex-shrink: 0; }

    .header-tag { display: none; }

    /* Nav wrapper */
    #headerNav {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
    }

    /* Not logged in */
    .btn-nav-login { font-size: 12px; }
    .btn-nav-register { font-size: 11px; padding: 7px 10px; }

    /* Logged in */
    .user-nav-name { display: none; }

    .btn-nav-portal {
        font-size: 11px;
        padding: 5px 9px;
        white-space: nowrap;
    }

    .btn-nav-logout { font-size: 11px; white-space: nowrap; }

    /* Wallet pill */
    .wallet-pill {
        font-size: 11px;
        padding: 5px 10px;
        gap: 4px;
        white-space: nowrap;
        flex-shrink: 1;
        min-width: 0;
    }

    .wallet-add {
        font-size: 10px;
        padding: 1px 6px;
    }

    /* Hero */
    .hero { padding: 28px 14px 20px; }
    .hero h1 { font-size: 26px; letter-spacing: -0.5px; line-height: 1.15; }
    .hero p { font-size: 13px; }
    .hero-eyebrow { font-size: 10px; padding: 4px 12px; }

    /* Product grid */
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 0 12px 40px;
    }

    /* On tablet, show 3 columns for 5 products */
    @media (min-width: 600px) and (max-width: 768px) {
        .product-grid { grid-template-columns: repeat(3, 1fr); }
    }

    .product-visual { height: 130px; }
    .product-box-body { padding: 10px 12px 12px; }
    .product-box h3 { font-size: 13px; margin-bottom: 3px; }
    .product-box p { font-size: 11px; }
    .product-box-price { font-size: 11px; padding: 3px 9px; margin-top: 6px; }

    /* Footer */
    .footer { padding: 24px 14px 14px; }
    .footer-content { gap: 14px; }
    .footer-section h4 { font-size: 10px; margin-bottom: 8px; }
    .footer-section a { font-size: 11px; margin-bottom: 5px; }
    .footer-bottom { font-size: 11px; padding-top: 14px; }
}

@media (max-width: 400px) {
    .product-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 22px; }
    .logo { font-size: 16px; }
    .wallet-pill { max-width: 110px; }
    .wallet-add { display: none; }
}

}


}


/* ── Product grid: 4 top row, 3 bottom centred ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 64px;
    width: 100%;
}

/* Cards 5-7 sit in a 4-col grid — centre them by starting at col 1 of a sub-row */
/* Use a trick: wrap row2 in a centred flex via nth-child rules */
.product-box:nth-child(5) { grid-column: 1; }
.product-box:nth-child(6) { grid-column: 2; }
.product-box:nth-child(7) { grid-column: 3; }

@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .product-box:nth-child(5),
    .product-box:nth-child(6),
    .product-box:nth-child(7) { grid-column: auto; }
}

@media (max-width: 640px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 12px 40px; }
    .product-box:nth-child(5),
    .product-box:nth-child(6),
    .product-box:nth-child(7) { grid-column: auto; }
    .product-visual { height: 130px; }
    .product-box-body { padding: 10px 12px 12px; }
    .product-box h3 { font-size: 13px; }
    .product-box p { font-size: 11px; }
    .product-box-price { font-size: 11px; padding: 3px 9px; }
}

@media (max-width: 400px) {
    .product-grid { grid-template-columns: 1fr; }
    .product-box:nth-child(n) { grid-column: auto; }
}
