/* =========================================
   AMA STORE — CSS DESIGN SYSTEM
   ========================================= */

:root {
  --white:       #ffffff;
  --off-white:   #f1f1f1;
  --black:       #111111;
  --navy:        #263a62;
  --card-bg:     #e4e5e7;
  --red-bg:      #ffdede;
  --red-border:  #e14560;

  --shadow-card:    0px 3.4px 1.1px rgba(0,0,0,0.10);
  --shadow-cat:     3.4px 3.4px 1.1px rgba(0, 0, 0, 0.1);
  --shadow-btn:     0px 7px 2.2px rgba(0,0,0,0.20);

  --radius-card: 0.5rem;
  --padding-main: 4%;

  --font: 'Cairo', 'Segoe UI', system-ui, sans-serif;
  --transition: 0.22s ease;
}

@font-face {
  font-family: 'rockstar';
  src: url('/font/Rockstar-ExtraBold.otf') format('opentype');
}


/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; height: 100%; }
body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  direction: rtl;
  overflow-x: hidden;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, textarea, select {
  font-family: var(--font);
  border: 1.5px solid #ccc;
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  font-size: 14px;
  background: var(--white);
  direction: rtl;
  outline: none;
  transition: border-color var(--transition);
}
input:focus, textarea:focus, select:focus { border-color: var(--navy); }

/* ── Offers Ticker ── */
.offers-ticker {
  background: var(--navy);
  color: var(--white);
  font-size: 13px;
  padding: 7px 0;
  overflow: hidden;
  white-space: nowrap;
  direction: ltr; /* لضمان حركة الشريط من اليمين لليسار بشكل ثابت */
}
.ticker-track {
  display: inline-flex;
  gap: 60px;
  will-change: transform;
}

/* ── Header ── */
.site-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--padding-main);
  background-color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--off-white);
  box-shadow: var(--shadow-card);
}
.header-logo { height: 38px; font-size: 22px; font-weight: 800; color: var(--navy); letter-spacing: -0.5px; cursor: pointer; display: flex; align-items: center; gap: 10px;}
.header-logo img { height: 25px; cursor: pointer; }
.header-left { display: flex; align-items: center; gap: 14px; }
.header-cart-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; position: relative;
}
.cart-count {
  position: absolute;
  top: -7px; left: -7px;
  background: var(--navy); color: var(--white);
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cart-total { font-size: 1rem; font-weight: 700; color: var(--navy); direction: ltr; }
.burger-btn { background-color: var(--navy); width: 40px; height: 40px; border-radius: 0.4rem; display: flex; align-items: center; justify-content: center; padding: 10px; }

/* ── Bottom Sheet (Burger Menu) ── */
.bottom-sheet-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 200;
}
.bottom-sheet-overlay.open { display: block; }
.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 201;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 20px var(--padding-main) 30px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 60vh; overflow-y: auto;
}
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet-handle { width: 40px; height: 4px; background: #ccc; border-radius: 2px; margin: 0 auto 16px; }
.bottom-sheet-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: var(--navy); }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-btn {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-btn);
  transition: opacity var(--transition);
}
.cat-btn:hover { opacity: 0.8; }

/* ── Main Content Area ── */
main {
  flex: 1 0 auto;
  background: var(--off-white);
  padding-bottom: 30px;
}
.main-div {
  padding: 0 var(--padding-main);
}

/* على الشاشات الكبيرة (كمبيوتر)، نوسع البادينج الجانبي */
@media (min-width: 1024px) {
  .main-div {
    padding: 0 25%;
  }
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
}
.section-header h2 {
  display: flex;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--black);
  min-width: 50%;
  justify-content: center;
}
.section-hr {
    flex-grow: 1;
    height: 4pt;
    background-color: var(--navy);
    border: none;
    border-radius: 4px;
}

/* ── Product / Category Cards Grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding-bottom: 10px;
  align-items: start; /* البطاقات لا تتمدد عمودياً؛ كل بطاقة بارتفاع محتواها فقط */
}

