:root{--bg:#071c22;--primary:#0f766e;--primary-2:#14b8a6;--accent:#f59e0b;--accent-2:#f97316;--text:#f8fafc;--text-dark:#102027;--muted:#a8c5c9;--card:#fff;--border:rgba(255,255,255,.14);--border-dark:#e5e7eb;--danger:#dc2626}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100vh;overflow:hidden;direction:rtl;font-family:Tajawal,Arial,Tahoma,sans-serif;background:radial-gradient(circle at 15% 5%,rgba(245,158,11,.14),transparent 30%),radial-gradient(circle at 85% 10%,rgba(20,184,166,.18),transparent 34%),linear-gradient(145deg,var(--bg) 0%,#061318 55%,#020617 100%);color:var(--text)}button,input,select,textarea{font-family:inherit}button{cursor:pointer}.app-shell{height:100vh;overflow:hidden;display:flex;flex-direction:column}.main-scroll{flex:1;overflow-y:auto;padding:16px;padding-bottom:90px;scroll-behavior:smooth}.nav{flex:0 0 auto;z-index:60;display:flex;justify-content:flex-start;align-items:center;gap:12px;margin:10px 16px 0;padding:12px 14px;border:1px solid var(--border);border-radius:28px;background:rgba(7,28,34,.9);backdrop-filter:blur(18px);box-shadow:0 18px 50px rgba(0,0,0,.24);direction:ltr}.brand{display:flex;align-items:center;gap:12px;min-width:0;order:3;margin-left:auto;direction:rtl}.logo{width:58px;height:58px;flex:0 0 58px;border-radius:20px;overflow:hidden;display:grid;place-items:center;background:linear-gradient(135deg,rgba(245,158,11,.95),rgba(20,184,166,.95));color:#fff;font-size:28px;font-weight:900;border:1px solid rgba(255,255,255,.22)}.logo img{width:100%;height:100%;object-fit:cover}.brand h1{margin:0;font-size:23px;font-weight:900}.brand p{margin:4px 0 0;color:var(--muted);font-size:13px}.nav-pills{display:flex;align-items:center;flex-wrap:wrap;gap:8px;order:2;direction:rtl}.pill,.cart-top-btn{display:inline-flex;align-items:center;gap:6px;padding:9px 12px;border-radius:999px;color:#ecfeff;font-size:13px;font-weight:900;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.13);box-shadow:none}.hero{overflow:hidden;margin:18px auto;max-width:1280px;padding:42px;border-radius:36px;border:1px solid var(--border);background:radial-gradient(circle at 15% 18%,rgba(255,255,255,.18),transparent 28%),radial-gradient(circle at 86% 18%,rgba(245,158,11,.24),transparent 24%),linear-gradient(135deg,#092830 0%,#0f3a42 45%,#0f766e 100%);box-shadow:0 22px 60px rgba(0,0,0,.28)}.hero h2{margin:0 0 10px;font-size:clamp(32px,6vw,56px);font-weight:900}.hero p{max-width:790px;margin:0 0 16px;color:#d6f4f4;font-size:18px;line-height:1.9}.tag{display:inline-flex;margin:4px;padding:9px 13px;border-radius:999px;color:#fff;font-size:13px;font-weight:900;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.18)}.toolbar{max-width:1280px;margin:18px auto;display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,auto);gap:10px}.toolbar button{display:none!important}input,select,textarea{width:100%;outline:none;border:1px solid rgba(255,255,255,.16);border-radius:18px;background:#fff;color:var(--text-dark);padding:13px 14px;font-size:15px}textarea{min-height:90px;resize:vertical;line-height:1.8;margin-top:10px}input:focus,select:focus,textarea:focus{border-color:var(--primary-2);box-shadow:0 0 0 4px rgba(20,184,166,.16)}button{border:0;border-radius:18px;padding:12px 16px;min-height:45px;color:#fff;font-weight:900;background:linear-gradient(135deg,var(--primary),var(--primary-2));box-shadow:0 12px 28px rgba(20,184,166,.2);transition:transform .16s ease,box-shadow .16s ease}button:hover{transform:translateY(-1px);box-shadow:0 16px 34px rgba(20,184,166,.26)}button.secondary{background:#334155}button.danger{background:var(--danger)}button.orange{background:linear-gradient(135deg,var(--accent),var(--accent-2))}button.full{width:100%}.grid{max-width:1280px;margin:0 auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.card{display:flex;flex-direction:column;overflow:hidden;padding:12px;min-height:100%;border-radius:28px;color:var(--text-dark);background:var(--card);border:1px solid var(--border-dark);box-shadow:0 16px 42px rgba(0,0,0,.2);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.card:hover{transform:translateY(-5px);border-color:var(--primary-2);box-shadow:0 24px 56px rgba(0,0,0,.25)}.img-skeleton{width:100%;height:230px;border-radius:22px;background:linear-gradient(90deg,#0f172a 25%,#16434b 50%,#0f172a 75%);background-size:200% 100%;animation:shimmer 1.4s infinite;display:grid;place-items:center;overflow:hidden}.card-img{width:100%;height:230px;object-fit:contain;padding:10px;border-radius:22px;background:radial-gradient(circle at center,#12343b,#020617);opacity:0;transition:opacity .35s ease}.card-img.loaded{opacity:1}@keyframes shimmer{to{background-position:-200% 0}}.card h3{min-height:58px;margin:13px 0 8px;color:#0f172a;font-size:16px;line-height:1.65;font-weight:900}.price{color:var(--primary);font-size:25px;font-weight:900;margin:4px 0}.old{display:inline-block;margin-right:8px;color:#64748b;font-size:15px;text-decoration:line-through;font-weight:800}.badge{display:inline-flex;align-items:center;width:fit-content;margin:6px 0 12px;padding:6px 10px;border-radius:999px;color:#047857;background:#ecfdf5;border:1px solid #a7f3d0;font-size:12px;font-weight:900}.actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:auto}.load-more-wrap{max-width:1280px;margin:18px auto;text-align:center}.cart-drawer{position:fixed;top:12px;left:12px;bottom:12px;width:min(460px,calc(100vw - 24px));z-index:5000;overflow-y:auto;background:rgba(7,28,34,.98);border:1px solid rgba(255,255,255,.18);border-radius:28px;padding:18px;box-shadow:0 30px 80px rgba(0,0,0,.45)}.drawer-overlay{position:fixed;inset:0;z-index:4999;background:rgba(0,0,0,.35);backdrop-filter:blur(2px)}.drawer-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.drawer-head h2{margin:0;font-size:20px}.drawer-close{width:42px;height:42px;padding:0}.cart-list{display:grid;gap:10px}.cart-item{display:grid;grid-template-columns:72px 1fr auto;gap:12px;align-items:center;padding:12px;border-radius:20px;background:#fff;color:var(--text-dark);border:1px solid var(--border-dark)}.cart-thumb{width:72px;height:72px;object-fit:contain;border-radius:16px;background:#0f172a;padding:5px}.qty-controls{display:flex;gap:6px;align-items:center;margin-top:6px}.qty-controls button{min-height:32px;padding:4px 10px;border-radius:12px}.checkout{display:grid;grid-template-columns:1fr 1fr;gap:10px}.total{margin:14px 0;padding:16px;border-radius:22px;color:white;line-height:2;background:#020617;border:1px solid rgba(255,255,255,.12)}.total b{color:var(--accent)}.checkout-sticky-summary{position:sticky;top:0;z-index:40}.notice{padding:15px;border-radius:20px;color:#0f172a;background:#f8fafc;border:1px solid #e2e8f0;line-height:1.8}.product-modal{position:fixed;inset:0;z-index:6000;background:rgba(0,0,0,.42);backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center;padding:14px}.product-modal-card{width:min(1120px,96vw);max-height:92vh;overflow-y:auto;padding:20px;border-radius:30px;background:rgba(7,28,34,.98);border:1px solid rgba(255,255,255,.16);box-shadow:0 30px 90px rgba(0,0,0,.45)}.modal-layout{display:grid;grid-template-columns:1.1fr 1fr;gap:18px}.modal-info{padding:8px}.modal-info h2{margin:0 0 12px;font-size:clamp(26px,4vw,40px)}.desc{color:#d9f3f4;line-height:2;white-space:pre-wrap;font-size:16px;margin-top:12px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.10);padding:14px;border-radius:18px}.swiper-box{height:540px;overflow:hidden;border-radius:32px;background:#020617;border:1px solid rgba(255,255,255,.12);box-shadow:0 22px 54px rgba(0,0,0,.28)}.swiper,.swiper-slide{width:100%;height:100%}.swiper-slide{display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at center,#12343b,#020617)}.swiper-slide img{width:100%;height:100%;object-fit:contain;padding:12px}.modal{position:fixed;inset:0;z-index:7000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(0,0,0,.38);backdrop-filter:blur(2px)}.hidden{display:none!important}.modal-card{position:relative;width:min(790px,96vw);max-height:86vh;overflow:auto;padding:24px;border-radius:30px;background:white;color:#0f172a;line-height:1.9;box-shadow:0 30px 90px rgba(0,0,0,.4)}.modal-card h1,.modal-card h2,.modal-card h3,.modal-card p,.modal-card li{color:#0f172a}.modal-close{position:sticky;top:0;float:left;width:40px;height:40px;padding:0;background:var(--danger);z-index:3}.toast{position:fixed;top:18px;bottom:auto;right:50%;transform:translateX(50%);z-index:9999;padding:14px 18px;border-radius:19px;color:white;font-weight:900;background:#052e2b;border:1px solid rgba(94,234,212,.35);box-shadow:0 18px 44px rgba(0,0,0,.32);max-width:92vw;min-width:260px;text-align:center}.toast-success{background:#065f46!important;border-color:rgba(16,185,129,.55)!important}.toast-error{background:#7f1d1d!important;border-color:rgba(248,113,113,.55)!important}.toast-info{background:#052e2b!important;border-color:rgba(94,234,212,.35)!important}.footer{max-width:1280px;margin:28px auto;text-align:center;color:#cbd5e1}.footer button{margin:5px;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.12)}@media(max-width:1050px){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}.modal-layout{grid-template-columns:1fr}.swiper-box{height:470px}}@media(max-width:780px){.main-scroll{padding:10px;padding-bottom:80px}.nav{margin:8px;position:static;align-items:flex-start;display:grid;grid-template-columns:1fr 1fr;gap:8px;direction:rtl}.brand{grid-column:1/-1;width:100%;order:initial;margin-left:0;direction:rtl}.nav-pills{grid-column:1/2;width:100%;display:flex;flex-wrap:nowrap;order:initial;direction:rtl}.nav-return-btn{grid-column:2/3;width:100%!important;min-width:0;justify-content:center;text-align:center;font-size:13px;padding:9px 8px;white-space:nowrap;order:initial;direction:rtl}.pill,.cart-top-btn{flex:1;justify-content:center}.cart-top-btn{width:100%!important;min-width:0;font-size:13px;padding:9px 8px;white-space:nowrap}.hero{padding:30px 22px;border-radius:28px}.toolbar{grid-template-columns:minmax(0,68%) minmax(110px,32%);align-items:center}.toolbar input{grid-column:1/2}.toolbar select{grid-column:2/3}.toolbar button{display:none!important}.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.img-skeleton,.card-img{height:190px}.checkout{grid-template-columns:1fr}.actions{grid-template-columns:1fr 1fr!important;gap:8px!important}.actions button,.details-btn,.add-cart-btn{width:100%!important;min-width:0!important;font-size:13px!important;padding:10px 8px!important;white-space:nowrap!important}.swiper-box{height:400px}.cart-item{grid-template-columns:64px 1fr}.cart-item>button{grid-column:1/-1}}@media(max-width:480px){.brand h1{font-size:20px}.brand p{font-size:12px}.grid{grid-template-columns:1fr}.img-skeleton,.card-img{height:250px}.swiper-box{height:350px}button{width:100%}}

/* =========================================================
   FINAL MODAL VISIBILITY + SCROLL FIX
   مهم: هذا البلوك يجب أن يكون آخر ملف style.css
   ========================================================= */

/* أهم سطر: يخفي النافذة حتى لو كانت product-modal فيها display:flex */
.hidden,
.product-modal.hidden,
.modal.hidden,
.cart-drawer.hidden,
.drawer-overlay.hidden,
.toast.hidden {
  display: none !important;
}

/* تظهر نافذة المنتج فقط عندما لا تحتوي hidden */
.product-modal:not(.hidden) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ضبط طبقة نافذة المنتج بدون إجبارها على الظهور */
.product-modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 6000 !important;
  padding: 12px !important;
  overflow: hidden !important;
  background: rgba(0,0,0,.42) !important;
  backdrop-filter: blur(3px) !important;
}

