/* ==========================================================================
   متجر Celv - التصميم الأبيض الأنيق (White Elegant Theme)
   ========================================================================== */

/* --- Google Font: IBM Plex Sans Arabic loaded in HTML --- */

:root {
  --font-family: 'IBM Plex Sans Arabic', sans-serif;

  /* لوحة الألوان البيضاء الأنيقة */
  --bg-main: #FFFFFF;
  --bg-secondary: #F8F7F5;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FDFCFA;
  --bg-header: #FFFFFF;
  --bg-footer: #1A1A1A;
  --bg-overlay: rgba(0, 0, 0, 0.45);

  --border-color: #E8E4DF;
  --border-light: #F0EDE8;

  --text-main: #2D2D2D;
  --text-secondary: #5A5A5A;
  --text-muted: #9A9590;
  --text-on-dark: #F3EFE9;
  --text-on-gold: #FFFFFF;

  --gold-primary: #C4A265;
  --gold-secondary: #B08D4C;
  --gold-light: #F5F0E6;
  --gold-accent: #D4B87A;
  --gold-gradient: linear-gradient(135deg, #C4A265, #D4B87A);

  --color-success: #2ECC71;
  --color-danger: #E74C3C;
  --color-warning: #F39C12;
  --color-info: #3498DB;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 8px 25px rgba(0,0,0,0.12);

  --transition-speed: 0.3s;
  --ease-function: cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 16px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  --border-radius-xs: 6px;

  --container-max: 1280px;
  --header-height: 70px;
  --nav-height: 48px;
}

/* ============================
   Reset & Base
   ============================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

body[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

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

/* ============================
   Header (الشريط العلوي)
   ============================ */
.store-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
}

/* Logo - يمين */
.store-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  background-color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--border-radius-sm);
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
  .brand-logo-img {
    height: 38px;
    padding: 3px 6px;
  }
}

.summary-brand-logo {
  height: 38px;
  width: auto;
  max-width: 130px;
  background-color: #ffffff;
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.logo-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -1px;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.logo-text span {
  color: var(--gold-primary);
}

/* Header Layout Columns */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-start;
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.header-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-speed) var(--ease-function);
  position: relative;
  white-space: nowrap;
}

.header-action-btn:hover {
  background: var(--gold-light);
  color: var(--gold-primary);
}

.header-action-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.header-action-btn .action-label {
  font-size: 12px;
}

/* Cart Button */
.cart-toggle-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-speed) var(--ease-function);
}

.cart-toggle-btn:hover {
  background: var(--gold-light);
  color: var(--gold-primary);
}

.cart-toggle-btn svg {
  width: 22px;
  height: 22px;
}

.cart-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  background: var(--gold-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

body[dir="ltr"] .cart-badge {
  left: auto;
  right: 2px;
}

/* Dropdown Menus */
.dropdown-wrapper {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 1100;
  overflow: hidden;
  animation: dropdownIn 0.2s ease;
}

body[dir="ltr"] .dropdown-menu {
  left: auto;
  right: 0;
}

.dropdown-menu.open {
  display: block;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background 0.15s;
  width: 100%;
  text-align: inherit;
}

.dropdown-item:hover,
.dropdown-item.active {
  background: var(--gold-light);
  color: var(--gold-primary);
}

.dropdown-item.active {
  font-weight: 600;
}

/* ============================
   Navigation Bar (شريط التنقل)
   ============================ */
.nav-bar {
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: var(--header-height);
  z-index: 999;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-height);
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-container::-webkit-scrollbar {
  display: none;
}

.nav-link {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--border-radius-xs);
  transition: all var(--transition-speed) var(--ease-function);
  white-space: nowrap;
  position: relative;
}

.nav-link:hover {
  color: var(--gold-primary);
  background: var(--gold-light);
}

.nav-link.active {
  color: var(--gold-primary);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--gold-primary);
  border-radius: 2px;
}

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  padding: 8px;
  color: var(--text-main);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

/* ============================
   Hero Carousel (البانر الترحيبي)
   ============================ */
.hero-carousel {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.6s var(--ease-function);
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 30px 24px;
  text-align: center;
}

