:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e5e7eb;
  --brand:#2563eb;
  --brand2:#1d4ed8;
  --danger:#dc2626;
  --icon:#334155; /* matte icon color */
  --shadow: 0 10px 25px rgba(15, 23, 42, .08);
  --shadow2: 0 6px 18px rgba(15, 23, 42, .08);
  --radius:16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

/* Header (YouCan-like) */
.header{
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.header-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 14px 8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  position: relative;
}
.header-logo img{
  height: 40px;
  display:block;
}
.icon-btn{
  border:0;
  background:transparent;
  font-size: 22px;
  cursor:pointer;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--icon);
}
.icon-btn:hover{ background: rgba(37,99,235,.08); }
.link-btn{ text-decoration:none; color: var(--icon); }

.search-box{
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 14px 12px;
}
.search-box input{
  width:100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 14px;
  outline:none;
  background:#fbfdff;
}
.search-box input:focus{
  border-color: rgba(37,99,235,.5);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

/* Layout */
.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}
.page-title{
  margin: 12px 0 14px;
  font-size: 20px;
  font-weight: 900;
}

.grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
}
@media (max-width: 900px){
  .grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 700px){
  .grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* Cards */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: 0 4px 14px rgba(15,23,42,.06);
  cursor:pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.card img{
  width:100%;
  height: 160px;
  object-fit: cover;
  display:block;
  background:#eef2ff;
}
.card-body{ padding: 12px; }
.card-title{
  font-weight: 900;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 8px;
}
.price-row{ display:flex; align-items:baseline; gap: 8px; }
.price{ color: var(--danger); font-size: 18px; font-weight: 900; }
.old{ color: #94a3b8; text-decoration: line-through; font-size: 13px; }

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(37,99,235,.10);
  color: var(--brand2);
}

/* Product page layout */
.product-top{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 16px;
  align-items:start;
}
@media (max-width: 900px){
  .product-top{ grid-template-columns: 1fr; }
}

/* Gallery */
.gallery{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow:hidden;
  box-shadow: var(--shadow2);
}
.gallery-stage{
  position: relative;
  background: #eef2ff;
}
.gallery-stage img{
  width:100%;
  height: 420px;
  object-fit: cover;
  display:block;
}
@media (max-width: 900px){
  .gallery-stage img{ height: 320px; }
}

.gallery-nav{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  pointer-events:none;
}
.nav-btn{
  pointer-events:auto;
  border:0;
  width:44px;
  height:44px;
  margin: 0 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.85);
  color: var(--icon);
  font-size: 18px;
  cursor:pointer;
  box-shadow: 0 8px 20px rgba(15,23,42,.12);
}
.nav-btn:hover{ background:#fff; }

.dots{
  position:absolute;
  left: 0; right: 0;
  bottom: 10px;
  display:flex;
  justify-content:center;
  gap: 6px;
}
.dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15,23,42,.25);
  cursor:pointer;
}
.dot.active{ background: rgba(37,99,235,.9); width: 18px; }

.thumbs{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
  padding: 12px;
  background: #fff;
}
.thumb{
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow:hidden;
  cursor:pointer;
  background:#f8fafc;
  transition: .15s ease;
}
.thumb img{
  width:100%;
  height: 86px;
  object-fit: cover;
  display:block;
}
.thumb.active{
  border-color: rgba(37,99,235,.6);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Order card */
.order-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow2);
  padding: 14px;
}

.prod-title{
  font-size: 18px;
  font-weight: 900;
  margin: 2px 0 10px;
}

.price-block{
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}
.price-block .price{ font-size: 22px; }
.benefits{
  list-style:none;
  padding:0;
  margin: 10px 0 0;
  display:grid;
  gap: 8px;
}
.benefits li{
  color: #334155;
  font-size: 13px;
  display:flex;
  align-items:center;
  gap: 8px;
}