/* الكرت هو الذي يعمل له السكرول */
.product-modal-card {
  width: min(1120px, calc(100vw - 24px)) !important;
  max-height: calc(100dvh - 24px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  margin: auto !important;
}

/* أثناء فتح نافذة المنتج لا يتحرك المتجر في الخلفية */
body.modal-open .main-scroll {
  overflow: hidden !important;
}

/* الإشعار أعلى الشاشة وواضح على الهاتف */
.toast {
  position: fixed !important;
  top: calc(14px + env(safe-area-inset-top, 0px)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: 999999 !important;
  width: min(520px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  min-width: 0 !important;
  text-align: center !important;
  white-space: normal !important;
  line-height: 1.7 !important;
}

@media (max-width: 780px) {
  .product-modal {
    padding: 6px !important;
  }

  .product-modal-card {
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    max-height: calc(100dvh - 12px) !important;
    padding: 12px !important;
    border-radius: 24px !important;
  }

  .modal-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .swiper-box {
    height: 36dvh !important;
    min-height: 220px !important;
    max-height: 340px !important;
    flex: 0 0 auto !important;
  }

  .modal-info h2 {
    font-size: 25px !important;
    line-height: 1.45 !important;
    margin-bottom: 8px !important;
  }

  .modal-close {
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
  }

  .toast {
    top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    width: calc(100vw - 18px) !important;
    max-width: calc(100vw - 18px) !important;
    font-size: 14px !important;
    padding: 12px 14px !important;
    border-radius: 16px !important;
  }
}

@media (max-width: 480px) {
  .swiper-box {
    height: 32dvh !important;
    min-height: 205px !important;
  }
}

/* =========================================================
   Occasion Banner + modal add button improvement
   ========================================================= */
.occasion-banner {
  position: relative;
  max-width: 1280px;
  margin: 16px auto;
  overflow: hidden;
  border-radius: 30px;
  padding: 24px;
  border: 1px solid rgba(245, 158, 11, .30);
  background:
    radial-gradient(circle at 12% 20%, rgba(245,158,11,.28), transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(20,184,166,.25), transparent 28%),
    linear-gradient(135deg, rgba(15,118,110,.86), rgba(2,6,23,.92));
  box-shadow: 0 22px 55px rgba(0,0,0,.24);
}

.occasion-shine {
  position: absolute;
  inset: -60px;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.12), transparent);
  transform: rotate(8deg);
  pointer-events: none;
}

.occasion-content {
  position: relative;
  z-index: 1;
}

.occasion-badge {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(245,158,11,.20);
  color: #fde68a;
  border: 1px solid rgba(245,158,11,.35);
  font-weight: 900;
  margin-bottom: 10px;
}

.occasion-banner h2 {
  margin: 0 0 8px;
  color: white;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 900;
}

.occasion-banner p {
  margin: 0;
  color: #e0f2fe;
  font-size: 17px;
  line-height: 1.9;
}

.modal-add-top {
  margin: 10px 0 14px !important;
  box-shadow: 0 16px 36px rgba(249,115,22,.25) !important;
}



.stock-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .92);
  color: white;
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}