.carousel-overlay h2 {
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.carousel-overlay p {
  color: rgba(255,255,255,0.88);
  font-size: 16px;
  max-width: 600px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 5;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  transition: all 0.3s;
  cursor: pointer;
}

.carousel-dot.active {
  background: var(--gold-primary);
  transform: scale(1.25);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all 0.3s;
  border: 1px solid rgba(255,255,255,0.2);
}

.carousel-arrow:hover {
  background: rgba(255,255,255,0.35);
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
}

.carousel-arrow.prev { right: 20px; }
.carousel-arrow.next { left: 20px; }

body[dir="ltr"] .carousel-arrow.prev { right: auto; left: 20px; }
body[dir="ltr"] .carousel-arrow.next { left: auto; right: 20px; }

/* ============================
   Categories Grid (شبكة الأقسام)
   ============================ */
.categories-section {
  padding: 50px 0;
  background: var(--bg-main);
}

.section-title {
  text-align: center;
  margin-bottom: 36px;
}

.section-title h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.section-title p {
  font-size: 15px;
  color: var(--text-muted);
}

.section-title .title-accent {
  display: inline-block;
  width: 50px;
  height: 3px;
  background: var(--gold-gradient);
  border-radius: 3px;
  margin-top: 10px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.category-card {
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-speed) var(--ease-function);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-function);
}

.category-card:hover img {
  transform: scale(1.08);
}

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.05) 60%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 20px;
  transition: background 0.3s;
}

.category-card:hover .category-card-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.15) 60%);
}

.category-card-overlay h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.category-card-overlay span {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  margin-top: 4px;
}

/* ============================
   Products Section (المنتجات)
   ============================ */
.products-section {
  padding: 50px 0;
  background: var(--bg-secondary);
}

.products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.products-toolbar .back-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.products-toolbar .back-btn.visible {
  display: flex;
}

.products-toolbar .back-btn:hover {
  background: var(--gold-light);
  color: var(--gold-primary);
}

.products-toolbar .back-btn svg {
  width: 16px;
  height: 16px;
}

.products-count {
  font-size: 14px;
  color: var(--text-muted);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Product Card */
.product-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-speed) var(--ease-function);
  border: 1px solid var(--border-light);
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--gold-accent);
}

.product-card .card-img-wrapper {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--bg-secondary);
}

.product-card .card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease-function);
}

.product-card:hover .card-img-wrapper img {
  transform: scale(1.06);
}

.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

body[dir="ltr"] .card-badge {
  right: auto;
  left: 12px;
}

.badge-sale {
  background: var(--color-danger);
  color: #fff;
}

.badge-out {
  background: var(--text-muted);
  color: #fff;
}

.card-info {
  padding: 16px;
}

.card-cat {
  font-size: 11px;
  color: var(--gold-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  margin: 6px 0 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}

.price-now {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.price-was {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.btn-add-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  background: var(--gold-gradient);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-speed) var(--ease-function);
}

.btn-add-cart:hover:not(:disabled) {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-add-cart:disabled {
  background: #E0DDD8;
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-add-cart svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ============================
   FAQ Section (الأسئلة الشائعة)
   ============================ */
.faq-section {
  padding: 60px 0;
  background: var(--bg-main);
}

.faq-list {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  transition: border-color 0.3s;
}

.faq-item.open {
  border-color: var(--gold-accent);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  width: 100%;
  padding: 18px 20px;
  background: var(--bg-card);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  transition: background 0.2s;
}

.faq-question:hover {
  background: var(--gold-light);
}

.faq-question .faq-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-function);
  color: var(--gold-primary);
}

.faq-item.open .faq-question .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-function), padding 0.35s;
}

.faq-answer-inner {
  padding: 0 20px 18px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  text-align: center;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

/* ============================
   Footer (الذيل)
   ============================ */
.store-footer {
  background: var(--bg-footer);
  color: var(--text-on-dark);
  padding: 50px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-brand h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--gold-accent);
}

.footer-logo-img {
  height: 38px;
  width: auto;
  margin-bottom: 16px;
  display: block;
}

.footer-brand p {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
}

.footer-links h4,
.footer-social-section h4 {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}

.footer-links a {
  display: block;
  font-size: 13.5px;
  color: rgba(255,255,255,0.6);
  padding: 5px 0;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--gold-accent);
}

.social-icons {
  display: flex;
  gap: 12px;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  color: rgba(255,255,255,0.7);
}

.social-icon:hover {
  background: var(--gold-primary);
  color: #fff;
  transform: translateY(-2px);
}

.social-icon svg {
  width: 20px;
  height: 20px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  text-align: center;
}

.footer-bottom p {
  font-size: 12.5px;
  color: rgba(255,255,255,0.4);
  width: 100%;
  text-align: center;
}

