/* ====================================================
   Affiliate Storefront — Modern Design Tokens & Theme
   مظهر عصري مطابق لريفرنس منصة المسوقين مع دعم اللغتين (LTR / RTL)
   ==================================================== */
:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --navy-dark: #0A192F;
  --navy-deep: #0F172A;
  --navy-blue: #1E3A8A;
  
  --white: #FFFFFF;
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  --green-bg: #ECFDF5;
  --green-text: #059669;
  --green-border: #A7F3D0;
  --green: #059669;

  --ink: #0A192F;
  --muted: #64748B;
  --slate-600: #475569;

  --beige-line: #E5DED3;
  --beige-soft: #F7F3EC;
  --orange-dark: #B45309;
  --orange-soft: #FFF7ED;

  --red: #EF4444;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);

  --font-sans: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--slate-50);
  color: var(--slate-900);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  color: var(--slate-900);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Topbar الشريط العلوي ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 25, 47, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--white);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #60A5FA);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  font-size: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* زر التبديل بين اللغتين (Language Toggle) */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.partner-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--white);
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.2s ease;
}

.partner-pill:hover {
  background: var(--primary-hover);
}

/* زر بوابة المسوقين المصغر كأيقونة أنيقة في الهيدر */
.partner-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.partner-icon-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: var(--white);
  transform: scale(1.05);
}

/* ---------- Hero Banner قسم الترحيب الأزرق العميق ---------- */
.hero {
  background: linear-gradient(135deg, #0A192F 0%, #0F2B5C 50%, #1E3A8A 100%);
  color: var(--white);
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
}

.hero-top-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  color: #93C5FD;
  margin-bottom: 22px;
}

.hero-top-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
}

.hero h1 {
  font-size: 38px;
  line-height: 1.25;
  color: var(--white);
  margin-bottom: 16px;
  max-width: 32ch;
}

.hero p {
  font-size: 17px;
  color: #CBD5E1;
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  border: none;
  font-size: 14.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* ⚡ الشراء المباشر — أخضر من ألوان الموقع نفسها */
.btn-buy-now {
  background: var(--green);
  color: var(--white);
}

.btn-buy-now:hover:not(:disabled) {
  filter: brightness(0.9);
  transform: translateY(-1px);
}

.btn-translucent {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
}

.btn-translucent:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ---------- Products Section & Header ---------- */
.section {
  padding: 44px 0 70px;
}

.section-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-titles h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--slate-900);
}

.section-titles p {
  color: var(--slate-500);
  font-size: 14.5px;
  margin-top: 4px;
}

/* شريط البحث (Search Input) */
.search-wrapper {
  position: relative;
  min-width: 420px;
  max-width: 620px;
  flex: 1;
}

.search-icon {
  position: absolute;
  inset-inline-start: 17px;
  top: 50%;
  transform: translateY(-50%);
  width: 21px;
  height: 21px;
  color: var(--slate-400);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 20px;
  padding-inline-start: 50px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--slate-200);
  background: var(--white);
  font-size: 15.5px;
  color: var(--slate-900);
  font-family: inherit;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* كبسولات الفلترة (Filter Pills) */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.pill-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  color: var(--slate-700);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  border-color: var(--slate-300);
  background: var(--slate-100);
}

.pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* ---------- Product Grid & Modern Card ---------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* صورة الكارت الكبيرة */
.card-image-wrap {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  background: var(--slate-100);
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .card-image-wrap img {
  transform: scale(1.03);
}

/* بادج الفئة الطافي على الصورة */
.card-category-badge {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.card-content {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 6px;
  line-height: 1.35;
}

.card-description {
  font-size: 13.5px;
  color: var(--slate-500);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px;
}

/* سطر السعر والتكلفة */
.pricing-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
  margin-top: auto;
}

.main-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.base-cost {
  font-size: 13.5px;
  color: var(--slate-400);
  font-weight: 500;
}

/* شريط الإجراءات والربح السفلي */
.card-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  row-gap: 10px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--slate-100);
}

