@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=Cairo:wght@400;500;600;700&display=swap');

:root {
    --forest-900: #0f2e22;
    --forest-800: #163d2c;
    --forest-700: #1f5238;
    --forest-600: #2c6b48;
    --gold-500:   #c9a227;
    --gold-400:   #dab84a;
    --ink:        #1a1f1c;
    --paper:      #f7f6f2;
    --line:       #dcd8cd;
    --danger:     #b23a2f;
    --ok:         #2c6b48;
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
}

[dir="rtl"] body,
body.lang-ku, body.lang-ar {
    font-family: 'Cairo', sans-serif;
}

h1, h2, h3, .display {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--forest-900);
}
body.lang-ku h1, body.lang-ku h2, body.lang-ku h3,
body.lang-ar h1, body.lang-ar h2, body.lang-ar h3 {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

a { color: inherit; }

/* ---- Top bar ---- */
.topbar {
    background: var(--forest-900);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-bottom: 3px solid var(--gold-500);
}
.topbar .brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.02em;
}
.topbar .brand span { color: var(--gold-400); }
.topbar nav { display: flex; gap: 22px; align-items: center; font-size: 14px; }
.topbar nav a { text-decoration: none; opacity: 0.9; }
.topbar nav a:hover { opacity: 1; color: var(--gold-400); }
.cart-pill {
    background: var(--gold-500);
    color: var(--forest-900);
    border-radius: 999px;
    padding: 3px 10px;
    font-weight: 600;
    font-size: 12px;
    margin-inline-start: 6px;
}
.lang-switch { display: flex; gap: 8px; font-size: 13px; }
.lang-switch a { opacity: 0.6; }
.lang-switch a.active { opacity: 1; color: var(--gold-400); font-weight: 600; }

/* ---- Layout ---- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px; }
.page-title { margin: 0 0 20px; font-size: 26px; }

/* ---- Product grid ---- */
.toolbar { display: flex; gap: 12px; margin-bottom: 20px; }
.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 14px;
    background: #fff;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover { box-shadow: 0 6px 18px rgba(15,46,34,0.12); transform: translateY(-2px); }
.card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #eee; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-sku { font-size: 11px; color: #8a8578; letter-spacing: 0.03em; text-transform: uppercase; }
.card-name { font-size: 14.5px; font-weight: 600; line-height: 1.3; min-height: 38px; }
.card-price { margin-top: auto; }
.price-current { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700; color: var(--forest-800); }
.price-custom-badge {
    display: inline-block; font-size: 10px; background: var(--gold-500); color: var(--forest-900);
    border-radius: 3px; padding: 1px 6px; font-weight: 700; margin-inline-start: 6px; vertical-align: middle;
}
.stock-tag { font-size: 12px; font-weight: 600; }
.stock-tag.in { color: var(--ok); }
.stock-tag.low { color: var(--gold-500); }
.stock-tag.out { color: var(--danger); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--forest-800); color: #fff; border: none; border-radius: var(--radius);
    padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--forest-700); }
.btn:disabled { background: #b7b2a4; cursor: not-allowed; }
.btn-gold { background: var(--gold-500); color: var(--forest-900); }
.btn-gold:hover { background: var(--gold-400); }
.btn-outline { background: transparent; border: 1px solid var(--line); color: var(--ink); }

/* ---- Cart table ---- */
.cart-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-table th, .cart-table td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); font-size: 14px; }
.cart-table th { background: var(--forest-900); color: #fff; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.cart-table img { width: 46px; height: 46px; object-fit: cover; border-radius: 4px; }
.qty-input { width: 60px; padding: 6px; border: 1px solid var(--line); border-radius: 4px; text-align: center; }
.cart-summary { max-width: 340px; margin-inline-start: auto; margin-top: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.cart-summary .row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.cart-summary .total { font-size: 18px; font-weight: 700; color: var(--forest-900); }
.notice { font-size: 12px; color: var(--gold-500); font-weight: 600; }

/* ---- Login ---- */
.auth-box { max-width: 380px; margin: 60px auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.error-box { background: #fbeceb; color: var(--danger); border: 1px solid #e6b3ae; border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }

@media (max-width: 640px) {
    .topbar { flex-direction: column; gap: 10px; align-items: flex-start; }
    .grid { grid-template-columns: repeat(2, 1fr); }
}
