/* مزارع الثنيان - متجر */
:root {
  --color-primary: #1a365d;
  --color-primary-light: #2c5282;
  --color-bg: #f7fafc;
  --color-card: #ffffff;
  --color-text: #1a202c;
  --color-text-muted: #4a5568;
  --color-border: #e2e8f0;
  --color-open: #276749;
  --color-btn: #e2e8f0;
  --color-btn-hover: #cbd5e0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --font: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  direction: rtl;
}

body.page-home {
  padding-bottom: 72px;
}

/* ========== الصفحة الرئيسية (مثل theenyanf54.vip) ========== */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--color-card);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.cart-btn-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
  outline: none;
}
.cart-btn-header:hover,
.cart-btn-header:focus,
.cart-btn-header:active {
  text-decoration: none;
  border-bottom: none;
  box-shadow: none;
  outline: none;
}

.cart-btn-pill {
  padding: 10px 18px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.95rem;
}

.cart-btn-header-small {
  padding: 6px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.75rem;
  gap: 4px;
}


.cart-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.cart-icon-sm {
  width: 18px;
  height: 18px;
}

/* إشعار إضافة منتج */
.toast-add-product {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 20px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 24px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(26, 54, 93, 0.35);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

.toast-add-product.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-section-with-name {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.logo-img-circle {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.header-brand-ar {
  font-size: 1.05rem;
  font-weight: 800;
  color: #2d5016;
  line-height: 1.2;
}

.header-brand-en {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 1.2;
}

.logo-section-single {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo-img-full {
  width: auto;
  height: 44px;
  max-width: 180px;
  border-radius: 0;
  object-fit: contain;
  display: block;
}

.store-name-header {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text);
}

.store-name {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-text);
}

.store-name-en {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-btn span {
  display: block;
  height: 3px;
  background: var(--color-text);
  border-radius: 2px;
  width: 22px;
}

.menu-btn {
  gap: 6px;
}

/* الهيرو */
.hero {
  background: var(--color-card);
  padding: 24px 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--color-text);
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0;
}

.hero-store .hero-title {
  margin-bottom: 14px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag-pill {
  padding: 8px 14px;
  background: var(--color-btn);
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
}

.store-details-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
}

.store-detail-item {
  flex: 1;
  min-width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  font-size: 0.85rem;
  border-right: 1px solid var(--color-border);
}

.store-detail-item:last-child {
  border-right: none;
}

.store-detail-item strong {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.store-detail-item em {
  font-style: normal;
  font-weight: 700;
  color: var(--color-text);
}

.store-detail-item.open-badge em {
  color: var(--color-open);
}

/* شريط الأيقونات */
.icon-strip {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0;
  margin-bottom: 12px;
  background: var(--color-card);
  box-shadow: var(--shadow);
}

.icon-strip-inner {
  display: flex;
  gap: 12px;
  padding: 0 16px;
  min-width: min-content;
}

.icon-item {
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--color-btn);
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
}

/* بطاقة قائمة المتجر */
.store-card {
  background: var(--color-card);
  padding: 20px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.store-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.store-card-time {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
}

.store-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  color: var(--color-text);
  flex: 1;
  text-align: center;
}

.store-card-rating {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
}

.store-card-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-align: center;
  margin: 0 0 14px;
  line-height: 1.4;
}

.store-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding: 14px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.store-card-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.store-card .open-badge em {
  color: var(--color-open);
  font-style: normal;
  font-weight: 600;
}

.store-card-cta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 14px 0 0;
  line-height: 1.5;
  text-align: center;
}

/* عروض اليوم + شبكة المنتجات */
.products-section {
  padding: 0 16px 24px;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--color-text);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
  overflow: hidden;
}

.product-card-row {
  flex-direction: row;
  align-items: stretch;
  padding: 14px;
  gap: 14px;
}

.product-card-row .product-image-wrap {
  width: 110px;
  height: 110px;
  min-width: 110px;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-border);
}

.product-card-row .product-info {
  flex: 1;
  min-width: 0;
  padding: 0;
  justify-content: flex-start;
}

.product-card-row .product-title {
  margin-bottom: 4px;
}

.product-card-row .product-desc {
  -webkit-line-clamp: 2;
  margin-bottom: 8px;
}

.product-card-row .product-price {
  order: 0;
  margin-bottom: 8px;
  font-size: 1rem;
}