.product-card {
  position: relative;
}


/* Stock and out-of-stock badges */
.stock-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .94);
  color: white;
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}

.stock-badge.stock-out,
.out-stock-ribbon {
  background: rgba(220, 38, 38, .96) !important;
  color: white !important;
}

.out-stock-ribbon {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 7;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
}

.out-of-stock-card {
  filter: grayscale(.35);
  opacity: .82;
}

.disabled-btn,
button:disabled {
  opacity: .55 !important;
  cursor: not-allowed !important;
  filter: grayscale(.25);
}

.product-card {
  position: relative;
}


/* =========================================================
   Product stock / out-of-stock final fix
   ========================================================= */
.product-card {
  position: relative;
}

.product-image-wrap {
  position: relative;
}

.stock-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 8;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .94);
  color: white;
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}

.stock-badge.stock-out {
  background: rgba(220, 38, 38, .96) !important;
}

.out-of-stock-card {
  filter: grayscale(.30);
  opacity: .82;
}

.disabled-btn,
button:disabled {
  opacity: .55 !important;
  cursor: not-allowed !important;
  filter: grayscale(.25);
}

/* Admin final alignment */
[data-testid="InputInstructions"],
div[data-testid="InputInstructions"] {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  visibility: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

div[data-testid="column"] .stButton button,
div[data-testid="column"] button {
  min-height: 46px !important;
}

div[data-testid="column"] .stTextInput input,
div[data-testid="column"] .stNumberInput input {
  min-height: 46px !important;
}


/* Final admin and store interaction fixes */
.product-card button,
.cart-btn,
#cartBtn {
  pointer-events: auto !important;
}