/* بادج الربح الأخضر الصاعد */
.profit-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--green-bg);
  color: var(--green-text);
  border: 1px solid var(--green-border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.profit-pill svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* زر الطلب الأزرق */
.order-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 9px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.order-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.order-btn svg {
  width: 15px;
  height: 15px;
}

/* أزرار الكارت جنب بعض (سلة + شراء مباشر) */
.card-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.card-actions .order-btn {
  padding: 8px 14px;
}

/* زر الشراء المباشر — أخضر من ألوان الموقع نفسها */
.buy-now-btn {
  background: var(--green);
}

.buy-now-btn:hover {
  background: var(--green);
  filter: brightness(0.9);
}

/* ---------- Order Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--slate-200);
}

.modal-head h3 {
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--slate-400);
}

.modal-close:hover {
  color: var(--red);
}

.modal-body {
  padding: 22px 24px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-700);
  margin-bottom: 6px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--slate-200);
  font-size: 14px;
  font-family: inherit;
  color: var(--slate-900);
  background: var(--slate-50);
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* رسائل الخطأ — مخفية لحد ما الـ JS يبيّنها
   (كانت مستخدمة في صفحات الدخول ومش متعرفة، فكانت بتظهر طول الوقت) */
.error-text {
  display: none;
  margin: -4px 0 14px;
  padding: 9px 12px;
  border-radius: 9px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

/* تلميحات توضيحية جوه النماذج */
.hint {
  font-size: 12.5px;
  color: var(--slate-500);
  line-height: 1.8;
  background: var(--beige-soft);
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--slate-900);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footer */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--slate-200);
  padding: 32px 0;
  color: var(--slate-500);
  font-size: 13.5px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 28px;
  }
  .section-top-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-wrapper {
    max-width: 100%;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Product Card Pointer & Add-to-Cart ---------- */
.product-card {
  cursor: pointer;
}

/* ---------- Shopping Cart Button & Badge in Header ---------- */
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  cursor: pointer;
}

.cart-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

.cart-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  background: #F97316;
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #0A192F;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-badge.bump {
  transform: scale(1.25);
}

/* ---------- Cart Drawer / Sidebar ---------- */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: 100%;
  max-width: 420px;
  background: var(--white);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

[dir="rtl"] .cart-drawer {
  transform: translateX(-100%);
}

.cart-drawer-overlay.open .cart-drawer {
  transform: translateX(0);
}

[dir="rtl"] .cart-drawer-overlay.open .cart-drawer {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--slate-200);
  background: var(--white);
}

.cart-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  color: var(--slate-900);
}

.cart-count-pill {
  font-size: 12px;
  font-weight: 700;
  background: var(--slate-100);
  color: var(--slate-700);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.cart-drawer-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--slate-400);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.cart-drawer-close:hover {
  color: var(--red);
  background: var(--slate-100);
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Cart Items inside Drawer */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  position: relative;
}

.cart-item-img {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--slate-200);
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-item-qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--slate-200);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.qty-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-700);
  cursor: pointer;
  transition: background 0.15s ease;
}

.qty-btn:hover {
  background: var(--slate-100);
}

.qty-val {
  min-width: 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-900);
}

.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
}

.cart-item-remove:hover {
  color: var(--red);
  background: #FEF2F2;
}

/* Empty state in cart */
.cart-empty {
  text-align: center;
  padding: 50px 20px;
  margin: auto 0;
}

.cart-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.cart-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 6px;
}

.cart-empty-desc {
  font-size: 13.5px;
  color: var(--slate-500);
  margin-bottom: 20px;
}

.cart-drawer-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--slate-200);
  background: var(--white);
}

.cart-subtotal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--slate-600);
}

.cart-total-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--slate-900);
}

.btn-checkout {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

/* ---------- Product Details Modal ---------- */
.modal-product-details {
  max-width: 760px;
}

.product-details-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  padding: 24px;
}

