: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;height:100dvh;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;height:100dvh;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)}body.hero-config-pending #heroSection{visibility:hidden}
.hero-hidden-by-config{display:none!important}
.hero-intro-exiting{animation:heroIntroSlideUp .72s ease-in-out forwards;will-change:transform,opacity,margin}
.hero-intro-exiting-fast{animation:heroIntroSlideUp .46s ease-in-out forwards;will-change:transform,opacity,margin}
@keyframes heroIntroSlideUp{to{opacity:0;transform:translateY(-34px);max-height:0;margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;border-width:0;overflow:hidden}}
.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;position:sticky;top:0;z-index:55;padding:8px 0;background:rgba(7,28,34,.92);backdrop-filter:blur(14px);border-radius:22px;box-shadow:0 12px 34px rgba(0,0,0,.16)}.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;padding-top:0;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{position:relative;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;
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  max-width: 58px;
  max-height: 58px;
  padding: 0;
  border-radius: 50%;
  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;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.whatsapp-float .wa-icon {
  font-size: 24px;
  line-height: 1;
}

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

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

@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;
  }
}


/* Product video capsule and modal */
.product-image-wrap {
  position: relative;
}

.product-video-btn {
  position: absolute;
  left: 10px;
  bottom: 10px;
  min-width: 74px;
  height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(239, 68, 68, .98), rgba(220, 38, 38, .98));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(220,38,38,.32), 0 4px 12px rgba(0,0,0,.18);
  z-index: 4;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  direction: rtl;
}

.product-video-btn:hover {
  transform: translateY(-2px) scale(1.03);
  background: linear-gradient(135deg, rgba(248, 113, 113, 1), rgba(220, 38, 38, 1));
  box-shadow: 0 14px 30px rgba(220,38,38,.38), 0 6px 16px rgba(0,0,0,.22);
}

.product-video-btn img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.2));
}

.product-video-btn .video-btn-text {
  display: inline-block;
  white-space: nowrap;
  color: #fff;
}

.product-video-btn.video-fallback-icon::before {
  content: "▶";
  color: #fff;
  font-size: 13px;
  line-height: 1;
  margin-inline-end: 1px;
}

.video-tooltip {
  position: absolute;
  left: 0;
  bottom: 42px;
  min-width: 96px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .95);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease;
}

.product-video-btn:hover .video-tooltip {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 520px) {
  .product-video-btn {
    min-width: 82px;
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    left: 9px;
    bottom: 9px;
  }

  .product-video-btn img {
    width: 18px;
    height: 18px;
  }
}

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

.video-modal-body {
  margin-top: 14px;
}

.video-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: #020617;
}

.video-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-player {
  width: 100%;
  max-height: 76vh;
  border-radius: 18px;
  background: #020617;
  display: block;
}

.video-external-box {
  padding: 20px;
  border-radius: 18px;
  background: rgba(15, 23, 42, .06);
  text-align: center;
}

.video-open-link {
  display: inline-flex;
  margin-top: 12px;
  text-decoration: none;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .product-video-btn {
    width: 38px;
    height: 38px;
    left: 8px;
    bottom: 8px;
  }
  .product-video-btn img {
    width: 22px;
    height: 22px;
  }
  .video-tooltip {
    display: none;
  }
}


/* =========================================================
   Client-side upgrade v2: product modal, thumbnails, video pulse, PWA
   ========================================================= */
.product-modal-card {
  position: relative !important;
  padding: 22px !important;
}

.product-modal-close,
.product-modal .modal-close {
  position: absolute !important;
  top: calc(12px + env(safe-area-inset-top, 0px)) !important;
  left: 12px !important;
  float: none !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  z-index: 30 !important;
  display: inline-grid !important;
  place-items: center !important;
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  box-shadow: 0 10px 24px rgba(220, 38, 38, .34) !important;
}



.product-modal-share {
  position: absolute !important;
  top: calc(12px + env(safe-area-inset-top, 0px)) !important;
  right: 12px !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  z-index: 30 !important;
  display: inline-grid !important;
  place-items: center !important;
  background: rgba(255, 255, 255, .12) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, .22) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22) !important;
  backdrop-filter: blur(10px);
}

.product-modal-share:hover {
  background: rgba(20, 184, 166, .22) !important;
  border-color: rgba(94, 234, 212, .45) !important;
}

.product-modal-share .share-icon {
  line-height: 1;
  font-size: 21px;
  font-weight: 900;
  transform: translateY(-1px);
}

.product-modal-share .share-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(2, 6, 23, .88);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .24);
  transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease;
}

