:root {
  --bg: #f7f7f9;
  --card: #ffffff;
  --muted: #6b7280;
  --dark: #0f172a;
  --gold: #b08968;
  --accent: #e2e8f0;
}

* {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Noto Sans Arabic', sans-serif;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.5;
  display: flex;
  /* sticky footer */
  flex-direction: column;
  /* sticky footer */
  min-height: 100vh;
  /* sticky footer */
}

.container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 16px
}

/* وُسّعت الصفحة */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #eee
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0
}

.logo {
  height: 40px
}

.brand-text {
  font-weight: 700;
  font-size: 1.2rem
}

.brand-link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.nav a,
.nav .has-sub {
  color: var(--dark);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px
}

.nav a:hover,
.nav .has-sub:hover {
  background: var(--accent)
}

.nav-item {
  position: relative
}

.dropdown {
  display: none;
  position: absolute;
  top: 120%;
  right: 0;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  min-width: 220px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
  padding: 8px
}

.nav-item:hover .dropdown {
  display: flex;
  flex-direction: column
}

.dropdown a {
  padding: 8px 12px
}

.hero {
  background-size: cover;
  background-position: center;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center
}

.hero-overlay {
  background: rgba(255, 255, 255, .75);
  padding: 24px 28px;
  border-radius: 16px;
  text-align: center
}

.hero h1 {
  margin: 0 0 6px
}

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

.card {
  background: var(--card);
  border: 1px solid #eee;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .03)
}

.card .thumb {
  aspect-ratio: 1/1;
  background: #fafafa;
  display: block;
  width: 100%;
  object-fit: cover
}

.card .body {
  padding: 12px
}

.price-now {
  font-weight: 700
}

.price-old {
  text-decoration: line-through;
  color: var(--muted);
  margin-right: 8px
}

.badges {
  display: flex;
  gap: 8px;
  margin-bottom: 6px
}

.badge {
  font-size: .75rem;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 999px;
  padding: 3px 8px
}

.colors {
  display: flex;
  gap: 6px;
  margin: 6px 0 10px
}

.dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #ccc
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fff;
  color: var(--dark);
  text-decoration: none;
  cursor: pointer
}

.btn.primary {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark)
}

.btn.whatsapp {
  background: #25D366;
  color: #fff;
  border-color: #25D366
}

.site-footer {
  margin-top: 40px;
  border-top: 1px solid #eee;
  background: #fff;
  flex-shrink: 0
}

/* sticky footer */
.site-footer .container {
  padding: 14px 0
}

main.container {
  flex: 1 0 auto
}

/* sticky footer */

.product {
  display: grid;
  grid-template-columns: 520px 1fr;
  /* عمود الصور أكبر وثابت */
  gap: 24px;
}

@media(max-width:900px) {
  .product {
    grid-template-columns: 1fr
  }

  .hero {
    height: 220px
  }
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px
}

.gallery img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #eee
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid #eee
}

.muted {
  color: var(--muted)
}

.input,
.select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

form .actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end
}

.admin-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px
}

.admin-nav a {
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #eee;
  text-decoration: none;
  color: var(--dark)
}

.admin-nav a.active {
  background: var(--dark);
  color: #fff
}

.alert {
  padding: 10px;
  border-radius: 10px;
  background: #eefcf2;
  border: 1px solid #b4f0c4;
  margin: 10px 0
}

/* --- Slider (compact, fixed height, no jump) --- */
.gallery-slider.compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px
}

.gallery-slider.compact .viewer {
  position: relative;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  height: 320px;
  /* عدّل 260/300/360 حسب ما بدك */
}

.gallery-slider.compact .viewer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* الصورة تبقى كاملة داخل الإطار */
  background: #fff;
}

.gallery-slider.compact .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  font-size: 18px;
  line-height: 32px;
  text-align: center
}

.gallery-slider.compact .nav.prev {
  left: 8px
}

.gallery-slider.compact .nav.next {
  right: 8px
}

.gallery-slider.compact .thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff
}

.gallery-slider.compact .thumbs::-webkit-scrollbar {
  height: 6px
}

.gallery-slider.compact .thumb-item {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  flex: 0 0 auto
}

.gallery-slider.compact .thumb-item.active {
  border-color: #0f172a
}

.badge-cart {
  display: inline-block;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: .75rem;
  line-height: 1;
  text-align: center
}

.table form {
  display: inline;
}

.table .btn {
  padding: 6px 10px;
}

.table input[type=number] {
  text-align: center;
}

.kpi .value {
  letter-spacing: .3px
}

