:root{
  /* Light Theme */
  --bg:#ffffff;
  --card:#ffffff;
  --muted:#6b7280;
  --text:#111827;

  --accent:#14b8a6;
  --accent2:#3b82f6;
  --danger:#ef4444;

  --shadow: 0 18px 50px rgba(17,24,39,.10);
  --radius: 18px;

  /* extra helpers */
  --border: rgba(17,24,39,.10);
  --soft: rgba(17,24,39,.04);
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans Arabic", "Noto Sans", sans-serif;

  /* White background with very soft gradients */
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(59,130,246,.12), transparent 60%),
    radial-gradient(900px 600px at 10% 10%, rgba(20,184,166,.10), transparent 55%),
    #ffffff;

  color: var(--text);
}

a{color:inherit;text-decoration:none}
.container{width:min(1120px, 92%);margin:0 auto}

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:.5rem;
  padding:.7rem 1rem;
  border-radius: 14px;
  border:1px solid var(--border);
  background: #ffffff;
  color:var(--text);
  cursor:pointer;
  transition: .2s;
  box-shadow: 0 10px 26px rgba(17,24,39,.06);
}
.btn:hover{transform: translateY(-1px); border-color: rgba(17,24,39,.16)}
.btn.primary{
  background: linear-gradient(135deg, rgba(20,184,166,.14), rgba(59,130,246,.14));
  border-color: rgba(20,184,166,.28);
}
.btn.danger{
  border-color: rgba(239,68,68,.30);
  background: rgba(239,68,68,.10);
}

/* Badges */
.badge{
  font-size:.75rem;
  padding:.25rem .55rem;
  border-radius:999px;
  border:1px solid var(--border);
  color:var(--muted);
  background: rgba(255,255,255,.9);
}

/* Cards */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Header */
header.site-header{
  position:sticky; top:0; z-index:100;
  backdrop-filter: blur(14px);

  /* White glass header */
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid var(--border);
}

.navbar{
  display:flex; align-items:center; gap:1rem;
  padding:.85rem 0;
}

.brand{
  display:flex; align-items:center; gap:.6rem; font-weight:700;
  letter-spacing:.2px;
}

.brand .logo{
  width:38px;height:38px;border-radius:14px;
  background: linear-gradient(135deg, rgba(20,184,166,.55), rgba(59,130,246,.55));
  display:grid; place-items:center;
  box-shadow: 0 12px 35px rgba(59,130,246,.18);
}

.nav-right{margin-left:auto; display:flex; align-items:center; gap:.6rem; flex-wrap:wrap}

/* Search */
.search{
  display:flex; align-items:center; gap:.5rem;
  padding:.55rem .8rem; border-radius:14px;
  border:1px solid var(--border);
  background: rgba(17,24,39,.03);
}
.search input{
  background:transparent; border:0; outline:0; color:var(--text);
  width: min(280px, 45vw);
}

/* Dropdown */
.dropdown{position:relative}
.dropdown > button{white-space:nowrap}
.dropdown-menu{
  position:absolute; top:calc(100% + .6rem); right:0;
  width: 260px;
  padding:.6rem;
  display:none;
}
.dropdown.open .dropdown-menu{display:block}

.menu-item{
  display:flex; justify-content:space-between; align-items:center;
  padding:.55rem .7rem; border-radius:12px;
  color:var(--text);
  border:1px solid transparent;
}
.menu-item:hover{
  background: rgba(17,24,39,.04);
  border-color: var(--border);
}

/* Hero */
.hero{margin: 1.1rem 0 1.3rem; overflow:hidden}
.hero-grid{display:grid; grid-template-columns: 1.2fr .8fr; gap:1rem}
@media (max-width: 880px){
  .hero-grid{grid-template-columns:1fr}
  .search input{width: 48vw}
}

/* Slider */
.slider{
  position:relative;
  min-height: 320px;
  overflow:hidden;
}
.slide{
  position:absolute; inset:0;
  opacity:0; transform: scale(1.02);
  transition: .45s ease;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:1rem;
  padding: 1.3rem;
}
.slide.active{opacity:1; transform: none}

.slide .text{align-self:center}
.slide h1{margin:.15rem 0 .4rem; font-size: 2rem; line-height:1.2}
.slide p{margin:0 0 .9rem; color: var(--muted)}

.slide .img{
  border-radius: 18px;
  overflow:hidden;
  border: 1px solid var(--border);
  background: rgba(17,24,39,.03);
}
.slide .img img{width:100%; height:100%; object-fit:cover; display:block}

.slider-dots{position:absolute; left:1rem; bottom:1rem; display:flex; gap:.4rem}
.dot{width:10px;height:10px;border-radius:999px; background: rgba(17,24,39,.22); cursor:pointer}
.dot.active{background: rgba(20,184,166,.85)}

/* Hero side ads */
.hero-side{padding: 1.1rem}
.hero-side h3{margin:.2rem 0 .6rem}