@media (hover: hover) and (pointer: fine) {
  .product-modal-share:hover .share-tooltip {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-gallery {
  min-width: 0;
}

.modal-image-counter {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 8;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(2, 6, 23, .72);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.swiper-box {
  position: relative !important;
}

.modal-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 2px 2px;
  margin-top: 8px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.modal-thumb {
  width: 74px !important;
  min-width: 74px !important;
  height: 74px !important;
  min-height: 74px !important;
  padding: 3px !important;
  border-radius: 18px !important;
  border: 2px solid rgba(255,255,255,.18) !important;
  background: rgba(255,255,255,.08) !important;
  box-shadow: none !important;
  scroll-snap-align: center;
  flex: 0 0 auto;
}

.modal-thumb.active {
  border-color: #14b8a6 !important;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, .18) !important;
}

.modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  display: block;
  background: #020617;
}

.product-video-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  box-shadow: 0 8px 22px rgba(220, 38, 38, .28) !important;
}

.product-video-btn.video-attention {
  animation: videoPulseOnce 5s ease-out 1;
}

@keyframes videoPulseOnce {
  0% {
    box-shadow: 0 0 0 0 rgba(220,38,38,.46), 0 8px 22px rgba(220,38,38,.28);
    transform: translateY(0) scale(1);
  }
  35% {
    box-shadow: 0 0 0 12px rgba(220,38,38,.10), 0 12px 28px rgba(220,38,38,.34);
    transform: translateY(-1px) scale(1.035);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(220,38,38,0), 0 8px 22px rgba(220,38,38,.28);
    transform: translateY(0) scale(1);
  }
  100% {
    box-shadow: 0 8px 22px rgba(220,38,38,.28);
    transform: translateY(0) scale(1);
  }
}

.modal-video-slot {
  margin: 10px 0 8px;
  min-height: 38px;
}

.video-cta-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-video-btn {
  position: relative !important;
  left: auto !important;
  bottom: auto !important;
  width: auto !important;
  min-width: 112px !important;
  max-width: max-content !important;
  display: inline-flex !important;
  margin: 0 !important;
}

.modal-video-prompt {
  display: none !important;
}

.video-cta-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: min(78vw, 260px);
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, .92);
  font-weight: 900;
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 12px 30px rgba(15,23,42,.22);
  pointer-events: none;
  opacity: 0;
  z-index: 8;
  white-space: nowrap;
}

.video-cta-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(15, 23, 42, .92);
}

.video-cta-wrap.is-attention .video-cta-bubble {
  animation: videoCtaBubbleFade 3s ease forwards;
}

@keyframes videoCtaBubbleFade {
  0% { opacity: 0; transform: translateX(-50%) translateY(4px); }
  14%, 76% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}

.video-modal-content {
  width: auto !important;
  max-width: min(96vw, 900px) !important;
}

.video-frame-wrap {
  margin-inline: auto;
  background: #020617;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.38);
}

.video-frame-wrap.vertical {
  width: min(360px, 92vw);
  aspect-ratio: 9 / 16;
}

.video-frame-wrap.horizontal {
  width: min(860px, 94vw);
  aspect-ratio: 16 / 9;
}

.video-frame-wrap iframe,
.video-player {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #020617;
}

.video-player.vertical {
  width: min(360px, 92vw);
  aspect-ratio: 9 / 16;
  height: auto;
  margin: 0 auto;
  border-radius: 24px;
}

.video-player.horizontal {
  width: min(860px, 94vw);
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 0 auto;
  border-radius: 24px;
}

.pwa-banner {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 9000;
  width: min(480px, calc(100vw - 32px));
  padding: 16px;
  border-radius: 24px;
  background: rgba(7, 28, 34, .98);
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
  backdrop-filter: blur(16px);
}

.pwa-banner b {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}

.pwa-banner p {
  margin: 0;
  color: #d6f4f4;
  line-height: 1.8;
  font-size: 14px;
}

.pwa-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pwa-actions button {
  width: auto !important;
  min-width: 0 !important;
  flex: 1 1 120px;
  padding: 10px 12px !important;
  min-height: 42px !important;
  border-radius: 16px !important;
  white-space: nowrap;
}

.store-load-error button {
  width: auto !important;
}

@media (hover: none) {
  .product-video-btn:hover .video-tooltip {
    opacity: 0 !important;
    display: none !important;
  }
}