button[disabled] {
  pointer-events: auto;
}

div[data-testid="column"] .stButton button,
div[data-testid="column"] button {
  min-height: 46px !important;
  width: 100% !important;
}

div[data-testid="column"] .stTextInput input,
div[data-testid="column"] .stNumberInput input {
  min-height: 46px !important;
}

[data-testid="InputInstructions"] {
  display: none !important;
}

/* =========================================================
   Canonical Streamlit component sizing and hidden states
   ========================================================= */
html,
body {
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.app-shell {
  height: 100vh;
}

.hidden,
.product-modal.hidden,
.modal.hidden,
.cart-drawer.hidden,
.drawer-overlay.hidden,
.toast.hidden {
  display: none !important;
}



/* Cart fallback styles */
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(20,184,166,.28);
  color: #ecfeff;
  margin-bottom: 10px;
}

.cart-item-img img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
}

.cart-item-info {
  display: grid;
  gap: 6px;
  color: #ecfeff;
}

.cart-item-info b {
  color: #ecfeff !important;
  font-weight: 900 !important;
  font-size: 15.5px !important;
  line-height: 1.7 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

.cart-item-info > span {
  color: #fbbf24 !important;
  font-weight: 900 !important;
  line-height: 1.6 !important;
}

.cart-qty {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
  margin-top: 4px;
}

.cart-qty button {
  border: none;
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
  box-shadow: 0 8px 18px rgba(20,184,166,.18) !important;
}

.danger-mini {
  border: none;
  width: auto !important;
  min-width: 72px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 12px !important;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
  flex: 0 0 auto;
  background: rgba(239,68,68,.18) !important;
  color: #fecaca !important;
  box-shadow: none !important;
}

.empty-cart {
  padding: 18px;
  border-radius: 18px;
  text-align: center;
  background: rgba(255,255,255,.06);
  color: #ecfeff;
  font-weight: 900;
}


/* ملاحظة تحذيرية مهمة في نهاية السلة */
.important-cart-warning {
  margin: 14px 0 10px;
  padding: 16px 17px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 45%, #fee2e2 100%);
  border: 2px solid #ef4444;
  color: #7f1d1d;
  box-shadow: 0 14px 34px rgba(239, 68, 68, .22);
  line-height: 2;
}

.important-cart-warning .warning-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(220, 38, 38, .25);
}

