/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #f7f7f8;
    --surface:   #ffffff;
    --text:      #1a1a1a;
    --muted:     #6b7280;
    --accent:    #2563eb;
    --accent-dk: #1d4ed8;
    --danger:    #dc2626;
    --border:    #e5e7eb;
    --radius:    8px;
    --shadow:    0 1px 3px rgba(0,0,0,.08);
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 200vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Container ────────────────────────────────────────────────── */
.container {
    width: 100%;

    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Switches to 80% width on tablet/desktop devices */
@media (min-width: 641px) {
    .container {
        width: 80%;
    }
}

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .75rem 0;
}
.nav-bar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .75rem;
}
.logo {
    font-size: 1.35rem; font-weight: 700; color: var(--text);
    letter-spacing: -.02em;
}
.logo:hover { text-decoration: none; }
nav { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
nav a { color: var(--text); font-size: .9rem; }
.user-greeting { font-size: .85rem; color: var(--muted); }

/* ── Hero ─────────────────────────────────────────────────────── */
/* ── Hero Container ───────────────────────────────────────────── */
/* Mobile first: full width by default */
.hero-container {
    width: 100%;
    margin: auto;
}
/* Desktop only: restrict to 50% width */
@media (min-width: 641px) {
    .hero-container {
        width: 50%;
    }
}

.hero {
    position: relative;
    margin: auto;
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;  /* Stack image on top, content below */
}
.hero-bg-img {
    width: 100%;
    height: auto;
    display: block;
}
.hero-content {
    /* No more position: absolute! Just normal flow below the image */
    padding: 1.5rem 1rem;
    background-color: black;
}



.hero h1 { font-size: 2.25rem; font-weight: 700; margin-bottom: .5rem; }
.hero p  { color: var(--muted); font-size: 1.1rem; margin-bottom: 1.5rem; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: .55rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: .875rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary {
    background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
.btn-danger  { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: .35rem .85rem; font-size: .8rem; }

/* ── Product Grid ─────────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .2s;
}
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.product-card__image {
    height: 180px; background: #f0f0f0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.product-card__image img { object-fit: cover; height: 100%; width: 100%; }
.product-card__body { padding: 1rem; }
.product-card__body h3 { font-size: 1rem; margin-bottom: .35rem; }

/* ── Badges ───────────────────────────────────────────────────── */
.category-badge {
    display: inline-block;
    font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--accent); background: #eff6ff;
    padding: .15rem .55rem; border-radius: 4px;
    margin-bottom: .5rem;
}
.price { font-size: 1.15rem; font-weight: 600; }
.stock { color: var(--muted); font-size: .85rem; }

/* ── Product Detail ───────────────────────────────────────────── */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    padding: 2rem 0;
}
.product-detail__image {
    background: #f0f0f0; border-radius: var(--radius); overflow: hidden;
    min-height: 300px; display: flex; align-items: center; justify-content: center;
}
.product-detail__info h1 { margin-bottom: .5rem; }
.product-detail__info .price { margin: .75rem 0; }
.product-detail__info form { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; }
.product-detail__info input[type=number] {
    width: 64px; padding: .4rem; border: 1px solid var(--border); border-radius: var(--radius);
}

/* ── Search & Filters ─────────────────────────────────────────── */
.search-bar { margin: 1.25rem 0; display: flex; gap: .5rem; }
.search-bar input {
    flex: 1; padding: .5rem .75rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: .9rem;
}
.category-pills { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.pill {
    padding: .3rem .85rem; border-radius: 999px;
    border: 1px solid var(--border); font-size: .8rem; color: var(--muted);
}
.pill:hover { background: var(--bg); text-decoration: none; }
.pill.active {
    background: var(--accent); color: #fff; border-color: var(--accent);
}

/* ── Cart Table ───────────────────────────────────────────────── */
.cart-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.cart-table th, .cart-table td {
    text-align: left; padding: .65rem .75rem;
    border-bottom: 1px solid var(--border);
}
.cart-table th { font-size: .8rem; text-transform: uppercase; color: var(--muted); }
.cart-table input[type=number] {
    width: 56px; padding: .3rem; border: 1px solid var(--border); border-radius: var(--radius);
}
.cart-summary { text-align: right; padding: 1rem 0; }
.total { font-size: 1.25rem; font-weight: 700; }

/* ── Orders ───────────────────────────────────────────────────── */
.order-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem;
}
.order-card__header {
    display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
    margin-bottom: .75rem; font-size: .9rem;
}
.order-card ul { list-style: none; margin: .5rem 0; }
.order-card li { font-size: .9rem; color: var(--muted); padding: .15rem 0; }
.status-badge {
    font-size: .7rem; text-transform: uppercase; padding: .2rem .6rem;
    border-radius: 4px; font-weight: 600;
}
.status-pending   { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-shipped   { background: #e0e7ff; color: #3730a3; }
.status-delivered  { background: #d1fae5; color: #065f46; }
.status-cancelled  { background: #fee2e2; color: #991b1b; }

/* ── Auth Forms ───────────────────────────────────────────────── */
.auth-form {
    max-width: 400px; margin: 3rem auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem;
}
.auth-form h1 { margin-bottom: 1.25rem; font-size: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; margin-bottom: .3rem; color: var(--muted); }
.form-group input {
    width: 100%; padding: .5rem .75rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: .9rem;
}
.form-group input:focus { outline: none; border-color: var(--accent); }
.auth-form .btn { width: 100%; margin-top: .5rem; }
.auth-form p { text-align: center; font-size: .85rem; margin-top: 1rem; }
.error-msg { color: var(--danger); font-size: .85rem; margin-bottom: .75rem; }

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state { color: var(--muted); padding: 2rem 0; text-align: center; }

/* ── Footer ───────────────────────────────────────────────────── */
main.container { flex: 1; padding-top: 1rem; padding-bottom: 2rem; }
.site-footer {
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 1.25rem 0; text-align: center;
    font-size: .8rem; color: var(--muted);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .product-detail { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.6rem; }
}