/* Form */
.form-title{
  font-weight: 900;
  margin: 6px 0 10px;
  font-size: 14px;
}
.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 900px){
  .form-grid{ grid-template-columns: 1fr; }
}
.field label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 800;
}
.field input, .field textarea, .field select{
  width:100%;
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 11px 12px;
  outline:none;
  background:#fbfdff;
  font-size: 14px;
}
.field textarea{ min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

/* Sections under top */
.section{
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(15,23,42,.05);
  padding: 14px;
}
.section h3{
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 900;
}
.desc{
  color: var(--muted);
  line-height: 1.8;
  font-size: 14px;
}

/* Reviews */
.reviews{
  display:grid;
  gap: 10px;
}
.review{
  border:1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background:#fbfdff;
}
.review-top{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  align-items:center;
}
.review-name{
  font-weight: 900;
  font-size: 13px;
}
.stars{ color: #f59e0b; letter-spacing: 1px; }
.review-text{
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* Fixed buy bar */
.buybar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 10px 14px;
}
.buybar-inner{
  max-width: 1100px;
  margin: 0 auto;
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content:space-between;
}
.buybar-price{
  font-weight: 900;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}
.btn{
  border:0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 900;
  cursor:pointer;
  font-size: 14px;
}
.btn-primary{
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color:#fff;
  flex: 1;
}
.btn-secondary{
  background: #eef2ff;
  color: var(--brand2);
  border: 1px solid rgba(37,99,235,.20);
}
@media (max-width: 700px){
  .buybar-price{ display:none; }
  .btn{ flex: 1; }
}

/* spacing for fixed bar */
body.has-buybar{
  padding-bottom: 88px;
}

/* Mobile app-like tweaks */
@media (max-width: 700px){
  .page-title{ font-size: 18px; margin-top: 10px; }
  .card img{ height: 150px; }
  .header-inner{ justify-content:center; }
  .header-inner .icon-btn:first-child{ position:absolute; right: 6px; }
  .header-inner .icon-btn:last-child{ position:absolute; left: 6px; }
}
/* ===== Footer Centered Pro ===== */
.footer{
  margin-top: 24px;
  background: #ffffff;
  border-top: 1px solid var(--border);
}

.footer-inner{
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: center;
}

.footer-block h4{
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 12px;
  color: var(--text);
}

.footer-block a{
  display: block;
  text-decoration: none;
  font-size: 13px;
  color: var(--muted);
  padding: 6px 0;
  transition: .15s ease;
}

.footer-block a:hover{
  color: var(--brand2);
}

.footer-bottom{
  text-align: center;
  padding: 14px 10px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* 📱 Mobile */
@media (max-width: 700px){
  .footer-inner{
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
/* Empty State – Attention Style */
#emptyState{
  background: linear-gradient(135deg, #3d3a3a, #d8caca);
  padding: 25px 15px;
  border-radius: 16px;
  margin-top: 20px;
  color: #fff;
}

/* العنوان */
#emptyState h3{
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* الوصف */
#emptyState .desc{
  font-size: 14px;
  font-weight: 600;
  opacity: 0.95;
}
/* لون الجملة الرئيسية داخل emptyState فقط */
#emptyState h3{
  color: #3b6cb7;   /* أزرق خفيف */
}
/* EmptyState – الكادر كامل */
#emptyState{
  background: #e9f1fb;          /* أزرق خفيف */
  border: 1px solid #d6e4f5;
  border-radius: 14px;
  padding: 22px 16px;
  margin-top: 22px;
}

/* النص الرئيسي */
#emptyState h3{
  color: #2f5fa7;
  font-weight: 600;
}

/* الوصف */
#emptyState .desc{
  color: #4a6fa1;
}
/* خلي كل الكتابة داخل emptyState برتقالية */
#emptyState{
  color: #ff8c42;   /* برتقالي خفيف وراقي */
}

/* تأكيد على العنوان والوصف */
#emptyState h3,
#emptyState .desc{
  color: #ff8c42;
}
.header{
  background: #fff1e6;    /* بدّل اللون هنا */
  border-bottom: 1px solid #e0e0e0;
}
/* Search box – default (mobile) */
.search-box input{
  width: 100%;
}

/* Search box – PC فقط */
@media (min-width: 992px){
  .search-box{
    display: flex;
    justify-content: center;
  }

  .search-box input{
    width: 800px;        /* صغّرها هنا */
    max-width: 90%;
  }
}
/* فصل search box على الهيدر */
.search-box{
  margin-top: 16px;      /* هبوط لتحت */
  padding-top: 10px;
}
.header{
  position: relative;
}
.search-box{
  position: absolute;
  left: 0;
  right: 0;
  bottom: -55px;          /* هبطها لتحت الهيدر */
  padding: 0 16px;
}
/* تكبير اللوغو فـ الهاتف و PC */
.header-logo img{
  height: 56px;     /* بدّل الرقم إذا بغيتي */
  width: auto;
}
.header-inner{
  min-height: 42px;
}

/* ===== FIX CHECKOUT FOOTER ===== */
.checkout-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.checkout-page main,
.checkout-page .checkout-container {
  flex: 1;
}

/* تأكيد أن الفوتر يهبط للتحت */
.checkout-page footer {
  margin-top: auto;
}
/* ===== END FIX ===== */

/* ===== PRO CHECKOUT LAYOUT (sticky footer + centered card) ===== */
.checkout-page{
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
}

/* center the checkout card without breaking footer */
.checkout-page .checkout-container{
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
}

/* keep footer at bottom */
.checkout-page footer{
  margin-top: auto !important;
}
/* ===== END PRO CHECKOUT LAYOUT ===== */

/* ===== CHECKOUT CENTERING OVERRIDE ===== */
.checkout-page .checkout-container{
  width: 100% !important;
}
/* ===== END CHECKOUT CENTERING OVERRIDE ===== */

/* ===== CHECKOUT CARD CENTER (final) ===== */
.checkout-page .checkout-container{
  width: 100% !important;
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  box-sizing: border-box !important;
}

.checkout-page .box{
  margin: 0 auto !important;
}
/* ===== END CHECKOUT CARD CENTER (final) ===== */

/* ===== CHECKOUT SPACING + CENTERING (V2) ===== */
.checkout-page main.checkout-container{
  width: 100% !important;
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px 24px 48px !important; /* extra space above footer */
  box-sizing: border-box !important;
}

.checkout-page .box{
  margin: 0 auto !important;
}

.checkout-page footer.footer{
  margin-top: auto !important;
}
/* ===== END CHECKOUT SPACING + CENTERING (V2) ===== */


/* WhatsApp contact button */
.btn-whatsapp{
  background:#25D366;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  width:100%;
  margin-top:12px;
  text-decoration:none;
}
.btn-whatsapp:hover{ filter:brightness(0.95); }
.btn-whatsapp .wa-icon{ width:20px; height:20px; }


/* WhatsApp button placement (after reviews) */
.whatsapp-after-reviews{
  display:flex;
  justify-content:center;
}
.whatsapp-after-reviews .btn-whatsapp{
  max-width:420px;
  width:100%;
  margin-top:12px;
}