/* ============================
   Cart Sidebar (السلة الجانبية)
   ============================ */
.cart-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 400px;
  height: 100vh;
  background: var(--bg-card);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.35s var(--ease-function);
  box-shadow: var(--shadow-lg);
  border-right: 1px solid var(--border-color);
}

body[dir="ltr"] .cart-sidebar {
  left: auto;
  right: 0;
  transform: translateX(100%);
  border-right: none;
  border-left: 1px solid var(--border-color);
}

.cart-sidebar.open {
  transform: translateX(0);
}

.cart-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.cart-sidebar-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.close-sidebar-btn {
  font-size: 28px;
  color: var(--text-muted);
  transition: color 0.2s;
  line-height: 1;
}

.close-sidebar-btn:hover {
  color: var(--color-danger);
}

.cart-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.empty-cart-message {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 14px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-item-img {
  width: 70px;
  height: 70px;
  border-radius: var(--border-radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-item-info {
  flex: 1;
  min-width: 0;
}

.sidebar-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-primary);
  display: block;
  margin-bottom: 6px;
}

.sidebar-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.qty-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.qty-val {
  font-size: 14px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.btn-remove-sidebar-item {
  padding: 6px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-remove-sidebar-item:hover {
  background: rgba(231,76,60,0.1);
  color: var(--color-danger);
}

.cart-sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s;
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ============================
   Buttons (الأزرار)
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-speed) var(--ease-function);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--gold-gradient);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #E0DDD8;
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-light);
}

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

.btn-whatsapp:hover {
  background: #1EB954;
}

.w-full { width: 100%; }
.mt-4 { margin-top: 16px; }

/* ============================
   Modals (النوافذ المنبثقة)
   ============================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  padding: 20px;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  max-width: 540px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
  border: 1px solid var(--border-color);
}

@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

body[dir="ltr"] .modal-close {
  left: auto;
  right: 16px;
}

.modal-close:hover {
  color: var(--color-danger);
}

/* Checkout form */
.checkout-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xs);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg-main);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
}

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

.checkout-summary-box {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 0;
}

