/* ==========================================================================
   LUNA — Women's Edit — Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  --bg: #f8f6f2;
  --bg-alt: #ece7df;
  --ink: #201d1b;
  --ink-soft: #201d1bb3;
  --rose: #9a6b68;
  --blush: #d8a9a4;
  --sand: #d9c9b4;
  --olive: #96987d;
  --line: #20201a1a;
  --white: #ffffff;
  --radius: 2px;
  --serif: 'Cormorant Garamond', 'Tajawal', serif;
  --sans: 'Tajawal', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; background: none; border: none; }
.wrap { max-width: 1500px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 1024px) { .wrap { padding: 0 56px; } }

.serif { font-family: var(--serif); }
.eyebrow {
  font-size: 10px; font-weight: 800; letter-spacing: 0.3em; color: var(--rose);
  margin-bottom: 14px; text-transform: uppercase;
}
.h1 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.06em; line-height: 0.95; font-size: clamp(2.6rem, 8vw, 6.5rem); margin: 0; }
.h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.06em; line-height: 0.95; font-size: clamp(2rem, 5vw, 4.5rem); margin: 0; }
.h3 { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 32px; border-radius: 0; font-size: 11px; font-weight: 800;
  letter-spacing: 0.16em; transition: 0.25s;
}
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--rose); }
.btn-outline { border: 1px solid rgba(32,29,27,0.25); background: transparent; }
.btn-outline:hover { background: var(--ink); color: var(--white); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Top bar / header */
.topbar { background: var(--ink); color: var(--bg); text-align: center; font-size: 11px; font-weight: 500; letter-spacing: 0.22em; padding: 11px 24px; }
.topbar span { color: var(--blush); margin: 0 10px; }
header.site {
  position: sticky; top: 0; z-index: 40; background: rgba(248,246,242,0.95);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 88px; }
.icon-btn { border-radius: 999px; padding: 12px; transition: 0.2s; }
.icon-btn:hover { background: rgba(0,0,0,0.05); }
.logo { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; }
.logo .mark { font-family: var(--serif); font-size: 33px; letter-spacing: -0.08em; line-height: 1; }
.logo .sub { margin-top: 6px; font-size: 8px; letter-spacing: 0.42em; color: #8b716c; }
.header-side { display: flex; align-items: center; gap: 10px; }
.cart-pill {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  border-radius: 999px; padding: 12px 16px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; transition: 0.2s;
}
.cart-pill:hover { border-color: rgba(0,0,0,0.4); }
.cart-pill .n { color: var(--rose); }
nav.main-nav { display: none; justify-content: center; gap: 46px; padding: 0 0 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.15em; }
nav.main-nav a:hover { color: var(--rose); }
@media (min-width: 1024px) { nav.main-nav { display: flex; } }

/* Mobile drawer */
.drawer-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(32,29,27,0.4); backdrop-filter: blur(2px); display: none; }
.drawer-overlay.open { display: block; }
.drawer { height: 100%; width: 86%; max-width: 420px; background: var(--bg); padding: 32px; box-shadow: 0 0 40px rgba(0,0,0,0.2); }
.drawer .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 60px; }
.drawer a { display: block; border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 20px; font-size: 18px; font-weight: 700; }

/* Hero */
.hero { position: relative; margin: 0 auto; max-width: 1500px; padding: 24px 24px 32px; overflow: hidden; }
@media (min-width: 1024px) { .hero { padding: 40px 56px 32px; } }
.hero-media { position: relative; overflow: hidden; border-radius: var(--radius); aspect-ratio: 16/10; background: var(--sand); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to left, rgba(31,27,23,0.7), rgba(31,27,23,0.1) 60%, transparent); }
.hero-content { position: absolute; z-index: 5; bottom: 0; right: 0; padding: 40px; color: white; max-width: 640px; }
@media (min-width: 1024px) { .hero-content { padding: 64px; } }
.hero-content .tag { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.28em; color: #f0d8d1; margin-bottom: 20px; }
.hero-content h1 { font-size: clamp(3rem, 9vw, 7rem); color: white; }
.hero-content p { margin-top: 24px; max-width: 380px; font-size: 1rem; line-height: 1.8; color: rgba(255,255,255,0.8); }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

/* Sections */
section.pad { padding: 80px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 40px; flex-wrap: wrap; }

/* Category tiles */
.cat-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-tile { position: relative; min-height: 300px; overflow: hidden; padding: 32px; color: var(--ink); }
.cat-tile.blush { background: var(--blush); }
.cat-tile.sand { background: var(--sand); }
.cat-tile.olive { background: var(--olive); }
.cat-tile .idx { font-size: 10px; font-weight: 800; letter-spacing: 0.24em; opacity: 0.65; }
.cat-tile h3 { font-size: 2.2rem; margin-top: 60px; }
.cat-tile p { margin-top: 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; opacity: 0.6; }

/* Product grid */
.filter-chips { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 11px 20px; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; transition: 0.2s; }
.chip.active { background: var(--ink); color: white; border-color: var(--ink); }
.chip:not(.active):hover { border-color: rgba(0,0,0,0.5); }

.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 12px; }
@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
.product-grid.wide { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .product-grid.wide { grid-template-columns: repeat(3, 1fr); } }
.card { display: block; }
.card-media { position: relative; aspect-ratio: 0.8; overflow: hidden; background: var(--sand); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s; }
.card:hover .card-media img { transform: scale(1.05); }
.fav-btn {
  position: absolute; top: 14px; left: 14px; background: rgba(255,255,255,0.85);
  border-radius: 999px; padding: 12px; backdrop-filter: blur(4px); transition: 0.2s;
}
.fav-btn.active { color: #a46766; }
.fav-btn:hover { background: white; }
.add-btn {
  position: absolute; left: 14px; right: 14px; bottom: 14px; background: var(--ink); color: white;
  padding: 14px; font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-align: center;
  transform: translateY(10px); opacity: 0; transition: 0.25s;
}
.card:hover .add-btn { transform: translateY(0); opacity: 1; }
.card-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-top: 16px; }
.card-info h3 { font-size: 0.9rem; font-weight: 600; margin: 0; }
.card-info .meta { margin-top: 6px; font-size: 11px; color: rgba(32,29,27,0.5); }
.card-info .price { font-size: 0.9rem; font-weight: 800; white-space: nowrap; }
.empty-state { border: 1px dashed rgba(0,0,0,0.2); padding: 56px; text-align: center; }