.important-cart-warning .warning-body {
  font-size: 15.5px;
  font-weight: 800;
  color: #7f1d1d;
}

.important-cart-warning .warning-body b {
  color: #991b1b;
  font-weight: 900;
}

@media (max-width: 480px) {
  .important-cart-warning {
    padding: 14px;
    border-radius: 18px;
  }

  .important-cart-warning .warning-title {
    font-size: 16px;
  }

  .important-cart-warning .warning-body {
    font-size: 14.5px;
  }

  .cart-qty {
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .cart-qty button {
    width: 42px !important;
    min-width: 42px !important;
    height: 40px !important;
    min-height: 40px !important;
    flex-basis: 42px;
  }

  .cart-qty span {
    width: 38px;
    min-width: 38px;
    height: 40px;
  }

  .danger-mini {
    min-width: 76px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 12px !important;
  }
}


/* =========================================================
   Speed improvements: GPU animation hints + lazy image fade
   ========================================================= */
.card,
.product-card,
.cart-drawer {
  will-change: transform;
}

.card-img {
  opacity: 0;
  transition: opacity .25s ease;
}

.card-img.loaded {
  opacity: 1;
}

.img-skeleton {
  position: relative;
  overflow: hidden;
}


/* تحسين وضوح رقم الكمية داخل السلة */
.cart-qty span {
  color: #ffffff !important;
  font-weight: 900 !important;
  font-size: 18px !important;
  width: 36px;
  min-width: 36px;
  height: 38px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(2, 6, 23, .55);
  border: 1px solid rgba(251, 191, 36, .35);
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

.cart-qty button {
  color: #ffffff !important;
  font-weight: 900 !important;
}

.details-btn,
.add-cart-btn {
  cursor: pointer;
}



/* Return request modal */
.nav-return-btn {
  order: 1;
  direction: rtl;
  border: 1px solid rgba(20, 184, 166, .35);
  background: rgba(20, 184, 166, .16);
  color: #ecfeff;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 900;
  cursor: pointer;
}

.return-modal-content {
  max-width: 620px;
  width: min(92vw, 620px);
}

.return-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.form-input {
  width: 100%;
  border: 1px solid rgba(20, 184, 166, .35);
  background: rgba(255,255,255,.96);
  color: #0f172a;
  border-radius: 18px;
  padding: 13px 15px;
  font-size: 15px;
  font-weight: 700;
  outline: none;
}

.form-input:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20,184,166,.18);
}