.product-details-media {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--slate-100);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-details-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-details-info {
  display: flex;
  flex-direction: column;
}

.product-details-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 10px;
  line-height: 1.3;
}

.product-details-desc-wrap {
  margin-top: 14px;
  margin-bottom: 24px;
  flex: 1;
}

.product-details-desc {
  font-size: 14px;
  color: var(--slate-600);
  line-height: 1.7;
  white-space: pre-line;
  max-height: 180px;
  overflow-y: auto;
}

.product-details-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--slate-200);
}

.quantity-picker {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--slate-50);
  padding: 3px;
}

.quantity-picker .qty-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--white);
  border: 1px solid var(--slate-200);
}

.quantity-picker .qty-val {
  min-width: 36px;
  font-size: 15px;
  text-align: center;
  font-weight: 700;
  display: inline-block;
}

/* Multi-item order preview box */
.order-preview-box {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
  max-height: 200px;
  overflow-y: auto;
}

.order-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--slate-200);
  font-size: 13.5px;
}

.order-summary-item:last-child {
  border-bottom: none;
}

.order-summary-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.order-summary-item-img {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.order-summary-item-title {
  font-weight: 700;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.order-summary-item-qty {
  font-size: 12px;
  color: var(--slate-500);
}

.order-summary-item-price {
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.order-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1.5px solid var(--slate-300);
  font-weight: 800;
  font-size: 15px;
  color: var(--slate-900);
}

@media (max-width: 640px) {
  .product-details-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cart-drawer {
    max-width: 100%;
  }
}


/* ====================================================
   Product Details Page (product.html) — Full Page Gallery
   ==================================================== */
.pdp-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.pdp-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--slate-500);
  margin-bottom: 20px;
}

.pdp-back-link:hover {
  color: var(--primary);
}

.pdp-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 44px;
  align-items: start;
}

.pdp-gallery-main {
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  background: var(--slate-100);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.pdp-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

.pdp-thumbs-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pdp-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--slate-100);
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}

.pdp-thumb.active {
  border-color: var(--primary);
}

.pdp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-info {
  display: flex;
  flex-direction: column;
}

.pdp-category {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.pdp-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.35;
  margin-bottom: 14px;
}

.pdp-pricing-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.pdp-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--slate-900);
}

.pdp-stock {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--slate-500);
}

.pdp-desc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-500);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.pdp-desc {
  font-size: 15px;
  color: var(--slate-600);
  line-height: 1.8;
  margin-bottom: 28px;
  white-space: pre-line;
}

.pdp-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--slate-200);
}

.pdp-loading, .pdp-not-found {
  text-align: center;
  padding: 100px 20px;
  color: var(--slate-500);
  font-size: 15px;
}

@media (max-width: 800px) {
  .pdp-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .pdp-title {
    font-size: 22px;
  }
}

/* ====================================================
   Product Card Gallery — تقليب تلقائي بين صور المنتج
   ==================================================== */
.card-image-wrap.has-gallery .card-gallery-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.3s ease;
  pointer-events: none;
}

.card-image-wrap.has-gallery .card-gallery-img.active {
  opacity: 1;
}

.card-gallery-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.32);
  padding: 5px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.card-gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.25s ease, width 0.25s ease;
}

.card-gallery-dot.active {
  background: #FFFFFF;
  width: 16px;
  border-radius: 999px;
}

/* ─────────────────────────────────────────────────────────────
   متغيرات الأزرار: btn-sm / btn-ghost / btn-block
   (كانت مستخدمة في HTML و JS من غير تعريف، فكانت الأزرار بتطلع
    بشكل المتصفح الافتراضي grey بدون تنسيق)
   ───────────────────────────────────────────────────────────── */
.btn-sm {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 8px;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
}
.btn-ghost {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--slate-200);
  border-color: var(--slate-300);
}
.btn-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--slate-100);
  color: var(--slate-700);
  padding: 2px 6px;
  border-radius: 5px;
  direction: ltr;
  display: inline-block;
}