/* ── Category Card ── */
.cat-card {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-cat);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition);
  position: relative;
  padding: 0.5rem;
  /* بدون aspect-ratio لظهور اسم التصنيف كاملاً */
}
.cat-card:hover { transform: translateY(-3px); }
.cat-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-card);
}
.cat-card-name {
  padding: 0.5rem 0 0;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ── Product Card ── */
.product-card {
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition);
  position: relative;
  background: transparent;
  /* بدون aspect-ratio ليكتمل ظهور اسم المنتج كاملاً وتحديد الارتفاع بالمحتوى */
}
.product-card:hover { transform: translateY(-3px); }
.product-card-img-wrap {
  position: relative;
  width: 100%; aspect-ratio: 1; overflow: hidden;
}
.product-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.add-to-cart-circle {
  position: absolute;
  bottom: 8px; right: 8px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: background var(--transition);
}
.add-to-cart-circle:hover { background: var(--navy); color: var(--white); }
.add-to-cart-circle svg { pointer-events: none; }
.product-card-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 4px 0;
  gap: 6px;
  min-height: 0;
}
/* اسم المنتج: يظهر كاملاً ويلف على عدة أسطر دون قص */
.product-card-info .product-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: break-word;
  word-break: break-word;
}
.product-card-info .product-price {
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  flex-shrink: 0;
  direction: ltr;
}
/* للاستخدام خارج البطاقة (مثل صفحة المنتج الرائج) */
.product-name { font-size: 13px; font-weight: 700; line-height: 1.3; }
.product-price { font-size: 1rem; font-weight: 700; text-align: left; white-space: nowrap; direction: ltr;}
.product-price-sm { font-size: 1rem; font-weight: 700; text-align: left; white-space: nowrap;
    direction: ltr; display: flex; flex-direction: column; gap: 2px; line-height: 1.1; }
.price-old { text-decoration: line-through; color: #aaa; font-size: 11px; direction: ltr; }
.price-new { color: var(--navy); direction: ltr; }

/* ── Sale Triangle ── */
.sale-badge {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 0 4rem 4rem;
  border-color: transparent transparent transparent var(--red-border);
}
.sale-badge-text {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: left;
  line-height: 1.1;
  width: 42px;
  transform: rotateZ(-45deg);
}

.sale-badge-bg {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 0 6rem 6rem;
  border-color: transparent transparent transparent var(--red-border);
}
.sale-badge-bg-text {
  position: absolute;
  top: 1.5rem;
  left: -0.5rem;
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
  width: 5rem;
  transform: rotateZ(-45deg);
}

/* ── Full-Width Slider ── */
.full-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 1rem;
  touch-action: pan-y;
  box-shadow: 0 3.5px 1.1px rgba(0, 0, 0, 0.1);
}
.full-slider-track {
  display: flex;
  direction: ltr; /* ثبّت ترتيب السلايدات حتى مع dir=rtl على body */
  transition: transform 0.4s ease;
  will-change: transform;
}
.full-slider-track .slide {
  flex: 0 0 100%;
  width: 100%;
}
.full-slider-track .slide img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.slider-dots {
  background: var(--white);
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  flex-direction: row-reverse; /* ليتماشى ترتيب النقاط مع اتجاه السحب RTL */
}
.slider-dot {
  width: 8px; height: 4px;
  border-radius: 2px;
  background: #ccc;
  transition: all var(--transition);
}
.slider-dot.active { width: 20px; background: var(--navy); }

/* Trending product info below slider */
.trending-info {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px var(--padding-main) 4px;
}

/* ── Info Section (3 cols) ── */
.info-section { display: flex; justify-content: space-between; text-align: center; gap: 6px; padding: 10px 0; }
.info-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.info-item img { height: 4rem; margin-bottom: 10px; filter: invert(10%) sepia(13%) saturate(2779%) hue-rotate(182deg) brightness(94%) contrast(89%); }
.info-item p { font-size: 11px; font-weight: 600; color: var(--navy); line-height: 1.3; }