.return-policy-toggle {
  width: 100%;
  margin: 10px 0;
}

.return-policy-box {
  border: 1px solid rgba(245, 158, 11, .35);
  background: rgba(255, 247, 237, .95);
  color: #7c2d12;
  border-radius: 18px;
  padding: 13px;
  line-height: 1.9;
  font-weight: 800;
}

/* GPU acceleration */
.product-card,
.card,
.cart-drawer {
  will-change: transform;
}

.image-error {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: #94a3b8;
  font-weight: 900;
  background: rgba(15,23,42,.35);
}


/* Final return modal scrolling */
.return-modal-content {
  max-width: 620px !important;
  width: min(92vw, 620px) !important;
  max-height: 85vh !important;
  overflow-y: auto !important;
  padding: 20px !important;
  box-sizing: border-box !important;
}

body.modal-open {
  overflow: hidden;
}


/* Clean overlay state: prevents repeated fade after order rerun */
.hidden,
.product-modal.hidden,
.modal.hidden,
.cart-drawer.hidden,
.drawer-overlay.hidden,
.toast.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.drawer-overlay.hidden,
.modal.hidden {
  visibility: hidden !important;
}

body:not(.cart-open) .drawer-overlay {
  pointer-events: none;
}

body:not(.modal-open) .modal:not(.return-modal-content) {
  pointer-events: none;
}