/* Philosophy split */
.split { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .split { grid-template-columns: 1fr 1fr; } }
.split .media { min-height: 400px; background: #c5b6a2; overflow: hidden; }
.split .media img { width: 100%; height: 100%; object-fit: cover; }
.split .copy { background: var(--ink); color: var(--bg); padding: 48px; display: flex; flex-direction: column; justify-content: center; }
@media (min-width: 1024px) { .split .copy { padding: 80px; } }
.split .copy h2 { color: var(--bg); }
.split .copy em { color: var(--blush); font-style: italic; font-weight: 400; }
.split .copy p { margin-top: 30px; max-width: 410px; font-size: 0.9rem; line-height: 1.9; color: rgba(255,255,255,0.6); }

/* Newsletter */
.newsletter { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--blush); text-align: center; padding: 90px 24px; }
.newsletter form { max-width: 420px; margin: 34px auto 0; display: flex; border-bottom: 1px solid rgba(32,29,27,0.4); padding-bottom: 12px; }
.newsletter input { flex: 1; background: transparent; border: none; outline: none; text-align: center; font-size: 0.9rem; }
.newsletter button { font-size: 10px; font-weight: 800; letter-spacing: 0.16em; }

/* Footer */
footer.site { background: var(--ink); color: var(--bg); padding: 56px 24px; }
@media (min-width: 1024px) { footer.site { padding: 56px; } }
.footer-row { display: flex; flex-direction: column; gap: 44px; }
@media (min-width: 1024px) { .footer-row { flex-direction: row; align-items: flex-start; justify-content: space-between; } }
.footer-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 60px; font-size: 11px; color: rgba(248,246,242,0.65); }
@media (min-width: 640px) { .footer-links { grid-template-columns: repeat(3, 1fr); } }
.footer-bottom { max-width: 1500px; margin: 56px auto 0; display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 22px; font-size: 9px; letter-spacing: 0.15em; color: rgba(255,255,255,0.35); }

/* Simple sub-page header */
.page-header { border-bottom: 1px solid var(--line); padding: 28px 0; }
.page-header .row { display: flex; align-items: center; justify-content: space-between; }
.back-link { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; }

/* Forms */
.field { display: block; font-size: 11px; font-weight: 700; }
.field input, .field select, .field textarea {
  margin-top: 10px; width: 100%; border: none; border-bottom: 1px solid rgba(0,0,0,0.2);
  background: transparent; padding: 12px 0; font-size: 0.9rem; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--rose); }
.field textarea { border: 1px solid rgba(0,0,0,0.15); padding: 12px; min-height: 120px; }
.field-grid { display: grid; gap: 20px; }
@media (min-width: 640px) { .field-grid.cols-2 { grid-template-columns: 1fr 1fr; } }