@media (max-width: 780px) {
  .product-modal-card {
    width: calc(100vw - 14px) !important;
    max-width: calc(100vw - 14px) !important;
    padding: 14px !important;
    padding-top: 58px !important;
    border-radius: 24px !important;
  }

  .modal-layout {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .swiper-box {
    height: min(52dvh, 390px) !important;
    min-height: 250px !important;
    max-height: 420px !important;
    border-radius: 24px !important;
  }

  .modal-thumb {
    width: 66px !important;
    min-width: 66px !important;
    height: 66px !important;
    min-height: 66px !important;
  }

  .modal-info h2 {
    font-size: 23px !important;
  }

  .modal-video-btn {
    width: auto !important;
    min-width: 108px !important;
    height: 38px !important;
  }

  .pwa-banner {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 480px) {
  .product-modal-card {
    padding-inline: 12px !important;
    padding-bottom: 12px !important;
  }

  .swiper-box {
    height: min(46dvh, 350px) !important;
    min-height: 235px !important;
  }

  .modal-thumbs {
    gap: 8px;
  }

  .modal-thumb {
    width: 62px !important;
    min-width: 62px !important;
    height: 62px !important;
    min-height: 62px !important;
  }

  .product-modal .modal-close,
  .product-modal-close {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }
}


/* Second page promotion controlled by second-page.json */
.second-page-banner {
  --second-bg-a: #a855f7;
  --second-bg-b: #ec4899;
  --second-fg: #ffffff;
  margin: 0 auto 14px;
  width: min(1180px, calc(100% - 28px));
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--second-bg-a), var(--second-bg-b));
  color: var(--second-fg);
  box-shadow: 0 16px 38px rgba(15, 23, 42, .18);
  overflow: hidden;
  direction: rtl;
}