/* Return/replace confirmation modal */
.return-confirm-card {
  max-width: 680px;
}

.return-confirm-notice {
  border: 1px solid rgba(245, 158, 11, .42);
  background: rgba(255, 247, 237, .97);
  color: #7c2d12;
  border-radius: 18px;
  padding: 16px;
  line-height: 1.9;
  font-weight: 800;
  margin: 14px 0;
}

.return-confirm-notice h1,
.return-confirm-notice h2,
.return-confirm-notice h3,
.return-confirm-notice p,
.return-confirm-notice li {
  color: #7c2d12 !important;
}

.return-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 600px) {
  .return-confirm-actions {
    grid-template-columns: 1fr;
  }
}

/* تسريع حركات السلة والكروت باستخدام مسرع الرسوميات GPU */
.card,
.product-card,
.cart-drawer {
  will-change: transform;
}


/* Cart/order confirmation modal */
.order-confirm-card,
.return-confirm-card {
  max-width: 680px;
  width: min(92vw, 680px);
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.order-confirm-notice,
.return-confirm-notice {
  margin: 12px 0;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 247, 237, .96);
  color: #7c2d12;
  border: 1px solid rgba(245, 158, 11, .45);
  line-height: 1.9;
  font-weight: 800;
}

.order-confirm-notice h1,
.order-confirm-notice h2,
.order-confirm-notice h3,
.return-confirm-notice h1,
.return-confirm-notice h2,
.return-confirm-notice h3 {
  color: #9a3412;
  margin-top: 0;
}

.confirm-actions {
  display: grid;
  gap: 10px;
}

.card,
.product-card,
.cart-drawer {
  will-change: transform;
}

/* WhatsApp floating button */
.whatsapp-float {
  position: fixed;
  z-index: 4800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 56px;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 18px 44px rgba(22,163,74,.35), 0 10px 28px rgba(0,0,0,.28);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.whatsapp-float:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 22px 52px rgba(22,163,74,.42), 0 12px 32px rgba(0,0,0,.32);
}

.whatsapp-float .wa-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  font-size: 20px;
  line-height: 1;
}

.whatsapp-float .wa-text {
  font-size: 14px;
  letter-spacing: .2px;
}

.whatsapp-float.wa-right { right: 18px; }
.whatsapp-float.wa-left { left: 18px; }
.whatsapp-float.wa-bottom { bottom: 22px; }
.whatsapp-float.wa-top { top: 92px; }

@media (max-width: 600px) {
  .whatsapp-float {
    min-width: 54px;
    min-height: 54px;
    padding: 0 13px;
  }

  .whatsapp-float .wa-text {
    display: none;
  }

  .whatsapp-float.wa-right { right: 12px; }
  .whatsapp-float.wa-left { left: 12px; }
  .whatsapp-float.wa-bottom { bottom: 14px; }
  .whatsapp-float.wa-top { top: 80px; }
}