.product-card-row .product-footer {
  margin-top: auto;
  padding-top: 0;
}

.product-card:active {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.product-image-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-border);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.product-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  order: -1;
}

.product-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
  line-height: 1.35;
}

.product-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  margin-top: auto;
  padding-top: 8px;
}

.btn-add {
  padding: 10px 20px;
  background: var(--color-btn);
  color: var(--color-text);
  border: none;
  border-radius: 24px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: auto;
}

.btn-add:hover {
  background: var(--color-btn-hover);
}

.btn-add:active {
  transform: scale(0.98);
}

.product-qty-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--color-btn);
  border-radius: 24px;
  padding: 4px 6px;
  gap: 4px;
}

.btn-qty {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: background 0.2s;
}

.btn-qty:hover {
  background: var(--color-primary-light);
}

.btn-qty-minus {
  font-size: 1.25rem;
}

.product-qty-num {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
}

/* درج السلة */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.cart-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 380px;
  height: 100vh;
  background: var(--color-card);
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}

.cart-drawer-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  color: var(--color-text);
}

.cart-drawer-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.cart-drawer-close:hover {
  color: var(--color-text);
}

.cart-drawer-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  padding: 12px 16px;
  margin: 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-drawer-delivery {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}

.cart-drawer-subtitle {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--color-text);
}

.cart-drawer-address {
  font-size: 0.95rem;
  margin: 0 0 4px;
  color: var(--color-text);
}

.cart-drawer-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0 0 8px;
  line-height: 1.4;
}

.cart-drawer-free {
  font-size: 0.9rem;
  color: var(--color-open);
  font-weight: 600;
  margin: 0;
}

.cart-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-drawer-empty {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-align: center;
  padding: 24px 0;
  margin: 0;
}

.cart-drawer-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-drawer-item:last-child {
  border-bottom: none;
}

.cart-drawer-item-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--color-border);
  flex-shrink: 0;
}

.cart-drawer-item-info {
  flex: 1;
  min-width: 0;
}

.cart-drawer-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--color-text);
}

.cart-drawer-item-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
}

.cart-drawer-footer {
  padding: 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.cart-drawer-total-row {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 8px;
}

.cart-drawer-status {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 14px;
}

.btn-cart-proceed {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-cart-proceed:hover {
  background: var(--color-primary-light);
}

@media (min-width: 480px) {
  .products-grid {
    gap: 18px;
  }

  .hero-title {
    font-size: 2rem;
  }
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 900px;
    margin: 0 auto;
  }

  .hero,
  .hero-store,
  .store-card,
  .icon-strip {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }

  .products-section {
    max-width: 900px;
    margin: 0 auto;
  }

  .product-card-row .product-image-wrap {
    width: 130px;
    height: 130px;
    min-width: 130px;
  }
}

/* ========== صفحات أخرى (السلة، الدفع، إلخ) ========== */
.store-info {
  background: var(--color-card);
  padding: 20px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.store-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--color-text);
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--color-btn);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--color-text);
}

.tag-icon {
  flex-shrink: 0;
}

.store-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.store-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.open-badge em {
  color: var(--color-open);
  font-style: normal;
  font-weight: 600;
}

/* قائمة منتجات (تخطيط قديم للصفحات الأخرى) */
.products-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.products-list .product-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 14px;
  padding: 14px;
}

.products-list .product-image-wrap {
  width: 110px;
  height: 110px;
  aspect-ratio: auto;
}

.products-list .product-price {
  order: unset;
}

.products-list .product-footer {
  margin-top: 0;
  padding-top: 0;
}

.products-list .btn-add {
  width: auto;
  background: var(--color-btn);
  color: var(--color-text);
}

.products-list .btn-add:hover {
  background: var(--color-btn-hover);
}

/* شريط السلة السفلي - زر pill */
.cart-bar-wrap {
  position: fixed;
  bottom: 12px;
  left: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  justify-content: center;
}

.cart-bar-pill {
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 9999px;
  box-shadow: 0 2px 12px rgba(26, 54, 93, 0.35);
  cursor: pointer;
  font-family: var(--font);
  transition: box-shadow 0.2s;
  text-decoration: none;
  outline: none;
}
.cart-bar-pill:hover,
.cart-bar-pill:focus,
.cart-bar-pill:active {
  text-decoration: none;
  border-bottom: none;
  outline: none;
}
.cart-bar-pill:hover {
  box-shadow: 0 4px 16px rgba(26, 54, 93, 0.4);
}

