/* ═══════════════════════════════════════════
   Storefront CSS — Arabic RTL E-commerce
   Design: Theme-aware · Mobile-first

   CSS Variables are defined EXCLUSIVELY by the loaded theme CSS.
   Theme CSS is loaded BEFORE this file in header.php.
   Do NOT redefine :root here — it would override the theme.
═══════════════════════════════════════════ */


html { scroll-behavior: smooth; }
body {
  margin: 0; padding: 0;
  font-family: var(--font);
  font-size: 16px; line-height: 1.6;
  color: var(--text); background: var(--bg);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font); cursor: pointer; }

/* ── Layout ── */
.container {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 768px) { .container { padding: 0 24px; } }
@media (min-width: 1024px) { .container { padding: 0 32px; } }

/* ── Header ── */
.sf-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h); background: var(--header-bg, #fff);
  border-bottom: 1px solid var(--header-border, var(--border));
  box-shadow: var(--header-shadow, 0 2px 8px rgba(0,0,0,.04));
}
.sf-header .container {
  height: 100%; display: flex; align-items: center; gap: 16px;
}
.sf-logo {
  font-size: 1.4rem; font-weight: 700; color: var(--primary);
  white-space: nowrap; flex-shrink: 0;
}
.sf-logo span { color: var(--accent); }
.sf-logo img { height: 40px; max-width: 140px; object-fit: contain; }
.sf-search-wrap {
  flex: 1; max-width: 480px;
  position: relative;
}
.sf-search {
  width: 100%; padding: 9px 40px 9px 14px;
  border: 1.5px solid var(--border); border-radius: 24px;
  font-family: var(--font); font-size: .93rem;
  background: var(--bg-soft); color: var(--text);
  outline: none; transition: border-color var(--transition);
}
.sf-search:focus { border-color: var(--primary); background: #fff; }
.sf-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.sf-nav { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.sf-nav a {
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}
.sf-nav a:hover, .sf-nav a.active { color: var(--primary); background: var(--bg-muted); }
.sf-cart-btn {
  position: relative; padding: 8px 16px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 24px;
  font-size: .9rem; font-weight: 600; font-family: var(--font);
  display: flex; align-items: center; gap: 6px;
  transition: background var(--transition);
}
.sf-cart-btn:hover { background: var(--primary-dark); }
.sf-cart-count {
  min-width: 18px; height: 18px;
  background: /*var(--accent)*/#faf9f9; color: #ff0000;
  border-radius: 9px; font-size: .82rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Hero Banner ── */
.sf-hero {
  background: var(--hero-bg, linear-gradient(135deg, #ecfdf5 0%, #d1fae5 40%, #a7f3d0 100%));
  color: var(--hero-text, var(--text));
  padding: 48px 0 40px;
  text-align: center;
}
.sf-hero h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: var(--font-weight-heading, 700); color: var(--hero-text, var(--text)); margin: 0 0 12px; }
.sf-hero p  { font-size: 1rem; color: var(--hero-text, var(--text-muted)); opacity: .8; margin: 0 0 24px; }
.sf-hero .btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; background: var(--btn-primary-bg, var(--primary)); color: var(--btn-primary-color, #fff);
  border-radius: var(--btn-primary-radius, 28px); font-weight: 700; font-size: 1rem;
  border: none; transition: background var(--transition), transform var(--transition);
}
.sf-hero .btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ── Section Titles ── */
.sf-section { padding: 40px 0; }
.sf-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.sf-section-head h2 { font-size: 1.25rem; font-weight: 700; margin: 0; }
.sf-section-head a  { font-size: .88rem; color: var(--primary); font-weight: 600; }

/* ── Category Pills ── */
.category-pills {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.category-pill {
  padding: 7px 16px; border-radius: 20px;
  border: 1.5px solid var(--border); background: #fff;
  font-size: .88rem; font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
  text-decoration: none; display: inline-block;
}
.category-pill:hover, .category-pill.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ── Product Grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
@media (min-width: 768px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
}

.product-card {
  background: var(--card-bg, #fff); border-radius: var(--card-radius, var(--radius-lg));
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  overflow: hidden; cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex; flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--card-hover); transform: translateY(-3px);
}
.product-card-img {
  aspect-ratio: var(--card-img-ratio, 1 / 1); background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  color: var(--text-light); font-size: 2.5rem;
}
.badge-out { position: absolute; top: 8px; right: 8px; }
.badge {
  padding: 3px 10px; border-radius: 12px; font-size: .75rem; font-weight: 700;
}
.badge-red   { background: #fef2f2; color: #dc2626; }
.badge-green { background: #f0fdf4; color: #15803d; }
.badge-orange{ background: #fff7ed; color: #ea580c; }
.product-card-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.product-name { font-weight: 600; font-size: .95rem; color: var(--text); line-height: 1.4; }
.product-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.5; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.product-price-minor { font-size: .82rem; color: var(--text-muted); }
.product-sku   { font-size: .78rem; color: var(--text-light); direction: ltr; text-align: right; }
.product-stock-low    { font-size: .78rem; color: var(--accent); font-weight: 600; }
.product-stock-status { font-size: .78rem; font-weight: 600; }
.product-stock-status.in  { color: #16a34a; }
.product-stock-status.out { color: #dc2626; }

.btn-add-cart {
  width: 100%; padding: 10px; margin-top: auto;
  background: var(--btn-cart-bg, var(--btn-primary-bg, var(--primary)));
  color: var(--btn-cart-color, var(--btn-primary-color, #fff));
  border: none; border-radius: var(--btn-primary-radius, var(--radius-sm));
  font-weight: 700; font-size: .9rem; font-family: var(--font);
  transition: background var(--transition); cursor: pointer;
  min-height: 44px;
}
.btn-add-cart:hover { background: var(--btn-cart-hover, var(--primary-dark)); }
.btn-add-cart:disabled { background: var(--text-light); cursor: not-allowed; }

/* ── Product Detail ── */
.product-detail { padding: 32px 0; }
.product-detail-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 768px) {
  .product-detail-grid { grid-template-columns: 1fr 1fr; }
}
.product-detail-img {
  aspect-ratio: 1; background: var(--bg-soft);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.product-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-info { display: flex; flex-direction: column; gap: 16px; }
.product-detail-price { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.product-detail-desc  { font-size: .95rem; color: var(--text-muted); line-height: 1.7; }
.qty-control {
  display: flex; align-items: center; gap: 0; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; width: fit-content;
}
.qty-btn {
  width: 44px; height: 44px; border: none; background: var(--bg-soft);
  font-size: 1.2rem; font-weight: 700; cursor: pointer; color: var(--text);
  transition: background var(--transition);
}
.qty-btn:hover { background: var(--primary-light); }
.qty-display {
  min-width: 56px; height: 44px; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 1rem;
  border-right: 1.5px solid var(--border); border-left: 1.5px solid var(--border);
}
.btn-checkout {
  width: 100%; padding: 14px; border: none; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font-size: 1.05rem;
  font-weight: 700; font-family: var(--font); cursor: pointer;
  transition: background var(--transition); min-height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-checkout:hover { background: var(--primary-dark); }
.btn-whatsapp {
  width: 100%; padding: 13px; border: 2px solid var(--whatsapp);
  border-radius: var(--radius-sm); background: #fff; color: var(--whatsapp);
  font-size: 1rem; font-weight: 700; font-family: var(--font); cursor: pointer;
  transition: all var(--transition); min-height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-whatsapp:hover { background: var(--whatsapp); color: #fff; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: .85rem; color: var(--text-muted); padding: 12px 0 20px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb .sep { color: var(--text-light); }

/* ── Cart Modal ── */
.cart-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 200;
  align-items: flex-start; justify-content: flex-end;
}
.cart-overlay.open { display: flex; }
.cart-panel {
  width: 100%; max-width: 420px; height: 100vh;
  background: #fff; overflow-y: auto;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
}
.cart-head {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.cart-head h2 { margin: 0; font-size: 1.1rem; }
.cart-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); padding: 4px 8px; }
.cart-items { flex: 1; padding: 16px; overflow-y: auto; }
.cart-item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border); align-items: flex-start;
}
.cart-item-img {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  background: var(--bg-soft); flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: .9rem; line-height: 1.4; }
.cart-item-price { font-size: .88rem; color: var(--primary); font-weight: 700; margin-top: 4px; }
.cart-item-remove { color: var(--text-light); font-size: .8rem; cursor: pointer; background: none; border: none; padding: 2px 6px; margin-top: 6px; }
.cart-item-remove:hover { color: #dc2626; }
.cart-item-qty { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cart-item-qty button { width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-soft); cursor: pointer; font-weight: 700; font-size: .9rem; }
.cart-item-qty span { font-weight: 600; min-width: 24px; text-align: center; }
.cart-footer {
  padding: 16px 20px; border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.cart-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.05rem; margin-bottom: 14px; }
.cart-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* ── Checkout Form ── */
.checkout-section { padding: 32px 0 48px; }
.checkout-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr 380px; }
}
.form-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.form-card h3 { margin: 0 0 20px; font-size: 1rem; font-weight: 700; color: var(--text); }
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block; font-weight: 600; font-size: .88rem;
  color: var(--text); margin-bottom: 6px;
}
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: .93rem; color: var(--text);
  background: #fff; outline: none; box-sizing: border-box;
  transition: border-color var(--transition);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--primary);
}
.form-field .field-error {
  font-size: .78rem; color: #dc2626; margin-top: 4px; display: none;
}
.form-field.has-error input, .form-field.has-error select {
  border-color: #dc2626;
}
.form-field.has-error .field-error { display: block; }
.form-field small { font-size: .78rem; color: var(--text-light); margin-top: 3px; display: block; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shipping-info {
  background: var(--bg-muted); border-radius: var(--radius-sm);
  padding: 12px; font-size: .88rem; color: var(--text-muted); margin-top: 8px;
}
.shipping-info strong { color: var(--primary); }

/* Order summary */
.order-summary { position: sticky; top: calc(var(--header-h) + 16px); }
.summary-item { display: flex; justify-content: space-between; padding: 8px 0; font-size: .92rem; }
.summary-item.total { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--border); padding-top: 14px; margin-top: 6px; }
.summary-item.shipping-free strong { color: var(--primary); }
.summary-cart-items { border-bottom: 1px solid var(--border); margin-bottom: 12px; padding-bottom: 12px; }
.summary-cart-item { display: flex; justify-content: space-between; font-size: .85rem; color: var(--text-muted); padding: 3px 0; }

/* ── Order Tracking ── */
.tracking-section { max-width: 640px; margin: 0 auto; padding: 48px 16px; }
.tracking-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; margin-top: 24px;
}
.tracking-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px; border-radius: 24px; font-weight: 700;
  font-size: 1rem; margin-bottom: 20px;
}
.tracking-timeline { list-style: none; padding: 0; margin: 0; }
.tracking-timeline li {
  display: flex; gap: 14px; padding-bottom: 20px; position: relative;
}
.tracking-timeline li::before {
  content: ''; position: absolute; right: 8px; top: 22px;
  width: 2px; height: calc(100% - 22px); background: var(--border);
}
.tracking-timeline li:last-child::before { display: none; }
.timeline-dot {
  width: 18px; height: 18px; border-radius: 50%; background: var(--border);
  flex-shrink: 0; margin-top: 2px; position: relative; z-index: 1;
  border: 2px solid #fff; box-shadow: 0 0 0 2px var(--border);
}
.timeline-dot.done { background: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.timeline-dot.current { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); animation: pulse 1.5s infinite; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 2px var(--accent-light); }
  50%      { box-shadow: 0 0 0 5px rgba(234,88,12,.15); }
}
.tracking-items { margin-top: 20px; }
.tracking-item-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.tracking-totals { margin-top: 16px; }
.tracking-total-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .9rem; }
.tracking-total-row.grand { font-weight: 700; font-size: 1rem; border-top: 2px solid var(--border); padding-top: 10px; margin-top: 4px; }

/* ── Page Content (Builder output) ── */
.page-section { padding: 40px 0; }
.page-section.bg-light       { background: var(--bg-soft); }
.page-section.bg-purple-light { background: #faf5ff; }
.page-section.bg-dark         { background: #1e1b4b; color: #fff; }
.page-section.pad-none   { padding: 0; }
.page-section.pad-small  { padding: 20px 0; }
.page-section.pad-large  { padding: 80px 0; }
.page-cols { display: flex; gap: 24px; flex-wrap: wrap; }
.page-cols .page-col { flex: 1; min-width: 240px; }
.page-elem-heading  { font-size: 1.8rem; font-weight: 700; margin: .4em 0; }
.page-elem-para     { font-size: 1rem; line-height: 1.7; margin: .6em 0; color: var(--text-muted); }
.page-elem-img      { width: 100%; border-radius: var(--radius); margin: 12px 0; }
.page-elem-btn      {
  display: inline-block; padding: 11px 26px;
  border-radius: 28px; background: var(--primary); color: #fff;
  font-weight: 700; font-size: .97rem; text-decoration: none;
  transition: background var(--transition);
}
.page-elem-btn:hover { background: var(--primary-dark); }
.page-elem-btn.outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.page-elem-btn.outline:hover { background: var(--primary); color: #fff; }
.page-elem-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.page-elem-spacer  { display: block; }
.page-store-block  {
  background: var(--bg-muted); border-radius: var(--radius);
  padding: 16px 20px; margin: 12px 0; color: var(--text-muted); font-size: .9rem;
  border: 1px dashed var(--border);
}

/* ── Store Elements (Page Builder rendered) ── */
.se-wrap       { margin: 12px 0; }
.se-head       { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; gap:12px; }
.se-title      { font-size:1.3rem; font-weight:700; color:var(--text); margin:0; }
.se-view-all   { font-size:.85rem; color:var(--primary); font-weight:600; white-space:nowrap; }
.se-view-all:hover { text-decoration:underline; }

/* Loading / error states */
.se-loading { display:flex; align-items:center; gap:10px; color:var(--text-muted); font-size:.9rem; padding:20px 0; }
.se-loading .spinner { width:20px; height:20px; border:2px solid var(--border); border-top-color:var(--primary); border-radius:50%; animation:spin .7s linear infinite; }
.se-error   { background:#fef2f2; border:1px solid #fca5a5; border-radius:var(--radius); padding:14px 18px; color:#dc2626; font-size:.9rem; }

/* Products / Product Grid */
.se-products-grid {
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:14px;
}
@media (min-width:640px)  { .se-products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width:1024px) { .se-products-grid { grid-template-columns: repeat(4, 1fr); gap:20px; } }

/* Categories */
.se-categories-grid {
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:12px;
}
@media (min-width:480px)  { .se-categories-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width:768px)  { .se-categories-grid { grid-template-columns: repeat(4, 1fr); gap:16px; } }
@media (min-width:1024px) { .se-categories-grid { grid-template-columns: repeat(6, 1fr); } }

.se-cat-card {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:8px; padding:18px 10px;
  background:var(--bg-soft); border:1px solid var(--border);
  border-radius:var(--card-radius); text-align:center;
  transition:border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  min-height:80px; text-decoration:none; color:var(--text);
}
.se-cat-card:hover { border-color:var(--primary); box-shadow:var(--card-shadow); transform:translateY(-2px); }
.se-cat-name  { font-size:.88rem; font-weight:700; color:var(--text); }
.se-cat-count { font-size:.75rem; color:var(--text-muted); }

/* Offers */
.se-offers-grid {
  display:grid;
  grid-template-columns: repeat(1, 1fr);
  gap:14px;
}
@media (min-width:560px)  { .se-offers-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width:1024px) { .se-offers-grid { grid-template-columns: repeat(3, 1fr); gap:20px; } }

.se-offer-card {
  background:var(--bg-soft); border:1px solid var(--border);
  border-radius:var(--card-radius); overflow:hidden;
  box-shadow:var(--card-shadow);
  transition:transform var(--transition), box-shadow var(--transition);
  cursor:pointer;
}
.se-offer-card:hover { transform:translateY(-3px); box-shadow:var(--card-hover); }
.se-offer-img  {
  aspect-ratio:16/9; overflow:hidden; background:var(--bg-soft);
  display:flex; align-items:center; justify-content:center; position:relative;
}
.se-offer-img img { width:100%; height:100%; object-fit:cover; }
.se-offer-img-placeholder { font-size:2.5rem; color:var(--text-muted); }
.se-offer-badge {
  position:absolute; top:10px; right:10px;
  background:var(--accent); color:#fff;
  font-size:.78rem; font-weight:800; padding:4px 10px;
  border-radius:20px; z-index:2;
}
.se-offer-body   { padding:14px 16px; }
.se-offer-name   { font-size:.95rem; font-weight:700; color:var(--text); margin:0 0 8px; line-height:1.4; }
.se-offer-prices { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.se-offer-price-now  { font-size:1.05rem; font-weight:800; color:var(--primary); }
.se-offer-price-was  { font-size:.82rem; color:var(--text-muted); text-decoration:line-through; }
.se-offer-countdown  { font-size:.78rem; color:var(--accent); font-weight:600; margin-bottom:10px; display:flex; align-items:center; gap:4px; }
.se-offer-btn {
  display:block; width:100%; padding:9px; text-align:center;
  background:var(--btn-cart-bg, var(--primary)); color:var(--btn-cart-color,#fff);
  border:none; border-radius:var(--btn-primary-radius, var(--radius));
  font-weight:700; font-size:.88rem; font-family:var(--font);
  cursor:pointer; transition:opacity var(--transition);
}
.se-offer-btn:hover { opacity:.88; }


/* ── States ── */
.state-loading { text-align: center; padding: 48px 20px; }
.spinner {
  width: 40px; height: 40px; border: 4px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .9s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.state-empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.state-empty svg { margin: 0 auto 16px; opacity: .4; }
.state-error { text-align: center; padding: 48px 20px; color: #dc2626; }
.state-error button { margin-top: 14px; padding: 9px 22px; border-radius: 24px; background: var(--primary); color: #fff; border: none; font-weight: 700; font-family: var(--font); cursor: pointer; }

/* ── Toast ── */
#sf-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(24px);
  background: #111827; color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: .9rem; font-weight: 600; z-index: 999;
  transition: transform .22s ease, opacity .22s ease; opacity: 0;
  pointer-events: none; white-space: nowrap; max-width: 90vw;
  text-align: center;
}
#sf-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#sf-toast.success { background: #15803d; }
#sf-toast.error   { background: #dc2626; }

/* ── WhatsApp Float ── */
.wa-float {
  position: fixed; bottom: 20px; left: 20px; z-index: 150;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--whatsapp); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,.4);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.wa-float:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(37,211,102,.5); }
.wa-float svg { width: 28px; height: 28px; }

/* ── Footer ── */
.sf-footer {
  background: #111827; color: #9ca3af; padding: 40px 0 24px;
  margin-top: 48px;
}
.sf-footer-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 32px; margin-bottom: 32px;
}
@media (min-width: 640px) { .sf-footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .sf-footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand { font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 8px; }
.footer-desc  { font-size: .88rem; line-height: 1.6; }
.footer-col h4 { font-size: .9rem; font-weight: 700; color: #fff; margin: 0 0 12px; }
.footer-col a  { display: block; font-size: .88rem; color: #9ca3af; padding: 4px 0; }
.footer-col a:hover { color: var(--primary-light); }
.footer-bottom {
  border-top: 1px solid #1f2937; padding-top: 20px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; font-size: .82rem;
}

/* ── Mobile Bottom Nav ── */
.sf-bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: #fff; border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}
@media (max-width: 767px) { .sf-bottom-nav { display: flex; } }
.sf-bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 6px 0; font-size: .7rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  min-height: 48px; justify-content: center;
  transition: color var(--transition);
}
.sf-bottom-nav a.active, .sf-bottom-nav a:hover { color: var(--primary); }
.sf-bottom-nav svg { width: 22px; height: 22px; }
body { padding-bottom: 72px; }
@media (min-width: 768px) { body { padding-bottom: 0; } }

/* ── Responsive ── */
@media (max-width: 767px) {
  .sf-nav { display: none; }
  .sf-hero { padding: 32px 0 28px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .checkout-grid { grid-template-columns: 1fr; }
  .form-2col { grid-template-columns: 1fr; }
  .order-summary { position: static; }

  /* ── Compact mobile header ── */
  .sf-header { height: auto; }
  .sf-header .container {
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      'logo cart'
      'search search';
    align-items: center;
    gap: 6px 10px;
    padding: 6px 12px 8px;
  }
  .sf-logo {
    grid-area: logo;
    display: flex; align-items: center;
    min-height: 36px; font-size: 1.05rem;
  }
  .sf-logo img { height: 30px; max-width: 120px; }
  .sf-cart-btn {
    grid-area: cart;
    height: 36px; padding: 0 12px;
    font-size: .85rem; gap: 5px;
    align-self: center;
  }
  /* Cart badge */
  .sf-cart-count {
    min-width: 20px; height: 20px;
    background: #fff; color: var(--primary);
    border-radius: 10px; font-size: .8rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1;
  }
  .sf-search-wrap {
    grid-area: search;
    max-width: none;
    width: 100%;
  }
  .sf-search {
    padding: 7px 36px 7px 12px; font-size: .88rem;
    height: 36px; box-sizing: border-box;
    width: 100%;
  }
  .sf-search-icon { left: 10px; pointer-events: auto; cursor: pointer; }
}

/* ── 360px و 390px: ضبط إضافي للشاشات الضيقة جداً ── */
@media (max-width: 390px) {
  .sf-header .container { gap: 5px 8px; padding: 5px 10px 7px; }
  .sf-logo { font-size: .95rem; min-height: 34px; }
  .sf-logo img { height: 26px; max-width: 100px; }
  .sf-cart-btn { height: 34px; padding: 0 10px; font-size: .8rem; }
  .sf-search { height: 34px; font-size: .84rem; }
}
@media (min-width: 768px) {
  .sf-bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

/* Focus rings */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
