:root {
  --primary:#1769e0;
  --primary-dark:#104eb0;
  --navy:#101d35;
  --bg:#f5f7fb;
  --surface:#fff;
  --text:#172033;
  --muted:#778196;
  --border:#e8edf4;
  --green:#0b9b68;
  --radius:17px;
  --shadow:0 5px 22px rgba(20,40,80,.055);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  direction:rtl;
  text-align:right;
  color:var(--text);
  background:var(--bg);
  font-family:Tahoma,"Segoe UI",Arial,sans-serif;
  font-size:14px;
  line-height:1.9;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto}
button,input,select,textarea{font:inherit}
button,a{transition:.2s ease}
h1,h2,h3{line-height:1.65}
h1{font-size:clamp(23px,4vw,35px)}
h2{font-size:22px}
p{color:var(--muted)}
.container,.wrap,main{
  width:min(1200px,94%);
  margin-left:auto;
  margin-right:auto;
}

/* Header */
header,.header,.site-header{
  background:#fff;
  border-bottom:1px solid var(--border);
}
header .container,header .wrap,
.site-header .container{
  min-height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  flex-wrap:wrap;
}
.logo,.brand,.site-logo{
  color:var(--primary);
  font-size:25px;
  font-weight:900;
}
nav{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
nav a{font-weight:700;color:#45516a}
nav a:hover{color:var(--primary)}

/* Hero */
.hero-banner{
  position:relative;
  overflow:hidden;
  margin:28px auto;
  padding:48px 32px;
  border-radius:24px;
  color:white;
  background:linear-gradient(125deg,#102d61,#1769e0 65%,#398cf1);
  box-shadow:0 15px 35px rgba(23,105,224,.17);
}
.hero-banner:after{
  content:"";
  position:absolute;
  width:280px;height:280px;
  border:45px solid rgba(255,255,255,.07);
  border-radius:50%;
  left:-90px;top:-120px;
}
.hero-banner h1,.hero-banner h2{
  color:white;margin:0 0 10px;position:relative;z-index:1;
}
.hero-banner p{color:#e1ecff;font-size:16px;position:relative;z-index:1}
.btns{display:flex;gap:12px;flex-wrap:wrap;margin-top:22px}
.btn-w,.btn-o,.btn,.btn-card{
  display:inline-flex;align-items:center;justify-content:center;
  padding:10px 20px;border-radius:11px;
  font-weight:800;cursor:pointer;
}
.btn-w{background:white;color:var(--primary)}
.btn-o{border:1px solid rgba(255,255,255,.7);color:white}
.btn-w:hover,.btn-o:hover{transform:translateY(-2px)}

/* Search */
.search-box{
  background:white;
  border:1px solid var(--border);
  border-radius:17px;
  padding:9px;
  display:flex;
  max-width:850px;
  margin:25px auto 36px;
  box-shadow:var(--shadow);
}
.search-box input{
  flex:1;min-width:0;border:0;outline:0;
  padding:12px 16px;background:transparent;
  font-size:15px;color:var(--text);
}
.search-box button{
  border:0;border-radius:11px;
  padding:10px 24px;background:var(--primary);
  color:white;font-weight:bold;
}

/* Sections */
.section-title{
  display:flex;justify-content:space-between;
  align-items:center;gap:10px;
  margin:34px 0 18px;
  font-size:20px;font-weight:900;
}
.badge{
  background:#eaf2ff;color:var(--primary);
  padding:4px 12px;border-radius:30px;
  font-size:12px;font-weight:bold;
}

/* Product grid */
.grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:16px;
}
.card{
  min-width:0;
  display:flex;flex-direction:column;
  overflow:hidden;background:white;
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:12px;
  transition:transform .2s,border-color .2s,box-shadow .2s;
}
.card:hover{
  transform:translateY(-4px);
  border-color:#c4d9fa;
  box-shadow:0 12px 28px rgba(20,60,120,.10);
}
.card-img-wrap{
  height:175px;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;background:#fff;border-radius:12px;
}
.card img{
  width:100%;height:175px;object-fit:contain;
  padding:8px;
}
.card-body{padding:12px 4px 5px;display:flex;flex-direction:column;flex:1}
.card h3{
  font-size:13px;font-weight:700;
  min-height:48px;margin:4px 0 10px;
  overflow:hidden;
}
.card-price,.price{
  color:var(--green);font-size:16px;font-weight:900;
}
.card-meta,.muted{color:var(--muted);font-size:12px}
.btn-card{
  margin-top:12px;
  background:#edf4ff;color:var(--primary);
  font-size:12px;padding:8px;
}
.ph{
  width:100%;height:100%;
  display:flex;align-items:center;justify-content:center;
  background:#f3f6fb;color:#a5afc0;font-size:38px;
}
.ph.big{min-height:260px}

/* Product details */
.crumbs{
  padding:17px 0;color:var(--muted);font-size:12px;
}
.crumbs a{color:var(--primary)}
.product{
  background:white;border:1px solid var(--border);
  border-radius:20px;padding:24px;
  display:grid;grid-template-columns:minmax(220px, .8fr) 1.5fr;
  gap:28px;box-shadow:var(--shadow);
}
.imgs{
  min-height:260px;display:flex;align-items:center;
  justify-content:center;background:white;
}
.imgs img{max-height:320px;object-fit:contain}
.info h1{font-size:24px}
.price.big{font-size:27px;margin:12px 0}
.desc{line-height:2.2;color:#4c5870;margin-top:18px}

/* Price comparison */
.offers{
  width:100%;border-collapse:collapse;
  background:white;border-radius:15px;
  overflow:hidden;box-shadow:var(--shadow);
}
.offers th{
  background:#edf3fc;color:#263b5d;
  padding:15px;text-align:right;
}
.offers td{
  padding:15px;border-bottom:1px solid var(--border);
}
.offers tr:hover td{background:#f8faff}
.offers .btn,.btn{
  background:var(--primary);color:white;
}
.offers .btn:hover,.btn:hover{
  background:var(--primary-dark);
}
s{color:#9ba4b3;font-size:12px}

/* Forms and admin */
input,select,textarea{
  max-width:100%;
}
input:not([type=checkbox]):not([type=radio]),
select,textarea{
  border:1px solid #dfe5ef;
  border-radius:10px;
  padding:11px 13px;
  background:white;
  color:var(--text);
}
input:focus,select:focus,textarea:focus{
  outline:2px solid #c6dcff;border-color:var(--primary);
}
button{border:0}
table{max-width:100%}
footer{
  margin-top:55px;padding:35px 3%;
  background:var(--navy);color:#e5edfa;
}
footer p,footer a{color:#bdcbe0}
hr{border:0;border-top:1px solid var(--border)}

/* Responsive */
@media(max-width:1000px){
  .grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(max-width:700px){
  body{font-size:13px}
  .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .hero-banner{padding:30px 20px;margin:17px auto;border-radius:17px}
  .hero-banner p{font-size:13px}
  .card{padding:8px;border-radius:13px}
  .card-img-wrap,.card img{height:135px}
  .card h3{font-size:12px;min-height:45px}
  .card-price,.price{font-size:14px}
  .section-title{font-size:17px}
  .product{grid-template-columns:1fr;padding:15px;gap:12px}
  .imgs{min-height:200px}
  .imgs img{max-height:240px}
  .info h1{font-size:20px}
  .offers{font-size:11px}
  .offers th,.offers td{padding:9px 6px}
  header .container,header .wrap{padding:10px 0}
  nav{gap:10px}
  .search-box{margin:18px auto 25px}
}
@media(max-width:360px){
  .grid{gap:7px}
  .card-img-wrap,.card img{height:115px}
  .btn-w,.btn-o{padding:9px 12px;font-size:12px}
}

/* ═══ Product Detail V2 ═══ */
.product-detail { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; background: #fff; border-radius: 20px; padding: 24px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.product-gallery { background: #fafbfc; border-radius: 16px; padding: 20px; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.product-gallery img { max-width: 100%; max-height: 380px; object-fit: contain; }
.placeholder-img { font-size: 80px; color: #cbd5e1; }
.product-info h1 { font-size: 1.4rem; margin: 0 0 12px; line-height: 1.4; }
.product-meta-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.price-hero { background: linear-gradient(135deg, #fef3c7, #fde68a); border-radius: 16px; padding: 20px; margin: 16px 0; }
.price-huge { font-size: 32px; font-weight: 900; color: #c2410c; margin: 6px 0; line-height: 1.2; }
.price-huge .currency { font-size: 14px; font-weight: 400; }
.spread-info { font-size: 12px; color: #92400e; margin-top: 8px; }

.deal-score-card { display: flex; gap: 14px; padding: 14px 18px; border-radius: 14px; margin: 16px 0; align-items: center; }
.deal-score-card.deal-great { background: #dcfce7; border: 2px solid #86efac; }
.deal-score-card.deal-good { background: #dbeafe; border: 2px solid #93c5fd; }
.deal-score-card.deal-fair { background: #fef9c3; border: 2px solid #fde047; }
.deal-score-card.deal-high { background: #fed7aa; border: 2px solid #fdba74; }
.deal-score-card.deal-too-high { background: #fecaca; border: 2px solid #fca5a5; }
.ds-icon { font-size: 32px; }
.ds-label { font-size: 16px; font-weight: 900; color: #1e293b; }
.ds-score { font-size: 12px; color: #475569; margin-top: 2px; }
.ds-hint { font-size: 11px; color: #92400e; margin-top: 4px; }
.ds-hint.positive { color: #166534; font-weight: 700; }

.seller-count-box { background: #f1f5f9; padding: 10px 16px; border-radius: 10px; font-size: 14px; color: #334155; margin: 12px 0; }
.unavailable-box { background: #fef2f2; border: 2px dashed #fca5a5; border-radius: 16px; padding: 32px; text-align: center; margin: 16px 0; }
.unavailable-box h2 { color: #991b1b; font-size: 1.1rem; margin: 8px 0; }
.product-desc { font-size: 13px; color: #475569; line-height: 1.8; background: #f8fafc; padding: 14px; border-radius: 10px; margin-top: 16px; }

/* Offers table */
.offers-table-wrap { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06); margin-bottom: 20px; }
.offers-table-v2 { width: 100%; border-collapse: collapse; }
.offers-table-v2 th { padding: 14px 12px; text-align: right; font-size: 12px; color: var(--muted); font-weight: 700; background: #f8fafc; border-bottom: 1px solid var(--border); }
.offers-table-v2 td { padding: 14px 12px; border-bottom: 1px solid #f1f5f9; font-size: 14px; vertical-align: middle; }
.offers-table-v2 tr:last-child td { border-bottom: 0; }
.offers-table-v2 tr.best-row { background: #f0fdf4; }
.offers-table-v2 tr.best-row:hover { background: #dcfce7; }
.best-badge { background: #16a34a; color: #fff; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.buy-btn { display: inline-block; background: #f1f5f9; color: #334155; padding: 9px 16px; border-radius: 8px; font-weight: 700; font-size: 13px; text-decoration: none; transition: .2s; white-space: nowrap; }
.buy-btn:hover { background: #e2e8f0; }
.buy-btn.primary { background: #16a34a; color: #fff; }
.buy-btn.primary:hover { background: #15803d; }

/* Sticky buy */
.sticky-buy { position: fixed; bottom: 0; right: 0; left: 0; background: #fff; border-top: 1px solid var(--border); padding: 10px 16px max(10px, env(safe-area-inset-bottom)); box-shadow: 0 -4px 20px rgba(0,0,0,.1); z-index: 95; display: none; align-items: center; gap: 12px; }
.sticky-buy .price-info { flex: 1; }
.sticky-buy .price-info .from { font-size: 11px; color: var(--muted); }
.sticky-buy .price-info .amt { font-size: 16px; font-weight: 900; color: #dc2626; }
.sticky-buy .go { background: #16a34a; color: #fff; padding: 12px 24px; border-radius: 10px; font-weight: 800; font-size: 14px; text-decoration: none; white-space: nowrap; }
@media (max-width: 720px) { .sticky-buy { display: flex; } body { padding-bottom: 80px; } }

/* Chart */
.chart-container { background: #fff; border-radius: 16px; }
.price-chart { width: 100%; height: auto; display: block; }

/* Responsive */
@media (max-width: 900px) {
  .product-detail { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .product-gallery { min-height: 240px; }
  .price-huge { font-size: 24px; }
  .product-info h1 { font-size: 1.15rem; }
}
@media (max-width: 720px) {
  .offers-table-v2 { font-size: 12px; }
  .offers-table-v2 th { padding: 10px 6px; font-size: 11px; }
  .offers-table-v2 td { padding: 10px 6px; font-size: 12px; }
  .offers-table-v2 th:nth-child(5), .offers-table-v2 td:nth-child(5) { display: none; }
  .offers-table-v2 th:nth-child(4), .offers-table-v2 td:nth-child(4) { display: none; }
  .buy-btn { padding: 7px 10px; font-size: 11px; }
}

/* Similar */
.similar-section { background: #fff; border-radius: 16px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