/* Cart page */
.cart-layout { display: grid; gap: 48px; margin-top: 56px; }
@media (min-width: 1024px) { .cart-layout { grid-template-columns: 1fr 360px; } }
.cart-line { display: flex; gap: 24px; border-bottom: 1px solid var(--line); padding: 28px 0; }
.cart-line:first-child { border-top: 1px solid var(--line); }
.cart-line img { width: 128px; height: 176px; object-fit: cover; background: #ddd4c8; }
.qty-box { display: flex; align-items: center; gap: 20px; border: 1px solid rgba(0,0,0,0.15); padding: 8px 16px; width: fit-content; }
.summary-box { background: var(--bg-alt); padding: 32px; height: fit-content; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 10px 0; }
.summary-total { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 800; padding-top: 20px; }

.checkout-grid { grid-template-columns: 1fr; }
@media (min-width: 1024px) { .checkout-grid { grid-template-columns: 1fr 380px; } }

/* Product detail */
.product-layout { display: grid; gap: 48px; margin: 48px 0; }
@media (min-width: 1024px) { .product-layout { grid-template-columns: 1.1fr 0.9fr; gap: 80px; } }
.gallery { display: grid; gap: 16px; grid-template-columns: 100px 1fr; }
.thumbs { display: flex; gap: 12px; flex-direction: column; }
.thumbs button { aspect-ratio: 0.8; overflow: hidden; border: 2px solid transparent; }
.thumbs button.active { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.main-image { aspect-ratio: 0.82; overflow: hidden; background: #ded6ca; }
.main-image img { width: 100%; height: 100%; object-fit: cover; }
.size-row { display: flex; gap: 8px; flex-wrap: wrap; }
.size-btn { height: 48px; min-width: 56px; padding: 0 10px; border: 1px solid rgba(0,0,0,0.15); font-size: 12px; font-weight: 700; }
.size-btn.active { border-color: var(--ink); background: var(--ink); color: white; }

/* Account */
.acct-card { max-width: 480px; border: 1px solid var(--line); background: rgba(255,255,255,0.4); padding: 40px; margin-top: 48px; }
.order-row { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 18px 0; font-size: 0.9rem; }
.tabs { display: flex; gap: 8px; margin-top: 24px; }
.tab { padding: 12px 20px; font-size: 11px; font-weight: 700; border-bottom: 2px solid transparent; }
.tab.active { border-color: var(--ink); }

/* Admin */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  display: none; width: 280px; flex-shrink: 0; background: var(--ink); color: white; padding: 32px;
  position: sticky; top: 0; height: 100vh;
}
@media (min-width: 1024px) { .admin-sidebar { display: flex; flex-direction: column; } }
.admin-sidebar .mark { font-family: var(--serif); font-size: 34px; letter-spacing: -0.08em; }
.admin-sidebar .sub { margin-top: 6px; font-size: 9px; letter-spacing: 0.22em; color: rgba(255,255,255,0.5); }
.admin-nav { margin-top: 60px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.admin-nav button { text-align: right; display: flex; align-items: center; gap: 12px; padding: 14px; color: rgba(255,255,255,0.6); }
.admin-nav button.active { background: rgba(255,255,255,0.1); color: white; }
.admin-main { flex: 1; padding: 32px 24px 80px; max-width: 1100px; margin: 0 auto; width: 100%; }
@media (min-width: 1024px) { .admin-main { padding: 48px 56px; } }
.admin-topline { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 32px 0; }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { border: 1px solid var(--line); padding: 24px; background: white; }
.stat-card .n { font-family: var(--serif); font-size: 2.4rem; }
.stat-card .l { font-size: 11px; color: rgba(0,0,0,0.5); margin-top: 6px; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 20px; }
table.admin-table th { text-align: right; font-size: 10px; letter-spacing: 0.1em; color: rgba(0,0,0,0.5); padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.admin-table td { padding: 14px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.admin-table img { width: 44px; height: 56px; object-fit: cover; }
.status-select { border: 1px solid rgba(0,0,0,0.15); padding: 6px 10px; font-size: 12px; }
.upload-zone {
  margin-top: 20px; height: 130px; border: 1px dashed rgba(0,0,0,0.25); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; font-size: 12px; transition: 0.2s;
}
.upload-zone:hover { border-color: var(--rose); }
.upload-zone:disabled { opacity: 0.4; cursor: not-allowed; }
.img-thumb-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.img-thumb { position: relative; width: 64px; height: 80px; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb button { position: absolute; top: -6px; left: -6px; background: var(--ink); color: white; border-radius: 999px; width: 20px; height: 20px; font-size: 11px; line-height: 1; }
.msg { margin-top: 16px; font-size: 12px; color: var(--rose); }
.msg.err { color: #b23b3b; }
.badge { display: inline-block; padding: 4px 10px; font-size: 10px; font-weight: 700; border-radius: 999px; }
.badge.pending { background: #f2e3b8; }
.badge.paid { background: #cfe3d0; }
.badge.processing { background: #cfe0e3; }
.badge.shipped { background: #d6cdf0; }
.badge.completed { background: #cfe3d0; }
.badge.cancelled { background: #f0c9c9; }

.loading-line { padding: 60px 0; text-align: center; font-size: 0.85rem; color: rgba(0,0,0,0.45); }
.skeleton { background: linear-gradient(90deg, #eee 25%, #f4f4f4 37%, #eee 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
