/* ===========================
   Design tokens
   =========================== */
:root {
    --ink: #16332B;          /* deep teal-green — headers, text */
    --ink-soft: #2B4A40;
    --sand: #FAF6EE;         /* warm background */
    --sand-dark: #F0E9D8;
    --gold: #C98A2C;         /* accent — CTAs, prices */
    --gold-dark: #A96F1C;
    --white: #FFFFFF;
    --line: #E4DCC8;
    --danger: #B23A2E;
    --success: #2F6B4F;

    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --radius: 6px;
    --shadow: 0 2px 10px rgba(22, 51, 43, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--sand);
    color: var(--ink);
    line-height: 1.55;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 0.5em;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--gold-dark); }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

img { max-width: 100%; display: block; }

/* ===========================
   Header
   =========================== */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 20px;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    white-space: nowrap;
}

.search-form {
    flex: 1;
    display: flex;
    max-width: 420px;
}

.search-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.search-form button {
    padding: 10px 16px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--white);
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.cart-link { position: relative; }
.cart-count {
    background: var(--gold);
    color: var(--white);
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 999px;
    margin-left: 4px;
}

.category-bar {
    background: var(--ink);
}
.category-bar .container {
    display: flex;
    gap: 22px;
    padding: 10px 20px;
    overflow-x: auto;
}
.category-bar a {
    color: var(--sand);
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
}
.category-bar a:hover { color: var(--gold); }

/* ===========================
   Layout
   =========================== */
.main-content { min-height: 60vh; padding: 32px 20px; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

/* ===========================
   Buttons
   =========================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
}
.btn-primary { background: var(--gold); color: var(--white); border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-dark); color: var(--white); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }

/* ===========================
   Product grid & cards
   =========================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.product-card .thumb {
    aspect-ratio: 1 / 1;
    background: var(--sand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-card .info { padding: 14px; }
.product-card h3 { font-size: 1rem; margin-bottom: 6px; }
.product-card .price {
    font-weight: 700;
    color: var(--gold-dark);
    font-family: var(--font-display);
}
.price .strike {
    text-decoration: line-through;
    color: #999;
    font-weight: 400;
    font-size: 0.85rem;
    margin-right: 6px;
}
.badge-out {
    display: inline-block;
    background: var(--danger);
    color: var(--white);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    margin-top: 4px;
}

/* ===========================
   Product detail
   =========================== */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
@media (max-width: 768px) { .product-detail { grid-template-columns: 1fr; } }

.product-detail .gallery img {
    border-radius: var(--radius);
    border: 1px solid var(--line);
}
.product-detail .price-large {
    font-size: 1.8rem;
    font-family: var(--font-display);
    color: var(--gold-dark);
    margin: 12px 0;
}
.qty-input {
    width: 70px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

/* ===========================
   Forms & tables
   =========================== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--white);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}

table { width: 100%; border-collapse: collapse; }
table th, table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}
table th { font-weight: 700; background: var(--sand-dark); }

.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.92rem;
}
.alert-success { background: #E4F2E9; color: var(--success); border: 1px solid #BEDFCB; }
.alert-error { background: #F8E4E1; color: var(--danger); border: 1px solid #EBBDB6; }

.status-pill {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
}
.status-pending { background: #FBEBD0; color: #92650B; }
.status-processing { background: #DCE7F5; color: #24518C; }
.status-shipped { background: #E1DEF7; color: #4B3B9E; }
.status-delivered { background: #DCF0E2; color: var(--success); }
.status-cancelled { background: #F8DAD5; color: var(--danger); }

/* ===========================
   Cart & checkout
   =========================== */
.cart-table img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.cart-summary {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    position: sticky;
    top: 100px;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.95rem; }
.summary-total { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }

/* ===========================
   Footer
   =========================== */
.site-footer {
    background: var(--ink);
    color: var(--sand);
    padding: 28px 0;
    margin-top: 60px;
    text-align: center;
    font-size: 0.88rem;
}

/* ===========================
   Empty states
   =========================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7A8A83;
}

/* ===========================
   Pagination
   =========================== */
.pagination { display: flex; gap: 8px; margin-top: 28px; justify-content: center; }
.pagination a, .pagination span {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.pagination .active { background: var(--ink); color: var(--white); border-color: var(--ink); }
