:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --ink: #14141a;
  --muted: #6b6b70;
  --line: #e9e7e2;
  --accent: #14141a;
  --accent-contrast: #ffffff;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --max-w: 1180px;
  --shadow-sm: 0 2px 8px rgba(20, 20, 26, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 20, 26, 0.08);
  --shadow-lg: 0 20px 48px rgba(20, 20, 26, 0.14);
  --font-en: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-ar: "Tajawal", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-en);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[dir="rtl"] body { font-family: var(--font-ar); }

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

button {
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
}

input {
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line), var(--shadow-sm);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand img { height: 34px; width: auto; border-radius: 8px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s ease;
}

.main-nav a:hover { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.lang-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--bg);
}

.lang-switch button {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-switch button.active {
  background: var(--accent);
  color: var(--accent-contrast);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 1.1rem;
}

/* Hero */
.hero {
  position: relative;
  padding: 56px 0 40px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(60% 90% at 15% 15%, rgba(255, 214, 170, 0.35), transparent 60%),
    radial-gradient(55% 80% at 85% 20%, rgba(170, 210, 255, 0.3), transparent 60%),
    linear-gradient(180deg, #fdfcfb 0%, var(--bg) 100%);
}

.hero .container { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  margin: 0 0 14px;
  letter-spacing: -0.03em;
  font-weight: 800;
  line-height: 1.05;
}

.hero p {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 560px;
  margin: 0 auto 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 16px 36px;
  font-weight: 700;
  font-size: 1rem;
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-md);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: none;
}

.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1fb857; }
.btn-whatsapp:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-block { width: 100%; }

/* Products section */
.products-section { padding: 40px 0 96px; }

.section-heading {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  text-align: center;
}

.filters-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-bottom: 40px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.search-input {
  width: 100%;
  max-width: 340px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 0.9rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.search-input:focus { outline: none; border-color: var(--ink); box-shadow: var(--shadow-md); }

.filter-pill {
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.filter-pill:hover { border-color: var(--ink); color: var(--ink); }

.filter-pill.active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 28px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

@keyframes share-highlight-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
  40% { transform: scale(1.03); box-shadow: 0 0 0 14px rgba(37, 211, 102, 0.25), 0 0 32px 6px rgba(37, 211, 102, 0.35); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
.product-card.share-highlight { animation: share-highlight-pulse 1.1s ease-out 3; }

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Gallery */
.gallery { display: flex; flex-direction: column; gap: 10px; }

.gallery-main {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f1f0ed;
  cursor: zoom-in;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .gallery-main img { transform: scale(1.04); }

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.gallery-nav:hover { background: #fff; }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
html[dir="rtl"] .gallery-nav.prev { left: auto; right: 10px; }
html[dir="rtl"] .gallery-nav.next { right: auto; left: 10px; }

.gallery-nav.gallery-share { top: 10px; right: 10px; transform: none; }
html[dir="rtl"] .gallery-nav.gallery-share { right: auto; left: 10px; }

.gallery-thumbs { display: flex; gap: 7px; }

.gallery-thumbs button {
  border: 2px solid transparent;
  border-radius: 9px;
  overflow: hidden;
  padding: 0;
  width: 46px;
  height: 46px;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.gallery-thumbs button.active { border-color: var(--ink); opacity: 1; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* Product card body */
.product-title { font-weight: 700; font-size: 1.05rem; }
.product-price { color: var(--muted); font-size: 0.92rem; font-weight: 600; }
.product-desc { color: var(--muted); font-size: 0.85rem; }

.field-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }

.swatch {
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.swatch:hover { border-color: var(--ink); }
.swatch.active { border-color: var(--ink); background: var(--ink); color: var(--accent-contrast); }

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.qty-control button {
  width: 34px;
  height: 34px;
  font-size: 1.05rem;
  font-weight: 700;
  transition: background 0.15s ease;
}

.qty-control button:hover { background: var(--bg); }

.qty-control input {
  width: 42px;
  text-align: center;
  border: none;
  background: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.order-form { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

.order-form input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.88rem;
  background: var(--bg);
  transition: border-color 0.15s ease;
}

.order-form input:focus { outline: none; border-color: var(--ink); }

.form-error {
  color: #c0392b;
  font-size: 0.78rem;
  display: none;
}

.form-error.visible { display: block; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.lightbox.open { display: flex; }

.lightbox-frame { position: relative; display: inline-flex; max-height: 85vh; max-width: 90vw; }
.lightbox-frame .gallery-nav { z-index: 2; }
.lightbox-frame .lightbox-img {
  max-height: 85vh;
  max-width: 90vw;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

/* While sliding, both the outgoing and incoming image are layered absolutely
   inside a frame temporarily locked to a fixed pixel size (set in JS) so the
   two can slide past each other without the frame jumping. */
.lightbox-frame.sliding { overflow: hidden; }
.lightbox-frame.sliding .lightbox-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transition: transform 0.28s ease;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.3rem;
  transition: background 0.15s ease;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }
html[dir="rtl"] .lightbox-close { right: auto; left: 20px; }

/* Contact */
.contact-section { padding: 72px 0 100px; }

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 52px 40px;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.contact-card p.note { color: var(--muted); margin-bottom: 28px; font-size: 1.02rem; }

.whatsapp-number {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 24px;
  direction: ltr;
  display: inline-block;
  letter-spacing: -0.01em;
}

.social-links {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 32px;
}

.social-links a {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.social-links a:hover { background: var(--ink); color: #fff; transform: translateY(-3px); box-shadow: var(--shadow-md); }

.social-links-header {
  gap: 6px;
  margin-top: 0;
}

.social-links-header a {
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: var(--muted);
}

.social-links-header a:hover { background: var(--bg); color: var(--ink); transform: none; box-shadow: none; }

@media (max-width: 900px) {
  .social-links-header { display: none; }
}

.social-links-footer {
  gap: 10px;
  margin-top: 0;
  margin-bottom: 16px;
}

.social-links-footer a { width: 36px; height: 36px; }

/* Footer */
.site-footer {
  background: #f1efe9;
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Responsive */
@media (max-width: 720px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .site-header.nav-open .main-nav {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 24px;
    box-shadow: var(--shadow-md);
    gap: 16px;
  }
  .hero { padding: 40px 0 28px; }
  .contact-card { padding: 36px 22px; }
}