.old-price,.old{display:inline-block;margin-inline-end:8px;color:#64748b;font-size:15px;text-decoration:line-through;font-weight:800}
.price-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0}
.search-wrap{position:relative;display:flex;align-items:center;flex:1;min-width:230px}
.search-wrap input{width:100%;padding-left:42px!important}
.clear-search-btn{position:absolute;left:10px;top:50%;transform:translateY(-50%);width:28px;height:28px;border-radius:999px;border:1px solid rgba(15,118,110,.25);background:#e6fffb;color:#0f766e;font-size:20px;font-weight:900;display:none;align-items:center;justify-content:center;line-height:1;box-shadow:0 4px 12px rgba(0,0,0,.12);z-index:3}
.clear-search-btn.show{display:flex}
.clear-search-btn:hover{background:#ccfbf1;transform:translateY(-50%) scale(1.04)}
.pwa-banner{position:fixed;right:16px;left:16px;bottom:18px;z-index:10000;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-radius:22px;background:rgba(7,28,34,.96);border:1px solid rgba(255,255,255,.16);box-shadow:0 18px 50px rgba(0,0,0,.35);color:#fff;backdrop-filter:blur(18px)}
.pwa-banner.hidden{display:none}
.pwa-banner p{margin:4px 0 0;color:var(--muted);font-size:13px}
.pwa-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:640px){.pwa-banner{flex-direction:column;align-items:stretch}.pwa-actions{justify-content:flex-end}}

.add-cart-btn:disabled{background:#94a3b8!important;color:#fff!important;border-color:#94a3b8!important;box-shadow:none!important}
.product-card.out-of-stock-card .add-cart-btn{background:#94a3b8!important;color:#fff!important}


/* v16: clearer search reset button */
.search-wrap{position:relative}
.search-wrap input[type="search"]::-webkit-search-cancel-button{display:none}
.clear-search-btn{cursor:pointer;opacity:0;pointer-events:none}
.clear-search-btn.show{display:flex!important;opacity:1;pointer-events:auto}

/* ######################################################################################## */
/* Custom scrollbar - dark theme */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 184, 166, 0.7) #06161b;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #06161b;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0f766e, #115e59);
  border-radius: 999px;
  border: 2px solid #06161b;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #14b8a6, #0f766e);
}


/* =========================================================
   Mobile UX + Product Grid + Custom Scrollbar Improvements
   Safe CSS-only additions
   ========================================================= */

/* منع أي تمرير أفقي مزعج على الموبايل */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* تحسين لمس الأزرار والحقول */
button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  font-size: 16px; /* يمنع zoom التلقائي في iPhone Safari */
}

button,
.nav-btn,
.add-cart-btn,
.details-btn,
.cart-btn,
.checkout-btn {
  min-height: 44px;
  touch-action: manipulation;
}

img {
  max-width: 100%;
}

/* تحسين عرض المنتجات على الموبايل */
@media (max-width: 640px) {
  body {
    -webkit-text-size-adjust: 100%;
  }

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

  .product-card {
    border-radius: 18px;
  }

  .product-card img,
  .product-image,
  .product-card-image {
    aspect-ratio: 1 / 1;
    object-fit: contain;
  }

  .product-title,
  .product-card-title {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .price,
  .product-price,
  .card-price {
    font-size: 0.95rem;
  }

  .product-card button,
  .add-cart-btn,
  .details-btn {
    min-height: 40px;
    font-size: 0.85rem;
  }
}

/* للشاشات الضيقة جداً: بطاقة واحدة حتى لا تصبح البطاقات مزدحمة */
@media (max-width: 340px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

/* تحسينات بسيطة للمساحات الآمنة عند فتح الموقع كتطبيق PWA */
body {
  padding-bottom: env(safe-area-inset-bottom);
}

.header,
.topbar,
.nav-bar {
  padding-top: env(safe-area-inset-top);
}

/* Scrollbar متناسق مع ألوان المتجر */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 184, 166, 0.7) #06161b;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #06161b;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0f766e, #115e59);
  border-radius: 999px;
  border: 2px solid #06161b;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #14b8a6, #0f766e);
}
/* Force 2 product cards per row on normal mobile screens */
@media (min-width: 341px) and (max-width: 640px) {
  .products-grid,
  #productsGrid,
  .products-list,
  .product-grid,
  .grid-products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .product-card,
  .store-product-card {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }
}

/* Very narrow screens: keep one card per row */
@media (max-width: 340px) {
  .products-grid,
  #productsGrid,
  .products-list,
  .product-grid,
  .grid-products {
    grid-template-columns: 1fr !important;
  }
}


/* =========================================================
   Work-with-us footer button + footer rights
   ========================================================= */
.footer .footer-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-rights {
  margin: 14px auto 0;
  max-width: 900px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.9;
  font-weight: 700;
  opacity: .95;
}

.footer-rights p {
  margin: 4px 0;
  color: var(--muted);
}

.footer-rights a {
  color: #5eead4;
  text-decoration: none;
  font-weight: 900;
}

.footer-rights a:hover {
  color: #fbbf24;
  text-decoration: underline;
}