.second-page-banner.theme-gold,
.second-page-float.theme-gold { --second-bg-a: #f59e0b; --second-bg-b: #92400e; --second-fg: #fff; }
.second-page-banner.theme-purple,
.second-page-float.theme-purple { --second-bg-a: #a855f7; --second-bg-b: #ec4899; --second-fg: #fff; }
.second-page-banner.theme-blue,
.second-page-float.theme-blue { --second-bg-a: #2563eb; --second-bg-b: #06b6d4; --second-fg: #fff; }
.second-page-banner.theme-red,
.second-page-float.theme-red { --second-bg-a: #ef4444; --second-bg-b: #dc2626; --second-fg: #fff; }
.second-page-banner.theme-dark,
.second-page-float.theme-dark { --second-bg-a: #111827; --second-bg-b: #374151; --second-fg: #fff; }
.second-page-banner.theme-green,
.second-page-float.theme-green { --second-bg-a: #10b981; --second-bg-b: #059669; --second-fg: #fff; }

.second-page-banner-track {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 900;
}

.second-page-banner-text {
  display: inline-block;
  padding-inline: 4px;
}

.second-page-banner.is-marquee .second-page-banner-text {
  min-width: max-content;
  animation-duration: var(--second-marquee-speed, 14s);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.second-page-banner.marquee-right .second-page-banner-text {
  animation-name: secondMarqueeRight;
}

.second-page-banner.marquee-left .second-page-banner-text {
  animation-name: secondMarqueeLeft;
}

@keyframes secondMarqueeRight {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@keyframes secondMarqueeLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

.second-page-banner-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.second-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: #0f172a;
  background: rgba(255,255,255,.92);
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(15,23,42,.14);
}

.second-page-close {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.18);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.second-page-float {
  --second-bg-a: #a855f7;
  --second-bg-b: #ec4899;
  --second-fg: #ffffff;
  --second-float-size: 58px;
  position: fixed;
  z-index: 4750;
  width: var(--second-float-size);
  height: var(--second-float-size);
  border-radius: 999px;
  color: var(--second-fg);
  background: linear-gradient(135deg, var(--second-bg-a), var(--second-bg-b));
  box-shadow: 0 18px 44px rgba(15,23,42,.24), 0 10px 26px rgba(0,0,0,.20);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  max-width: calc(100vw - 28px);
  transition: transform .18s ease, box-shadow .18s ease, width .28s ease, padding-inline .28s ease;
}

.second-page-float::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  border: 2px solid rgba(255,255,255,.24);
  opacity: 0;
  transform: scale(.92);
  pointer-events: none;
}

.second-page-float:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 22px 54px rgba(15,23,42,.30), 0 12px 30px rgba(0,0,0,.24);
}

@media (hover: hover) and (pointer: fine) {
  .second-page-float.hover-expand:hover {
    width: min(320px, calc(100vw - 36px));
    padding-inline: 16px;
  }

  .second-page-float.hover-expand:hover .second-page-float-label {
    max-width: 230px;
    opacity: 1;
  }
}

.second-page-float.pos-bottom-left { left: 18px; bottom: 18px; }
.second-page-float.pos-bottom-right { right: 18px; bottom: 18px; }
.second-page-float.pos-top-left { left: 18px; top: 18px; }
.second-page-float.pos-top-right { right: 18px; top: 18px; }

.second-page-float.avoid-whatsapp.pos-bottom-left,
.second-page-float.avoid-whatsapp.pos-bottom-right {
  bottom: 88px;
}

.second-page-float-icon {
  flex: 0 0 auto;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.second-page-float-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  font-weight: 900;
  font-size: 14px;
  transition: max-width .34s ease, opacity .24s ease;
}

.second-page-float.do-expand {
  animation: secondFloatExpand var(--second-float-expand-seconds, 2.5s) ease forwards;
}

.second-page-float.do-pulse {
  animation-name: secondFloatPulse;
  animation-duration: var(--second-float-pulse-seconds, 4s);
  animation-timing-function: ease-out;
  animation-iteration-count: 1;
}

.second-page-float.do-idle-pulse::after {
  animation: secondFloatIdlePulse var(--second-float-idle-pulse-seconds, 2.4s) ease-in-out forwards;
}

.second-page-float.do-expand.do-pulse {
  animation-name: secondFloatExpand, secondFloatPulse;
  animation-duration: var(--second-float-expand-seconds, 2.5s), var(--second-float-pulse-seconds, 4s);
  animation-timing-function: ease, ease-out;
  animation-iteration-count: 1, 1;
}

.second-page-float.do-expand .second-page-float-label {
  animation: secondFloatLabel var(--second-float-expand-seconds, 2.5s) ease forwards;
}

@keyframes secondFloatLabel {
  0%, 100% { max-width: 0; opacity: 0; }
  14%, 78% { max-width: 230px; opacity: 1; }
}

@keyframes secondFloatExpand {
  0%, 100% { width: var(--second-float-size); padding-inline: 0; }
  14%, 78% { width: min(320px, calc(100vw - 36px)); padding-inline: 16px; }
}

@keyframes secondFloatPulse {
  0% { box-shadow: 0 0 0 0 rgba(168,85,247,.34), 0 18px 44px rgba(15,23,42,.24); }
  35% { box-shadow: 0 0 0 13px rgba(168,85,247,.14), 0 22px 54px rgba(15,23,42,.30); }
  70% { box-shadow: 0 0 0 22px rgba(168,85,247,0), 0 18px 44px rgba(15,23,42,.24); }
  100% { box-shadow: 0 18px 44px rgba(15,23,42,.24), 0 10px 26px rgba(0,0,0,.20); }
}

@keyframes secondFloatIdlePulse {
  0%, 100% { opacity: 0; transform: scale(.92); }
  18% { opacity: .42; transform: scale(1.02); }
  52% { opacity: .20; transform: scale(1.16); }
  80% { opacity: 0; transform: scale(1.24); }
}

@media (max-width: 720px) {
  .second-page-banner {
    width: calc(100% - 20px);
    border-radius: 16px;
    padding: 9px 10px;
    gap: 8px;
  }
  .second-page-banner-actions {
    gap: 6px;
  }
  .second-page-link {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }
  .second-page-banner-track {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-video-btn.video-attention,
  .video-cta-wrap.is-attention .video-cta-bubble,
  .second-page-banner.is-marquee .second-page-banner-text,
  .second-page-float.do-expand,
  .second-page-float.do-pulse,
  .second-page-float.do-idle-pulse::after,
  .second-page-float.do-expand .second-page-float-label {
    animation: none !important;
  }
}


@media (max-width: 780px) {
  .product-modal-share {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    right: 10px !important;
  }
  .product-modal-share .share-tooltip {
    display: none !important;
  }
}


/* Search clear affordance */
input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}
.clear-search-btn {
  cursor: pointer;
}
.clear-search-btn[hidden] {
  display: none !important;
}


/* Initial product loading skeletons */
.product-card-skeleton {
  pointer-events: none;
  min-height: 360px;
}

.product-card-skeleton:hover {
  transform: none;
  border-color: var(--border-dark);
  box-shadow: 0 16px 42px rgba(0,0,0,.2);
}

.skeleton-shimmer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(226,232,240,.78) 25%, rgba(248,250,252,.96) 50%, rgba(226,232,240,.78) 75%);
  background-size: 220% 100%;
  animation: productSkeletonShimmer 1.35s ease-in-out infinite;
}

.skeleton-media {
  height: 230px;
  border-radius: 22px;
}

.skeleton-line {
  border-radius: 999px;
  height: 16px;
  margin-top: 14px;
}

.skeleton-title {
  width: 82%;
  height: 18px;
}

.skeleton-price {
  width: 48%;
  height: 24px;
}

.skeleton-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}

.skeleton-pill {
  height: 42px;
  border-radius: 16px;
}

@keyframes productSkeletonShimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-shimmer {
    animation: none;
    background: rgba(226,232,240,.88);
  }
}