.summary-line.total {
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
  font-weight: 700;
  color: var(--text-main);
  font-size: 16px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-footer .btn { flex: 1; }

/* Success Modal */
.success-icon-wrapper {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-success), #27ae60);
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.success-message {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.whatsapp-prompt {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
}

.whatsapp-prompt p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.whatsapp-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

/* ============================
   Loading & Empty States
   ============================ */
.loading-state,
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
  grid-column: 1 / -1;
}

.loading-state::before {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================
   Responsive Design (التجاوب)
   ============================ */

/* Tablet */
@media (max-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  .hero-carousel {
    height: 340px;
  }
}

/* Small Tablet */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .header-top {
    padding: 0 16px;
  }

  .header-action-btn .action-label {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .nav-bar {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 2500;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease-function);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    padding-top: 70px;
  }

  body[dir="ltr"] .nav-bar {
    right: auto;
    left: 0;
    transform: translateX(-100%);
    border-left: none;
    border-right: 1px solid var(--border-color);
  }

  .nav-bar.open {
    transform: translateX(0);
  }

  .nav-container {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 16px;
    gap: 2px;
  }

  .nav-link {
    padding: 14px 16px;
    font-size: 15px;
    border-radius: var(--border-radius-sm);
  }

  .nav-link.active::after {
    display: none;
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 2499;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s;
  }

  .nav-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  .nav-close-btn {
    position: absolute;
    top: 18px;
    left: 18px;
    font-size: 28px;
    color: var(--text-muted);
    display: block;
  }

  body[dir="ltr"] .nav-close-btn {
    left: auto;
    right: 18px;
  }

  .hero-carousel {
    height: 200px;
  }

  .carousel-overlay h2 {
    font-size: 22px;
  }

  .carousel-overlay p {
    font-size: 13px;
  }

  .carousel-arrow {
    width: 36px;
    height: 36px;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cart-sidebar {
    width: 100%;
  }

  .modal-content {
    padding: 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .section-title h2 {
    font-size: 22px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero-carousel {
    height: 160px;
  }

  .carousel-overlay h2 {
    font-size: 18px;
  }

  .carousel-overlay p {
    font-size: 12px;
  }

  .carousel-dots {
    bottom: 12px;
  }

  .carousel-dot {
    width: 8px;
    height: 8px;
  }

  .categories-section,
  .products-section,
  .faq-section {
    padding: 30px 0;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .category-card {
    aspect-ratio: 3/2;
  }

  .category-card-overlay h3 {
    font-size: 14px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .card-info {
    padding: 12px;
  }

  .card-title {
    font-size: 13px;
  }

  .price-now {
    font-size: 15px;
  }

  .btn-add-cart {
    padding: 8px;
    font-size: 12px;
  }

  .faq-question {
    font-size: 15px;
    padding: 14px 16px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .logo-text {
    font-size: 19px;
  }
}

/* Nav close button hidden on desktop */
.nav-close-btn {
  display: none;
}

/* ==========================================================================
   Advanced Checkout Form Styling (تنسيقات شاشة الدفع المتقدمة)
   ========================================================================== */

/* زيادة عرض نافذة الدفع لتتسع للتفاصيل الجديدة */
#checkout-modal .modal-content {
  max-width: 650px;
}

/* عناوين أقسام النموذج */
.checkout-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 25px 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
  position: relative;
}

.checkout-section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 40px;
  height: 2px;
  background: var(--gold-gradient);
}

/* كارت كوبون التخفيض (أكورديون) */
.checkout-coupon-card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-secondary);
  margin-bottom: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.coupon-toggle-btn {
  width: 100%;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  text-align: right;
  transition: background 0.2s;
}

.coupon-toggle-btn:hover {
  background: var(--border-light);
}

.coupon-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.coupon-toggle-label svg {
  width: 18px;
  height: 18px;
  color: var(--gold-primary);
}

.checkout-coupon-card .chevron-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.checkout-coupon-card.open .chevron-icon {
  transform: rotate(180deg);
}

.coupon-content {
  padding: 0 18px 18px 18px;
  border-top: 1px dashed var(--border-color);
  background: var(--bg-card);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.coupon-input-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.coupon-input-group input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xs);
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-main);
  color: var(--text-main);
}

.coupon-input-group input:focus {
  outline: none;
  border-color: var(--gold-primary);
}

.coupon-input-group .btn {
  padding: 10px 20px;
  font-size: 13.5px;
  border-radius: var(--border-radius-xs);
  background: #3b82f6; /* لون أزرق جذاب للتطبيق مثل النموذج */
}

.coupon-msg {
  font-size: 12px;
  margin-top: 8px;
  font-weight: 500;
}

.coupon-msg.success { color: var(--color-success); }
.coupon-msg.error { color: var(--color-danger); }

/* حقل الهاتف المدمج مع مفتاح البلد */
.phone-input-wrapper {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xs);
  overflow: hidden;
  background: var(--bg-main);
  transition: border-color 0.2s;
}

.phone-input-wrapper:focus-within {
  border-color: var(--gold-primary);
}

.phone-prefix-select {
  width: auto !important;
  max-width: 95px;
  padding: 10px 12px;
  border: none;
  border-left: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
}

.phone-input-wrapper input {
  flex: 1;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
}

/* خيار الإرسال كهدية */
.checkbox-group {
  margin: 15px 0;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  color: var(--text-main);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--gold-primary);
}

/* صناديق التنبيه الصفراء لطرق الشحن والدفع */
.alert-warning {
  padding: 12px 16px;
  background: #fffbeb;
  border-right: 4px solid #f59e0b;
  border-radius: var(--border-radius-xs);
  color: #b45309;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.alert-warning.hidden {
  display: none !important;
}

/* شبكة خيارات الشحن */
.shipping-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 25px;
}

.shipping-card-option,
.payment-card-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.shipping-card-option input[type="radio"],
.payment-card-option input[type="radio"] {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 18px;
  height: 18px;
  accent-color: var(--gold-primary);
  z-index: 10;
}

.shipping-card-content,
.payment-card-content {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  background: var(--bg-card);
  transition: all 0.25s ease;
  height: 100%;
}

.shipping-card-option input[type="radio"]:checked + .shipping-card-content,
.payment-card-option input[type="radio"]:checked + .payment-card-content {
  border-color: var(--gold-primary);
  background: rgba(196, 162, 101, 0.05);
  box-shadow: 0 0 0 1px var(--gold-primary);
}

.shipping-card-title,
.payment-card-title,
.payment-card-title-row span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  padding-right: 24px; /* لعدم تغطية دائرة الراديو في نظام RTL */
}

.shipping-card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 4px;
  padding-right: 24px;
}

