:root {
  --brown: #8a5a3b;
  --brown-d: #6e4529;
  --wood: #d4b48c;
  --wood-l: #efe2d0;
  --cream: #faf6f1;
  --ink: #2e2a27;
  --gray: #6b6560;
  --line: #e8dfd4;
  --white: #fff;
  --sale: #c0392b;
  --wa: #25d366;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(80, 50, 30, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: 'Tajawal', system-ui, sans-serif; color: var(--ink);
  background: var(--cream); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
[hidden] { display: none !important; }

/* Header */
.announce { background: var(--brown-d); color: #fff; text-align: center; font-size: 14px; padding: 6px 12px; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; }
.brand img { height: 52px; width: auto; }
.search { flex: 1; display: flex; max-width: 520px; margin-inline-start: auto; background: var(--cream); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.search input { flex: 1; border: 0; background: transparent; padding: 10px 16px; outline: none; min-width: 0; }
.search button { border: 0; background: transparent; padding: 0 14px; color: var(--brown); cursor: pointer; }
.cart-btn { position: relative; border: 0; background: var(--brown); color: #fff; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.cart-btn:hover { background: var(--brown-d); }
.cart-count { position: absolute; top: -4px; left: -4px; background: var(--sale); color: #fff; font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; }
@media (max-width: 640px) {
  .header-row { flex-wrap: wrap; gap: 10px; }
  .brand img { height: 42px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .cart-btn { margin-inline-start: auto; }
}

/* Hero */
.hero { background: linear-gradient(135deg, var(--wood-l), var(--cream)); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; padding: 48px 0; }
.hero-kicker { color: var(--brown); font-weight: 700; margin: 0 0 8px; }
.hero h1 { font-size: clamp(28px, 4.5vw, 46px); line-height: 1.25; margin: 0 0 12px; font-weight: 800; }
.hero-sub { color: var(--gray); margin: 0 0 22px; font-size: 17px; }
.hero-logo { width: min(320px, 100%); justify-self: center; border-radius: 50%; box-shadow: var(--shadow); }
.hero-deal { display: inline-block; margin-inline-start: 12px; background: var(--sale); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; }
@media (max-width: 720px) { .hero-inner { grid-template-columns: 1fr; padding: 28px 0; text-align: center; } .hero-logo { width: 180px; order: -1; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 22px; font-weight: 700; cursor: pointer; transition: .15s; }
.btn-primary { background: var(--brown); color: #fff; }
.btn-primary:hover { background: var(--brown-d); }
.btn-wa { background: var(--wa); color: #fff; width: 100%; }
.btn-wa:hover { filter: brightness(.95); }
.btn:disabled { opacity: .6; cursor: wait; }

/* Shop */
.shop { padding: 28px 0 48px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; padding: 8px 18px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-weight: 500; transition: .15s; }
.chip:hover { border-color: var(--wood); }
.chip.active { background: var(--brown); color: #fff; border-color: var(--brown); }
.chip-sale.active { background: var(--sale); border-color: var(--sale); }
.shop-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 20px 0 16px; flex-wrap: wrap; }
.shop-bar h2 { margin: 0; font-size: 22px; }
.shop-bar h2 small { color: var(--gray); font-weight: 400; font-size: 15px; }
.shop-bar select, .section-title { font-size: 15px; }
.shop-bar select { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); }
.section-title { font-size: 22px; margin: 0 0 16px; }
.empty { text-align: center; padding: 60px 16px; color: var(--gray); }
.empty a { color: var(--brown); font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.card { background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); transition: .2s; display: flex; flex-direction: column; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-img { position: relative; aspect-ratio: 1; background: var(--wood-l); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; font-family: 'Dancing Script', cursive; font-size: 34px; color: var(--wood); }
.noimg.big { font-size: 60px; aspect-ratio: 1; }
.code-badge { position: absolute; top: 10px; right: 10px; background: rgba(255, 255, 255, .92); color: var(--brown-d); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; letter-spacing: .5px; direction: ltr; }
.sale-badge { position: absolute; top: 10px; left: 10px; background: var(--sale); color: #fff; font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: 8px; direction: ltr; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4; }
.dots { display: flex; gap: 5px; align-items: center; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); }
.dots small { color: var(--gray); font-size: 12px; }
.sizes-mini { font-size: 13px; color: var(--gray); }
.price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.price strong { color: var(--brown-d); font-size: 18px; font-weight: 800; }
.price del { color: var(--gray); font-size: 14px; }

/* Product page */
.crumbs { padding: 16px 0 0; font-size: 14px; color: var(--gray); }
.crumbs a:hover { color: var(--brown); }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 20px 0 40px; }
@media (max-width: 820px) { .product { grid-template-columns: 1fr; gap: 20px; } }
.gallery-main { position: relative; background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.gallery-main img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumb { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; width: 72px; height: 72px; flex-shrink: 0; cursor: pointer; background: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--brown); }
.code-pill { display: inline-block; background: var(--wood-l); color: var(--brown-d); font-weight: 700; padding: 4px 12px; border-radius: 8px; font-size: 14px; }
.info h1 { font-size: clamp(24px, 3.2vw, 32px); margin: 10px 0; line-height: 1.3; }
.big-price strong { font-size: 28px; }
.big-price del { font-size: 18px; }
.deal-tag { background: #fde8e6; color: var(--sale); font-weight: 700; padding: 3px 10px; border-radius: 8px; font-size: 13px; }
.opt { margin-top: 22px; }
.opt label { display: block; font-weight: 700; margin-bottom: 8px; }
.opt label b { font-weight: 500; color: var(--gray); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 50%; background: var(--c); border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--line); cursor: pointer; transition: .15s; }
.swatch.active { box-shadow: 0 0 0 2px var(--brown); transform: scale(1.08); }
.size-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.size { min-width: 52px; padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--white); cursor: pointer; font-weight: 500; }
.size.active { border-color: var(--brown); background: var(--brown); color: #fff; }
.size.na { opacity: .4; text-decoration: line-through; }
.buy-row { display: flex; gap: 12px; margin-top: 26px; }
.grow { flex: 1; }
.qty { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; background: var(--white); overflow: hidden; }
.qty button { border: 0; background: none; width: 40px; height: 46px; font-size: 20px; cursor: pointer; color: var(--brown); }
.qty input { width: 44px; text-align: center; border: 0; outline: none; background: none; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty.sm button { width: 30px; height: 30px; font-size: 16px; }
.qty.sm span { min-width: 22px; text-align: center; }
.stock-msg { color: var(--sale); min-height: 1.5em; margin: 8px 0 0; font-size: 14px; }
.desc { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); color: #4a443f; }

/* Cart drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(30, 20, 10, .45); opacity: 0; pointer-events: none; transition: .25s; z-index: 50; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(420px, 100%); background: var(--cream); z-index: 60; display: flex; flex-direction: column; transform: translateX(-105%); transition: transform .3s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; background: var(--white); border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 19px; }
.icon-btn { border: 0; background: var(--cream); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.cart-empty { text-align: center; color: var(--gray); padding: 50px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cart-empty b { color: var(--brown-d); font-size: 20px; direction: ltr; }
.cart-empty .btn { margin-top: 10px; width: auto; }
.ci { display: flex; gap: 12px; background: var(--white); border-radius: 12px; padding: 10px; margin-bottom: 10px; position: relative; border: 1px solid var(--line); }
.ci img, .ci-noimg { width: 70px; height: 70px; border-radius: 10px; object-fit: cover; background: var(--wood-l); flex-shrink: 0; }
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-weight: 700; font-size: 15px; padding-left: 22px; }
.ci-meta { font-size: 13px; color: var(--gray); }
.ci-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.ci-row strong { color: var(--brown-d); }
.ci-del { position: absolute; top: 8px; left: 8px; border: 0; background: none; color: var(--gray); cursor: pointer; }
.drawer-foot { padding: 14px 16px 18px; background: var(--white); border-top: 1px solid var(--line); }
.cart-total { display: flex; justify-content: space-between; font-size: 18px; margin-bottom: 10px; }
.cart-total strong { color: var(--brown-d); font-size: 22px; }
.checkout { display: grid; gap: 8px; }
.checkout input, .checkout textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--cream); outline: none; }
.checkout input:focus, .checkout textarea:focus { border-color: var(--wood); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px; opacity: 0; transition: .25s; z-index: 70; pointer-events: none; font-size: 15px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Footer */
.site-footer { background: var(--white); border-top: 1px solid var(--line); padding: 26px 0; margin-top: 20px; }
.footer-row { display: flex; align-items: center; gap: 20px; justify-content: space-between; flex-wrap: wrap; color: var(--gray); }
.footer-logo { height: 46px; width: auto; }
.footer-links { display: flex; gap: 18px; font-weight: 700; color: var(--brown); }

/* السعر الأصلي مشطوب قبل السعر بعد الحسم */
.price .old-price { font-size: 16px; color: var(--gray); text-decoration: line-through; text-decoration-color: var(--sale); text-decoration-thickness: 2px; }
.price .old-price + strong { color: var(--sale); }

/* حقوق التطوير */
.dev-credit { text-align: center; font-size: 13px; color: var(--gray); border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.dev-credit a { color: var(--brown); font-weight: 700; direction: ltr; display: inline-block; }
.dev-credit a:hover { text-decoration: underline; }
