:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #122033;
    --muted: #5b6b80;
    --accent: #4f46e5;
    --accent-soft: #eef1ff;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: linear-gradient(135deg, #f9fbff 0%, var(--bg) 100%);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid var(--border);
}

.brand {
    font-size: 1.3rem;
    font-weight: 800;
}

.nav-links {
    display: flex;
    gap: 18px;
    color: var(--muted);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.primary-btn,
.ghost-btn,
.close-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    cursor: pointer;
}

.primary-btn {
    background: var(--accent);
    color: white;
}

.ghost-btn {
    background: var(--accent-soft);
    color: var(--accent);
}

main {
    padding: 28px;
}

.hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: center;
    margin-bottom: 32px;
}

.hero h1 {
    font-size: 2.5rem;
    margin: 0 0 8px;
}

.hero-text,
.section-heading p,
.cart-items p,
.payment-message,
.switch-text {
    color: var(--muted);
}

.hero-card,
.products-section,
.cart-panel,
.checkout-panel,
.modal-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 12px 30px rgba(18, 32, 51, 0.06);
}

.hero-card {
    padding: 24px;
}

.eyebrow {
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
}

.products-section {
    padding: 24px;
    margin-bottom: 24px;
}

.section-heading {
    margin-bottom: 16px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.product-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(180deg, #fff, #fbfcff);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 4px;
}

.product-tag {
    display: inline-block;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
}

.product-card h3 {
    margin: 0;
}

.price {
    font-weight: 700;
    margin-top: auto;
}

.product-card button {
    width: 100%;
    margin-top: 6px;
}

.checkout-section {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
}

.cart-panel,
.checkout-panel {
    padding: 24px;
}

.cart-items {
    display: grid;
    gap: 12px;
    min-height: 120px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.cart-summary>div {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.grand-total {
    font-size: 1.1rem;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 10px;
}

.checkout-form label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
}

.checkout-form input {
    width: 100%;
    margin-top: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.payment-message {
    margin-top: 12px;
    font-weight: 600;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(18, 32, 51, 0.55);
    display: grid;
    place-items: center;
    padding: 16px;
}

.modal.hidden {
    display: none;
}

.modal-card {
    width: min(420px, 100%);
    padding: 24px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    font-size: 1.3rem;
}

.auth-form label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
}

.auth-form input {
    width: 100%;
    margin-top: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.switch-text {
    cursor: pointer;
    margin-top: 8px;
}

@media (max-width: 800px) {

    .hero,
    .checkout-section {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-wrap: wrap;
        gap: 10px;
    }
}