.shipping-card-desc,
.payment-card-desc {
  font-size: 12.5px;
  color: #000000 !important; /* لون أسود داكن واضح */
  font-weight: 600;
  line-height: 1.4;
  padding-right: 24px;
}

/* خيارات الدفع */
.payment-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
}

.payment-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
  padding-right: 24px; /* لمنع تداخل الراديو مع النص */
}

.payment-logos {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
}

.logo-pay {
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 3px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  color: #18181b;
  display: inline-flex;
  align-items: center;
}

.logo-pay.applepay {
  background: #000;
  color: #fff;
  border-color: #000;
  font-size: 11px;
}

.logo-pay.visa {
  color: #1a1f71;
  font-style: italic;
  font-weight: 800;
}

.logo-pay.mastercard {
  color: #eb001b;
  font-weight: 800;
}

/* تحسين السلكتات */
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xs);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg-main);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.form-group select:focus {
  border-color: var(--gold-primary);
}

/* شاشات الجوال */
}

/* ==========================================================================
   تنسيقات صفحة إتمام الطلب المستقلة (Standalone Checkout Page Styles)
   ========================================================================== */

.checkout-page-body {
  background-color: var(--bg-main);
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.checkout-main-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  min-height: 100vh;
}

/* عمود الفورم والمدخلات */
.checkout-form-column {
  background-color: var(--bg-main);
  padding: 40px 60px;
  overflow-y: auto;
}

.checkout-header-simplified {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.checkout-back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.checkout-back-link:hover {
  color: var(--gold-primary);
}

.back-arrow-icon {
  width: 18px;
  height: 18px;
  transform: rotate(180deg); /* LTR/RTL adjust: in RTL, arrow points left, so let's adjust */
}
body[dir="ltr"] .back-arrow-icon {
  transform: none;
}

/* عمود ملخص سلة المشتريات */
.checkout-summary-column {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 40px 50px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

body[dir="ltr"] .checkout-summary-column {
  border-right: none;
  border-left: 1px solid var(--border-color);
}

.checkout-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.summary-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.summary-back-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  transform: translateX(3px);
}
body[dir="ltr"] .summary-back-btn:hover {
  transform: translateX(-3px);
}

.summary-back-btn svg {
  width: 18px;
  height: 18px;
  transform: rotate(180deg);
}
body[dir="ltr"] .summary-back-btn svg {
  transform: none;
}

.summary-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

.summary-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

/* بطل التوتال الصغير */
.summary-total-hero {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
}

.summary-total-label {
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

.summary-total-amount {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

/* قائمة منتجات الفاتورة */
.checkout-products-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

.checkout-product-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.product-item-img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-main);
}

.product-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.4;
  margin: 0;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-qty-selector {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xs);
  background: var(--bg-main);
  padding: 2px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.2s;
  border-radius: 4px;
}

.qty-btn:hover {
  background: var(--gold-light);
  color: var(--gold-primary);
}

.qty-val {
  font-size: 13px;
  font-weight: 600;
  padding: 0 10px;
  min-width: 20px;
  text-align: center;
}

.product-item-price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.product-item-total-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.btn-remove-item {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-danger);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.btn-remove-item:hover {
  color: #c0392b;
}

/* جدول الحساب الإجمالي */
.checkout-receipt-box {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.receipt-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dotted var(--border-light);
  font-size: 14px;
  color: var(--text-secondary);
}

.receipt-line:last-child {
  border-bottom: none;
}

.receipt-line.discount {
  color: var(--color-success);
  font-weight: 500;
}

.receipt-line.total-line {
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  margin-top: 5px;
  color: var(--text-main);
}

.receipt-line.total-line strong {
  font-size: 20px;
  color: var(--text-main);
}

.highlight-shipping-text {
  color: var(--color-warning);
  font-weight: 500;
  font-size: 12px;
}

/* أزرار الإجراءات بالصفحة */
.checkout-page-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
}

/* التجاوب للشاشات المختلفة */
@media (max-width: 992px) {
  .checkout-main-container {
    grid-template-columns: 1fr;
  }
  
  .checkout-summary-column {
    height: auto;
    position: static;
    border-right: none;
    border-top: 1px solid var(--border-color);
    padding: 30px 24px;
    order: -1; /* يظهر ملخص المنتجات بالأعلى في الجوال */
  }

  .checkout-form-column {
    padding: 30px 24px;
  }

  .product-item-title {
    max-width: 100%;
  }
}