/* ── Footer ── */
.site-footer-top {
  background: var(--navy);
  color: var(--white);
  padding: 20px var(--padding-main);
  text-align: center;
}
.site-footer-bottom{
  background-color: var(--white);
  padding: 5px 0;
  color: var(--black);
  font-weight: 600;
  font-size: 0.9rem;
  direction: ltr;
  text-align: center;
}

.footer-policy-link {
  display: inline-block;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 14px;
}
.footer-socials { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; flex-direction: row-reverse;}
.footer-social-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.footer-social-icon:hover { background: rgba(255,255,255,0.3); }
.footer-social-icon img { width: 18px; height: 18px; fill: var(--white); }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #888;
  padding: 14px 0 8px;
  flex-wrap: wrap;
}
.breadcrumb span { color: var(--navy); font-weight: 600; }
.breadcrumb a:hover { color: var(--navy); }
/* ── Floating Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 300;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: 16px;
  padding: 24px 20px;
  width: 88%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 16px; color: var(--navy); display: flex; justify-content: center; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-primary {
  flex: 1; background: var(--navy); color: var(--white);
  border-radius: 10px; padding: 11px; font-size: 15px; font-weight: 700;
  transition: opacity var(--transition);
}
.btn-primary:hover { opacity: 0.85; }

/* ── Dialog (alert/confirm) ── */
.dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.dialog-overlay.open { display: flex; }
.dialog-box {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.dialog-title { display: flex; font-size: 17px; font-weight: 900; margin-bottom: 10px; color: var(--navy); justify-content: center; }
.dialog-msg { font-size: 13px; color: #555; line-height: 1.7; white-space: pre-line; }
.dialog-actions { display: flex; gap: 10px; margin-top: 16px; }
.dialog-actions .btn-primary, .dialog-actions .btn-secondary { flex: 1; }
.btn-secondary {
  flex: 1; background: var(--off-white); color: var(--black);
  border-radius: 10px; padding: 11px; font-size: 15px; font-weight: 700;
}

/* ── Upload Box ── */
.upload-box, .upload-box-s {
  background: var(--off-white);
  border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 28px 16px;
  cursor: pointer; border: 2px dashed #ccc;
  transition: border-color var(--transition);
  min-height: 120px;
}
.upload-box:hover, .upload-box-s:hover { border-color: var(--navy); }
.upload-box svg, .upload-box-s svg { color: #aaa; }
.upload-box span, .upload-box-s span { font-size: 12px; color: #aaa; }
.upload-box-s {width: 72px; min-height: 72px; padding: 8px;}

/* ── Form Grid ── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--black); }
textarea.form-textarea { min-height: 80px; resize: vertical; }

/* قائمة التصنيفات المنسدلة مع البحث */
.pf-cat-dropdown { position: relative; width: 100%; }
.pf-cat-trigger {
  width: 100%;
  padding: 5px 12px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  background: var(--white);
  font-size: 14px;
  text-align: right;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pf-cat-summary { flex: 1; color: #555; text-align: right; overflow-y: scroll; max-height: 26px; }
.pf-cat-trigger:hover { border-color: var(--navy); }
.pf-cat-panel {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin-top: 4px;
  background: var(--white);
  border: 1.5px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 100;
  max-height: 220px;
  overflow: hidden;
  flex-direction: column;
}
.pf-cat-cb{
  width: auto;
}
.pf-cat-dropdown.open .pf-cat-panel { display: flex; }
.pf-cat-search-wrap { padding: 8px; border-bottom: 1px solid var(--off-white); }
.pf-cat-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}
.pf-cat-list {
  overflow-y: auto;
  max-height: 180px;
  padding: 6px 0;
}
.pf-cat-list label { display: flex; align-items: center; gap: 8px; padding: 6px 12px; margin: 0; cursor: pointer; font-weight: 400; }
.pf-cat-list label:hover { background: var(--off-white); }
.pf-cat-list label.hide-by-search { display: none; }

/* ── Admin 3-dot Menu ── */
.dot-menu-wrap { position: relative; }
.dot-menu-btn { font-size: 20px; color: var(--white); border-radius: 99999px; background-color: #000000b3; width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; }
.dot-menu-btn:hover { background: var(--navy); }
.dot-menu {
  display: none; position: absolute;
  top: calc(100% + 4px); right: 0;
  background: var(--white); border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.14);
  min-width: 120px; z-index: 50; overflow: hidden;
}
.dot-menu.open { display: block; }
.dot-menu button {
  display: block; width: 100%; padding: 10px 14px;
  font-size: 14px; text-align: right; color: var(--black);
  transition: background var(--transition);
}
.dot-menu button:hover { background: var(--off-white); }
.dot-menu button.danger { color: #e14560; }

/* ── Switch Toggle ── */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch-b { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; direction: ltr; }
.switch input, .switch-b input { display: none; }
.switch-track {
  width: 44px; height: 24px; background: #ccc;
  border-radius: 12px; position: relative; transition: background var(--transition);
}
.switch input:checked + .switch-track, .switch-b input:checked + .switch-track { background: var(--navy); }
.switch-thumb {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; background: var(--white);
  border-radius: 50%; transition: transform var(--transition);
}
.switch input:checked + .switch-track .switch-thumb, .switch-b input:checked + .switch-track .switch-thumb { transform: translateX(-20px); }

/* ── Cart card ── */
.cart-card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 14px;
  margin-bottom: 14px;
}
.cart-card-grid {
  display: grid; grid-template-columns: 1fr 2.5fr 1fr 2.5fr;
  gap: 10px; align-items: center;
}
.cart-label { font-size: 11px; color: #888; }
.cart-value { font-size: 13px; font-weight: 600; display: flex; flex-direction: row-reverse;}
.cart-select { width: 100%; padding: 5px 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; background: var(--white); }

/* ── Quantity stepper ── */
.qty-stepper { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #ccc; border-radius: 8px; overflow: hidden; background-color: var(--white); width: 100%; justify-content: space-between; }
.qty-btn { padding: 3px 10px; font-size: 16px; color: var(--navy); border-right: 1px solid #ccc; border-left: 1px solid #ccc;}
.qty-num { font-size: 14px; font-weight: 700; min-width: 24px; text-align: center; }

.qty-stepper.admin-qty {
  width: 100%;
}
.qty-stepper.admin-qty .qty-input {
  border: none;
  outline: none;
  background: transparent;
  text-align: center;
  width: 60px;
  font-size: 14px;
  font-weight: 700;
}

.color-dot-add {
  border: 2px dashed #e14560;
  background: #fff;
}

/* ── Order table ── */
.order-table { width: 100%; border-collapse: collapse; background-color: var(--white); }
.order-table th { font-size: 12px; color: #888; font-weight: 600; padding: 8px 4px; text-align: center; border-bottom: 1px solid var(--off-white); }
.order-table td { font-size: 13px; padding: 10px 4px; border-bottom: 1px solid var(--off-white); vertical-align: middle; text-align: center;}
.order-table tr:hover { background: var(--off-white); cursor: pointer; }
.action-btn { padding: 4px 8px; border-radius: 6px; font-size: 18px; }
.action-btn.confirm { color: #22c55e; }
.action-btn.reject  { color: #e14560; }

/* ── Status badge ── */
.status-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 700;
}
.status-new       { background: #e8f4ff; color: #2563eb; }
.status-confirmed { background: #d1fae5; color: #15803d; }
.status-rejected  { background: #fde8e8; color: #e14560; }

/* ── Filter tabs ── */
.filter-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-tab {
  padding: 7px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
  background: var(--off-white); color: var(--black);
  transition: all var(--transition);
}
.filter-tab.active { background: var(--navy); color: var(--white); }

/* ── Hero ── */
.hero-section {
  width: 100vw; margin-left: -4vw;
  min-height: 110vw;
  background: linear-gradient(160deg, rgba(38,58,98,0.2) 0%, rgba(0,0,0,0.1) 100%),
              url('/img/hero_background.jpg') center/cover no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 6%;
  color: var(--white);
}
.hero-section h1 {
  font-size: clamp(22px, 8vw, 38px);
  font-family: 'rockstar', sans-serif;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
  .hero-section p  {
  font-size: clamp(13px, 3vw, 16px);
  font-family: 'rockstar', sans-serif;
  margin: 10px auto 15PX;
  opacity: 85%;
  line-height: 1.6;
}
.hero-btn {
  font-family: 'rockstar', sans-serif;
  background-color: var(--white);
  color: var(--black);
  padding: 10px 5.5rem;
  font-size: 1.3rem;
  font-weight: 800;
  clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
  transition: transform 0.2s;
}
.hero-btn:hover { opacity: 0.9; }

/* ── Add-card (admin placeholder) ── */
.add-card {
  background: var(--white);
  border-radius: var(--radius-card);
  border: 2px dashed #ccc;
  aspect-ratio: 518 / 595;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; transition: border-color var(--transition);
}
.add-card:hover { border-color: var(--navy); }
.add-card-circle {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--card-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--navy);
}
.add-card span { font-size: 13px; color: #888; font-weight: 600; }

/* ── Policy info box ── */
.info-box {
  background: var(--red-bg);
  border-right: 3pt solid var(--red-border);
  border-radius: 8px;
  display: flex; gap: 12px; align-items: center;
  padding: 14px 12px; margin-bottom: 20px;
  font-size: 13px; line-height: 1.6;
}
.info-box-icon { flex-shrink: 0; color: var(--red-border); margin-top: 2px; }

/* ── Search bar ── */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border-radius: 10px;
  padding: 0px 14px; margin-bottom: 14px;
}
.search-bar input { background: transparent; border: none; flex: 1; font-size: 14px; }
.search-bar input:focus { border: none; }

/* ── Thin card (for add more) ── */
.add-more-card {
  width: 100%; height: 52px;
  background: var(--off-white); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; border: 2px dashed #ccc;
  font-size: 14px; color: #888; font-weight: 600;
  transition: border-color var(--transition); margin: 10px 0;
}
.add-more-card:hover { border-color: var(--navy); color: var(--navy); }

/* ── Full-width button ── */
.btn-full {
  display: block; width: 100%;
  background: var(--navy); color: var(--white);
  padding: 14px; border-radius: 12px;
  font-size: 16px; font-weight: 700;
  text-align: center; margin-top: 16px;
  transition: opacity var(--transition);
}
.btn-full:hover { opacity: 0.85; }

/* ── Hidden state (admin view) ── */
.is-hidden-card { opacity: 0.4; }

/* ── Stepper card counter (for shipping rows) ── */
.table-like { width: 100%; }
.table-like-head { display: grid; gap: 8px; padding: 8px 0; border-bottom: 2pt solid var(--off-white); margin-bottom: 6px; }
.table-like-row { display: grid; gap: 8px; padding: 8px 0; align-items: center; }
.table-cell-label { font-size: 12px; color: #888; font-weight: 600; }
.table-cell { font-size: 13px; }

/* ── Dividers ── */
hr.divider-2 { border: none; border-top: 2px solid var(--off-white); margin: 12px 0; }
hr.divider-3 { border: none; border-top: 3pt solid var(--red-border); margin: 12px 0; }

/* ── Utility ── */
.text-center { text-align: center; }
.text-navy   { color: var(--navy); }
.font-bold   { font-weight: 700; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex-between { display: flex; justify-content: space-between;}
.flex-center  { display: flex;  justify-content: center; align-items: center; }
.gap-8 { gap: 8px; }

/* ── Loading spinner ── */
.spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid var(--off-white); border-top-color: var(--navy); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; justify-content: center; padding: 30px; }

/* Image preview row */
.images-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.images-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }

/* Color picker */
.color-picker-row { display: flex; flex-wrap: wrap; gap: 8px;}
.color-dot {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2.5px solid transparent; cursor: pointer; transition: transform var(--transition);
  position: relative;
}
.color-dot.selected { outline: 2px solid var(--navy); transform: scale(0.95); outline-offset: 3px; }
.color-dot-label {
  position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 600; white-space: nowrap; color: var(--black);
}

/* Size chips */
.size-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.size-chip {
  padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: var(--off-white); border: 2px solid transparent; cursor: pointer;
  transition: all var(--transition);
}
.size-chip.selected { border-color: var(--navy); color: var(--navy); background: var(--white); }

/* ── Image Cropper ── */
.crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
  cursor: move;
  z-index: 10;
}
.crop-resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  right: -8px;
  bottom: -8px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
  cursor: nwse-resize;
  z-index: 11;
}
.upload-area {
  background: #eee;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1/1;
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed; top: 5rem; left: 50%; transform: translateX(-50%) translateY(-60px);
  background: var(--navy); color: var(--white);
  padding: 12px 24px; border-radius: 24px; font-size: 14px; font-weight: 600;
  opacity: 0; transition: all 0.3s ease; z-index: 400; max-width: 90vw; width: max-content;
  min-width: 200px; white-space: pre-wrap; word-wrap: break-word; text-align: center; line-height: 1.4;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Product detail images */
.detail-images-wrap {
  display: flex; gap: 8px; align-items: flex-start;
}
.detail-main-img {
  flex: 1; aspect-ratio: 1; border-radius: 12px; overflow: hidden; position: relative;
}
.detail-slider { background: #000; }
.detail-slider-track { height: 100%; }
.detail-slider-track .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-thumbs {
  width: 64px; display: flex; flex-direction: column; gap: 6px;
  max-height: 320px; overflow-y: auto;
}
.detail-thumb {
  width: 64px; height: 64px; border-radius: 8px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; flex-shrink: 0;
}
.detail-thumb.active { border-color: var(--navy); }
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }

.detail-video-shell {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #000;
}
.detail-video-poster {
  width: 100%;
  height: 100%;
}
.detail-video-poster img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
.detail-video-elem {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
.detail-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: linear-gradient(135deg, rgba(0,0,0,0.05), rgba(0,0,0,0.35));
  cursor: pointer;
}
.detail-video-play-icon {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.detail-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 16px;
  margin-top: 12px;
}
/* الوصف والمواصفات: احترام أسطر Enter */
.product-description-text,
.product-specs-text {
  font-size: 14px;
  line-height: 1.8;
  color: #444;
  white-space: pre-line;
  margin-bottom: 15px;
}

/* Buy now / add to cart row */
.buy-row {
  display: flex;
  gap: 12px;               
  width: 100%;             
  height: 50px;            
  margin: 20px 0; 
}
.btn-cart-sm {
  flex: 1;
  height: 100%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 0.4rem;
}
.btn-cart-sm:hover { background: var(--white); color: var(--navy); }
.btn-buy {
  flex: 1;
  background: var(--navy);
  color: var(--white);
  border-radius: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-buy img {
  width: 30px;
}

/* Admin login */
.admin-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--off-white);
}
.admin-login-card {
  background: var(--white); border-radius: 16px;
  padding: 36px 28px; width: 88%; max-width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  text-align: center;
}
.admin-login-logo { font-size: 28px; font-weight: 900; color: var(--navy); margin-bottom: 6px; }
.admin-login-sub { font-size: 13px; color: #888; margin-bottom: 28px; }

@media (min-width: 600px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-section { min-height: 50vw; }
}
@media (min-width: 900px) {
  .cards-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Floating WhatsApp Button ── */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: #25d366;
  color: #fff;
  border-radius: 50%;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.whatsapp-float:hover {
  background-color: #128c7e;
  transform: scale(1.1);
}

.whatsapp-float img {
  width: 35px;
  height: 35px;
  filter: brightness(0) invert(1);
}

@media (max-width: 480px) {
  .whatsapp-float {
    width: 50px;
    height: 50px;
    bottom: 15px;
    right: 15px;
  }
  .whatsapp-float img {
    width: 30px;
    height: 30px;
  }
}