.hero-side .ad{
  display:flex; gap:.85rem; align-items:center;
  padding:.7rem; border-radius:16px;
  border:1px solid var(--border);
  background: rgba(17,24,39,.03);
}
.hero-side .ad img{
  width:68px;height:68px;border-radius:14px; object-fit:cover;
  border:1px solid var(--border)
}

/* Grid */
.grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 980px){ .grid{grid-template-columns: repeat(3,1fr)} }
@media (max-width: 720px){ .grid{grid-template-columns: repeat(2,1fr)} }
@media (max-width: 460px){ .grid{grid-template-columns: 1fr} }

/* Product cards */
.product{padding: .9rem}
.product .thumb{
  height: 150px;
  border-radius: 16px;
  overflow:hidden;
  border:1px solid var(--border);
  background: rgba(17,24,39,.03);
}
.product .thumb img{width:100%;height:100%;object-fit:cover; display:block}
.product h4{margin:.65rem 0 .35rem; font-size: 1rem}
.product .meta{display:flex; justify-content:space-between; align-items:center; color:var(--muted); font-size:.9rem}
.product .price{font-weight:800; color: var(--text)}

/* Titles */
.section-title{display:flex; justify-content:space-between; align-items:center; margin: 1.2rem 0 .7rem}
.section-title h2{margin:0; font-size:1.35rem}

/* Footer */
.footer{
  margin-top: 2rem;
  padding: 1.5rem 0;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* Forms */
.form{padding: 1.1rem}

.input, select, textarea{
  width:100%;
  padding: .7rem .85rem;
  border-radius: 14px;
  border:1px solid var(--border);
  background: #ffffff;
  color:var(--text);
  outline: none;
  box-shadow: 0 10px 26px rgba(17,24,39,.05);
}
.input:focus, select:focus, textarea:focus{
  border-color: rgba(59,130,246,.35);
  box-shadow: 0 12px 32px rgba(59,130,246,.12);
}
label{display:block; margin:.6rem 0 .25rem; color: var(--muted)}

/* Tables */
.table{width:100%; border-collapse: collapse; overflow:hidden}
.table th, .table td{
  padding:.7rem;
  border-bottom:1px solid var(--border);
  text-align:right
}
.table th{color: var(--muted); font-weight:600}

/* Notices */
.notice{
  padding:.8rem 1rem; border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(17,24,39,.03);
  margin: .7rem 0;
}
.notice.success{border-color: rgba(20,184,166,.32); background: rgba(20,184,166,.08)}
.notice.error{border-color: rgba(239,68,68,.28); background: rgba(239,68,68,.08)}

/* KPIs */
.kpis{display:grid; grid-template-columns: repeat(4,1fr); gap:1rem}
@media (max-width: 900px){ .kpis{grid-template-columns: repeat(2,1fr)} }
.kpi{padding:1rem}
.kpi .v{font-size:1.35rem; font-weight:800}
.kpi .k{color:var(--muted); font-size:.9rem}

/* ===== Better Product Cards ===== */

/* خلي الجريد مرن أكتر */
.grid{
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 980px){ .grid{ grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 720px){ .grid{ grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 460px){ .grid{ grid-template-columns: 1fr; } }

/* كرت المنتج نفسه */
.product{
  padding: 12px;
  display:flex;
  flex-direction: column;
  gap: 10px;
  transition: .2s;
}
.product.card{ /* لو الكرت واخد class card + product */
  box-shadow: 0 10px 30px rgba(17,24,39,.08);
}
.product:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(17,24,39,.12);
}

/* thumbnail ثابت الشكل */
.product .thumb{
  height: auto;              /* ألغي الارتفاع القديم */
  aspect-ratio: 4 / 3;       /* نسبة ثابتة */
  border-radius: 16px;
  overflow:hidden;
  background: #f3f4f6;       /* خلفية فاتحة */
  border: 1px solid rgba(17,24,39,.10);
  display:flex;
  align-items:center;
  justify-content:center;
}
.product .thumb img{
  width: 100%;
  height: 100%;
  object-fit: contain;       /* مهم: يخلي كل الصور متناسقة بدون قص */
  padding: 10px;             /* مساحة بسيطة حوالين المنتج */
  display:block;
}

/* العنوان: سطرين بس */
.product h4{
  margin:0;
  font-size: 0.98rem;
  line-height: 1.25;
  min-height: 2.5em;         /* يضمن محاذاة موحدة */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ميتا السعر + زرار */
.product .meta{
  margin-top: auto;          /* يخلي السعر دايمًا تحت */
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap:10px;
  color: var(--muted);
  font-size: .9rem;
}

.product .price{
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--text);
}

/* لو عندك زر داخل الكرت خلي شكله صغير وشيك */
.product .meta .btn{
  padding: .55rem .75rem;
  border-radius: 12px;
}