.cart-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-bar-arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transform: scaleX(-1);
}

.cart-status {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  text-align: right;
}

.cart-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-bar-pill .cart-total {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.cart-bar-pill .cart-count-badge {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: #fff;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* شريط السلة الكامل (صفحة السلة) */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--color-primary);
  color: #fff;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}

.cart-bar-content {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #fff;
  font-family: var(--font);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 0;
  text-align: right;
  text-decoration: none;
}

.arrow-icon {
  width: 20px;
  height: 20px;
  transform: scaleX(-1);
}

.cart-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-total {
  font-weight: 700;
  font-size: 1rem;
}

.cart-count-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* تحسينات للشاشات الأكبر */
@media (min-width: 480px) {
  .product-image-wrap {
    width: 130px;
    height: 130px;
  }

  .products-list {
    max-width: 520px;
    margin: 0 auto;
  }

  .store-info {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ========== صفحة السلة ========== */
body.page-cart {
  padding-bottom: 85px;
}

.store-info-cart .store-details {
  display: none;
}

.tag-active {
  background: var(--color-btn-hover);
  font-weight: 600;
}

/* عنوان الصفحة + التبويبات */
.cart-page-store {
  padding: 16px 16px 12px;
}

.cart-page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-text);
  text-align: center;
  margin: 0 0 14px;
}

.cart-page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tag-delivery {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e53e3e;
  flex-shrink: 0;
}

.cart-card,
.delivery-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 16px 16px;
  box-shadow: var(--shadow);
}

.cart-card-grey,
.delivery-card-grey {
  background: #f1f5f9;
}

.cart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.cart-card-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-card-breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.cart-card-meta-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

@media (min-width: 480px) {
  .cart-card,
  .delivery-card {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
}


.btn-trash {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.btn-trash:hover {
  background: var(--color-btn);
  color: var(--color-text);
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-item-row {
  flex-direction: row-reverse;
  align-items: flex-start;
}

.cart-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--color-text);
}

.btn-remove-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid #e53e3e;
  color: #e53e3e;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-remove-item:hover {
  background: #e53e3e;
  color: #fff;
}

.cart-item-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.btn-special-request {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--color-btn);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--color-text);
  cursor: pointer;
  margin-bottom: 10px;
}

.btn-special-request:hover {
  background: var(--color-btn-hover);
}

.cart-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.cart-item-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  background: #2d3748;
  color: #fff;
  border-radius: 24px;
  padding: 6px 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
}

.quantity-control-light {
  background: var(--color-btn);
  color: var(--color-text);
  border-radius: 20px;
  padding: 4px 8px;
}

.quantity-control-light button:hover {
  background: var(--color-btn-hover);
}

.quantity-control button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 4px;
}

.quantity-control:not(.quantity-control-light) button {
  color: #fff;
}

.quantity-control button:hover {
  background: rgba(255,255,255,0.15);
}

.quantity-control span {
  min-width: 24px;
  text-align: center;
}

.cart-item-image-wrap {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-border);
}

.cart-item-row .cart-item-image-wrap {
  width: 80px;
  height: 80px;
}

.cart-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-empty {
  display: none;
  text-align: center;
  padding: 24px 16px;
}

.cart-empty.show {
  display: block;
}

.cart-empty p {
  margin-bottom: 12px;
  color: var(--color-text-muted);
}

.btn-back-shop {
  display: inline-block;
  padding: 10px 20px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.btn-back-shop:hover {
  background: var(--color-primary-light);
}

.cart-card .cart-items.hide {
  display: none;
}

/* بطاقة موقع التسليم */
.delivery-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text);
}