/* تحسين التجاوب وضغط حجم الصفحة للهواتف الذكية (آيفون وأندرويد) */
@media (max-width: 480px) {
  .checkout-summary-column,
  .checkout-form-column {
    padding: 20px 14px !important;
  }
  
  .shipping-options-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  
  .checkout-header-simplified {
    padding-bottom: 12px;
    margin-bottom: 20px;
  }
  
  .checkout-section-title {
    font-size: 15px;
    margin-bottom: 12px;
  }
}

/* ============================
   Lightbox Modal (عرض الصورة الكبيرة)
   ============================ */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox-modal.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85%;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-modal.open .lightbox-content {
  transform: scale(1);
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  border: 2px solid var(--gold-primary);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 40px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.2s;
  z-index: 4100;
}

.lightbox-close:hover {
  color: var(--gold-primary);
  transform: scale(1.1);
}

/* لمنع التمرير بالخلفية عند فتح الصورة */
body.lightbox-open {
  overflow: hidden;
}

.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 50px;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  cursor: pointer;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 4100;
  user-select: none;
}

.lightbox-prev:hover, .lightbox-next:hover {
  color: var(--gold-primary);
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 16px;
  border-radius: 20px;
  z-index: 4100;
  direction: ltr;
}

@media (max-width: 768px) {
  .lightbox-prev, .lightbox-next {
    width: 44px;
    height: 44px;
    font-size: 32px;
  }
  .lightbox-prev {
    left: 10px;
  }
  .lightbox-next {
    right: 10px;
  }
}

/* ==========================================================================
   نافذة تفاصيل المنتج (Product Details Modal CSS)
   ========================================================================== */

.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-modal-overlay.open {
  display: flex;
  opacity: 1;
}

.product-modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 850px;
  border-radius: var(--border-radius-md);
  padding: 30px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.product-modal-overlay.open .product-modal-container {
  transform: translateY(0);
}

.product-modal-close {
  position: absolute;
  top: 15px;
  left: 15px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 5;
}

.product-modal-close:hover {
  color: var(--gold-primary);
}

.product-modal-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
}

.product-modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-modal-main-img-wrapper {
  aspect-ratio: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.product-modal-main-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-modal-main-img-wrapper img:hover {
  transform: scale(1.03);
}

.product-modal-thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 5px;
}

/* Custom scrollbar for thumbnails */
.product-modal-thumbnails::-webkit-scrollbar {
  height: 4px;
}
.product-modal-thumbnails::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
}
.product-modal-thumbnails::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.product-modal-thumbnail-item {
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s;
  flex-shrink: 0;
}

.product-modal-thumbnail-item.active, .product-modal-thumbnail-item:hover {
  opacity: 1;
  border-color: var(--gold-primary);
}

.product-modal-thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-modal-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: right;
}

.product-modal-cat {
  font-size: 11px;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.product-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
}

.product-modal-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 5px;
}

.product-modal-price-now {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-color);
}

.product-modal-price-was {
  font-size: 15px;
  text-decoration: line-through;
  color: var(--text-muted);
}

.product-modal-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 0;
  max-height: 150px;
  overflow-y: auto;
}

.product-modal-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-modal-option-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-modal-option-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-color);
}

.product-modal-option-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.product-modal-option-select:focus {
  border-color: var(--gold-primary);
}

.product-modal-purchase-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
}

.quantity-controller {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  height: 44px;
  background: rgba(0, 0, 0, 0.2);
}

.quantity-controller .qty-btn {
  width: 36px;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-controller .qty-btn:hover {
  background: var(--gold-primary);
  color: #000;
}

.quantity-controller input {
  width: 45px;
  text-align: center;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 15px;
  font-family: inherit;
  font-weight: bold;
}

.product-modal-add-btn {
  flex: 1;
  height: 44px;
  background: var(--gold-primary);
  color: #000;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.product-modal-add-btn:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
}

.product-modal-stock-info {
  font-size: 11px;
  color: var(--text-muted);
}

/* Card details zoom overlay button */
.zoom-icon-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  z-index: 5;
}

.card-img-wrapper:hover .zoom-icon-overlay {
  opacity: 1;
}

.zoom-icon-overlay:hover {
  background: var(--gold-primary);
  color: #000;
}

@media (max-width: 768px) {
  .product-modal-body {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .product-modal-container {
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
  }
  .product-modal-close {
    top: 10px;
    left: 10px;
  }
}