.delivery-address {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.delivery-address-text {
  flex: 1;
  min-width: 0;
}

.delivery-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.delivery-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.delivery-free {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.delivery-icon-wrap {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--color-text);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delivery-icon {
  width: 22px;
  height: 22px;
}

/* شريط المتابعة للدفع */
.cart-bar-checkout .cart-bar-content {
  text-decoration: none;
  color: #fff;
}

.cart-bar-checkout .cart-status {
  font-weight: 600;
}

/* شريط المتابعة للدفع بصيغة pill (مثل الصفحة الأولى) */
.cart-bar-checkout-pill {
  text-decoration: none;
  color: #fff;
  cursor: pointer;
}

.cart-bar-checkout-pill .cart-status {
  font-weight: 700;
  font-size: 0.95rem;
}

/* ========== صفحة إتمام الطلب (Checkout) ========== */
body.page-checkout {
  background: #2d3748;
  padding: 0;
  min-height: 100vh;
}

.checkout-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #2d3748;
  color: #fff;
}

.checkout-header-white {
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.checkout-header-white .menu-btn span {
  background: var(--color-text);
}

.checkout-header-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkout-header-logo .logo-img-circle {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #86b34a;
}

.checkout-header-logo .header-brand-ar {
  font-size: 1.05rem;
  font-weight: 800;
  color: #2d5016;
}

.checkout-header-logo .header-brand-en {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.checkout-header-bar:not(.checkout-header-white) .menu-btn span {
  background: #fff;
}

.cart-btn-checkout-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.cart-btn-checkout-pill .cart-icon-sm {
  width: 20px;
  height: 20px;
}

.cart-btn-header-dark {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.cart-btn-header-dark .cart-icon-sm {
  width: 18px;
  height: 18px;
}

.checkout-card {
  background: var(--color-card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 16px 32px;
  margin: 0;
  min-height: calc(100vh - 60px);
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
}

@media (min-width: 480px) {
  .checkout-card {
    max-width: 480px;
    margin: 0 auto;
    border-radius: var(--radius);
    min-height: auto;
  }
}

.checkout-section {
  margin-bottom: 24px;
}

.checkout-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 14px;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-input,
.checkout-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-btn);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--color-text);
}

.checkout-input::placeholder,
.checkout-textarea::placeholder {
  color: var(--color-text-muted);
}

.checkout-textarea {
  resize: vertical;
  min-height: 80px;
}

.checkout-phone-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-btn);
  overflow: hidden;
}

.checkout-phone-prefix {
  padding: 14px 12px;
  font-size: 1rem;
  color: var(--color-text-muted);
  background: var(--color-border);
  font-family: var(--font);
  border-left: 1px solid var(--color-border);
}

.checkout-phone-input {
  flex: 1;
  border: none;
  border-radius: 0;
}

.checkout-phone-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 8px 0 0;
}

.checkout-phone-hint.checkout-phone-error {
  color: #e53e3e;
  font-weight: 600;
}

/* طريقة الدفع */
.payment-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--color-btn);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

.payment-option:has(.payment-radio:checked) {
  border-color: var(--color-primary);
  background: rgba(26, 54, 93, 0.06);
}

.payment-radio {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.payment-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.payment-logo {
  height: 40px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

/* خيارات نوع الدفع (كامل / 1 د.ك) */
.checkout-payment-types {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-type-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #f1f5f9;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.payment-type-card:has(.payment-type-radio:checked) {
  border-color: var(--color-primary);
  background: rgba(26, 54, 93, 0.06);
}

.payment-type-radio {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.payment-type-content {
  flex: 1;
  min-width: 0;
}

.payment-type-title {
  display: block;
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: 6px;
}

.payment-type-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin: 0;
}

/* ملخص الطلب */
.checkout-summary {
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.checkout-summary-block {
  margin-bottom: 12px;
}

.summary-cart-label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.summary-total-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.summary-total-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-text);
}

/* زر متابعة الدفع */
.btn-checkout-submit {
  width: 100%;
  padding: 16px 24px;
  margin-top: 8px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-checkout-submit:hover {
  background: var(--color-primary-light);
}

.btn-checkout-submit:active {
  transform: scale(0.99);
}

/* نافذة الدفع الآمن */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.25s;
}

.modal-overlay.is-open .modal-dialog {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  margin: 0 0 20px 0;
  padding-top: 8px;
}

.modal-body {
  margin-bottom: 20px;
}

.modal-text {
  font-size: 1rem;
  color: var(--color-text);
  margin: 0 0 10px 0;
  line-height: 1.5;
  text-align: center;
}

.modal-text-knet {
  font-weight: 600;
  margin-bottom: 14px;
}

.modal-text-note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.btn-modal-continue {
  width: 100%;
  padding: 14px 24px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-modal-continue:hover {
  background: var(--color-primary-light);
}
