/* ====== شركة الدقّة لصناعة وطحن الأعلاف ====== */
:root {
  --green: #008B5A;
  --green-dark: #006a45;
  --green-soft: #e6f4ee;
  --red: #E62E2E;
  --red-soft: #fdecec;
  --blue: #2F3D99;
  --blue-dark: #232e78;
  --blue-soft: #eceefa;
  --ink: #1d2333;
  --muted: #5c6475;
  --line: #e3e6ee;
  --bg: #f6f7fb;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(29, 35, 51, .18);
  --font: "Cairo", "Tahoma", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.4rem; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 700; text-decoration: none; transition: transform .15s, background .15s, box-shadow .15s;
  min-height: 46px;
}
.btn:active { transform: scale(.97); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-dark); }
.btn-red { background: var(--red); color: #fff; }
.btn-outline { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 72px; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand img { height: 48px; width: auto; }
.brand-text strong { display: block; font-size: 1.15rem; color: var(--blue); line-height: 1.2; }
.brand-text span { font-size: .78rem; color: var(--muted); }
.nav { display: flex; gap: .25rem; }
.nav a { text-decoration: none; padding: .5rem .85rem; border-radius: 10px; font-weight: 600; color: var(--ink); }
.nav a:hover { background: var(--green-soft); color: var(--green-dark); }
.header-cta { padding: .55rem 1rem; min-height: 40px; font-size: .95rem; }
.menu-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.menu-toggle svg { width: 28px; height: 28px; }

@media (max-width: 860px) {
  .nav {
    position: absolute; inset: 72px 0 auto 0; flex-direction: column;
    background: #fff; border-bottom: 1px solid var(--line); padding: .5rem 16px 1rem;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .8rem; }
  .menu-toggle { display: block; }
  .header-cta span { display: none; }
  .header-cta { padding: .55rem .7rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 110% -10%, var(--green-soft), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--blue-soft), transparent 60%),
    #fff;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 6px;
  background: linear-gradient(90deg, var(--green) 0 33.3%, var(--red) 33.3% 66.6%, var(--blue) 66.6%);
}
.hero-inner { display: grid; grid-template-columns: 1fr 1.25fr; gap: 2.5rem; align-items: center; padding: 3.5rem 0 3rem; }
.hero-logo { width: min(220px, 60%); margin-bottom: .75rem; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.35; margin: 0 0 .75rem; color: var(--blue); }
.hero h1 em { font-style: normal; color: var(--green); }
.slogan {
  display: inline-block; font-size: clamp(1.05rem, 2.4vw, 1.3rem); font-weight: 800;
  color: var(--red); background: var(--red-soft); padding: .35rem 1rem; border-radius: 12px; margin-bottom: 1rem;
}
.hero p { color: var(--muted); margin: 0 0 1.5rem; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-figure { position: relative; }
.hero-figure img { width: 100%; filter: drop-shadow(0 25px 30px rgba(29,35,51,.18)); }
.price-badge {
  display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.25rem;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .5rem .9rem;
  font-size: .9rem; color: var(--muted); box-shadow: var(--shadow);
}
.price-badge .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; padding: 2.25rem 0 2rem; gap: 1.5rem; }
  .hero-logo { margin-inline: auto; }
  .hero-actions { justify-content: center; }
}

/* ---------- Stats strip ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: -1.75rem; position: relative; z-index: 2; }
.feature { background: #fff; border-radius: 16px; padding: 1.1rem; box-shadow: var(--shadow); display: flex; gap: .8rem; align-items: center; }
.feature .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.feature .ic svg { width: 24px; height: 24px; }
.feature strong { display: block; font-size: 1rem; }
.feature span { font-size: .85rem; color: var(--muted); }
.ic-green { background: var(--green-soft); color: var(--green); }
.ic-red { background: var(--red-soft); color: var(--red); }
.ic-blue { background: var(--blue-soft); color: var(--blue); }
@media (max-width: 860px) { .features { grid-template-columns: 1fr 1fr; margin-top: 1.25rem; } }
@media (max-width: 460px) { .features { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
section { padding: 4rem 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 2rem; }
.eyebrow { color: var(--green); font-weight: 800; font-size: .9rem; letter-spacing: .02em; }
.section-head h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin: .25rem 0 .5rem; color: var(--blue); }
.section-head p { color: var(--muted); margin: 0; }

/* ---------- Product filters ---------- */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: 1.25rem; }
.chip {
  border: 1px solid var(--line); background: #fff; padding: .45rem 1rem; border-radius: 999px;
  font-weight: 700; cursor: pointer; color: var(--muted);
}
.chip[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.prices-updated { text-align: center; color: var(--muted); font-size: .92rem; margin: 0 0 1.75rem; }
.prices-updated strong { color: var(--ink); }

/* ---------- Product cards ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.product {
  --accent: var(--blue);
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s; scroll-margin-top: 90px;
}
.product:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product[data-cat="sheep"] { --accent: #6d6352; }
.product[data-cat="cattle"] { --accent: var(--red); }
.product[data-cat="poultry"] { --accent: var(--blue); }
.product[data-cat="other"] { --accent: var(--green); }
.product-media {
  background: linear-gradient(180deg, #f3f5f9, #fff); padding: 1.25rem 1.25rem .5rem;
  position: relative; height: 340px; overflow: hidden; border-bottom: 4px solid var(--accent);
}
.product-media img {
  position: absolute; inset: 1.25rem 1.25rem .5rem; width: calc(100% - 2.5rem); height: calc(100% - 1.75rem);
  max-width: none; object-fit: contain; filter: drop-shadow(0 12px 14px rgba(0,0,0,.15));
}
.product-media > span { position: absolute; inset: 0; display: grid; place-items: center; }
.product-body { padding: 1rem 1.15rem 1.15rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.product-cat { font-size: .78rem; font-weight: 800; color: var(--accent); }
.product h3 { margin: 0; font-size: 1.2rem; line-height: 1.4; }
.product .en { font-size: .8rem; color: var(--muted); direction: ltr; text-align: right; }
.product-meta { display: flex; gap: .5rem; flex-wrap: wrap; }
.tag { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .15rem .6rem; font-size: .85rem; font-weight: 700; }
.price-box {
  margin-top: auto; background: var(--green-soft); border-radius: 14px; padding: .75rem .9rem;
  display: flex; flex-direction: column; gap: .1rem;
}
.price-box .label { font-size: .8rem; color: var(--green-dark); font-weight: 700; }
.price-box .value { font-size: 1.6rem; font-weight: 800; color: var(--green-dark); line-height: 1.3; }
.price-box .value small { font-size: .95rem; font-weight: 700; }
.price-box .value.na { font-size: 1.05rem; color: var(--muted); }
.price-box .date { font-size: .78rem; color: var(--muted); }
.product .btn { width: 100%; }

@media (max-width: 600px) { .product-media { height: 280px; } }
.loading, .empty { text-align: center; color: var(--muted); padding: 2rem; grid-column: 1 / -1; }

/* ---------- About ---------- */
.about { background: #fff; border-block: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: center; }
.about h2 { color: var(--blue); font-size: clamp(1.5rem, 3vw, 2rem); margin: .25rem 0 1rem; }
.about p { color: var(--muted); }
.check-list { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .6rem; }
.check-list li { display: flex; gap: .6rem; align-items: flex-start; }
.check-list li::before {
  content: ""; width: 22px; height: 22px; flex: none; margin-top: .25rem; border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.location-card {
  border-radius: var(--radius); padding: 1.75rem; color: #fff;
  background: linear-gradient(145deg, var(--blue), var(--blue-dark));
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.location-card::after {
  content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,.07); inset: auto auto -80px -60px;
}
.location-card h3 { margin: 0 0 .5rem; font-size: 1.3rem; }
.location-card p { color: rgba(255,255,255,.85); margin: 0 0 1.25rem; }
.location-card .btn { background: #fff; color: var(--blue); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; text-align: center; }
.contact-card .ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto .75rem; }
.contact-card .ic svg { width: 28px; height: 28px; }
.contact-card h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.contact-card a.num { display: block; direction: ltr; font-weight: 800; font-size: 1.2rem; text-decoration: none; color: var(--ink); }
.contact-card a.num:hover { color: var(--green); }
.contact-card p { color: var(--muted); margin: 0 0 1rem; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: #151a2b; color: rgba(255,255,255,.75); padding: 2.5rem 0 1.5rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
.footer-brand { display: flex; gap: .75rem; align-items: center; }
.footer-brand img { height: 56px; background: #fff; border-radius: 12px; padding: 6px; }
.footer-brand strong { color: #fff; display: block; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 1.5rem; padding-top: 1rem; font-size: .85rem; text-align: center; }

/* ---------- Floating WhatsApp ---------- */
.wa-float {
  position: fixed; left: 18px; bottom: 18px; z-index: 60;
  width: 60px; height: 60px; border-radius: 50%; background: #25D366; color: #fff;
  display: grid; place-items: center; box-shadow: 0 10px 25px rgba(37,211,102,.45);
}
.wa-float svg { width: 32px; height: 32px; }
.wa-float[hidden] { display: none; }

/* =================== ADMIN =================== */
.admin-body { background: var(--bg); padding-bottom: 110px; }
.admin-top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.admin-top .header-inner { height: 64px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: #fff; border-radius: 22px; padding: 2rem 1.5rem; width: min(420px, 100%); box-shadow: var(--shadow); border-top: 6px solid var(--green); }
.login-card img { width: 160px; margin: 0 auto 1rem; }
.login-card h1 { text-align: center; font-size: 1.35rem; margin: 0 0 1.25rem; color: var(--blue); }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.field label { font-weight: 700; font-size: .9rem; }
.field input, .field select, .field textarea {
  border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem .85rem; background: #fff; width: 100%;
  min-height: 46px; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.field input[type="number"], .ltr { direction: ltr; text-align: right; }
.hint { font-size: .8rem; color: var(--muted); }
.alert { border-radius: 12px; padding: .75rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.alert-error { background: var(--red-soft); color: #a51d1d; }
.alert-ok { background: var(--green-soft); color: var(--green-dark); }
.alert-info { background: var(--blue-soft); color: var(--blue-dark); }

.admin-main { padding: 1.5rem 0; }
.admin-section { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 1.25rem; margin-bottom: 1.25rem; }
.admin-section > h2 { margin: 0 0 1rem; font-size: 1.2rem; color: var(--blue); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.edit-card { border: 1.5px solid var(--line); border-radius: 16px; padding: 1rem; background: #fff; position: relative; }
.edit-card.dirty { border-color: #f0b429; box-shadow: 0 0 0 3px #fff5d6; }
.edit-card.is-new { border-style: dashed; border-color: var(--green); }
.edit-card .badge { position: absolute; top: .6rem; left: .6rem; font-size: .72rem; font-weight: 800; padding: .1rem .55rem; border-radius: 999px; }
.badge-dirty { background: #fff0c2; color: #8a5a00; }
.badge-new { background: var(--green-soft); color: var(--green-dark); }
.edit-img { display: flex; gap: .85rem; align-items: center; margin-bottom: .85rem; }
.edit-img img { width: 84px; height: 110px; object-fit: contain; background: var(--bg); border-radius: 10px; }
.edit-img .ph { width: 84px; height: 110px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; color: var(--muted); font-size: .75rem; text-align: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.price-field input { font-size: 1.35rem; font-weight: 800; color: var(--green-dark); border-color: var(--green); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.switch { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .9rem; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--green); }
.card-actions { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; gap: .5rem; }
.btn-del { background: none; border: 0; color: var(--red); font-weight: 700; cursor: pointer; padding: .5rem; }
.meta-line { font-size: .78rem; color: var(--muted); }

.save-bar {
  position: fixed; inset: auto 0 0 0; z-index: 45; background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(29,35,51,.08); padding: .75rem 0;
}
.save-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.save-status { font-size: .9rem; color: var(--muted); }
.save-status strong { color: var(--ink); }
.save-bar .btn { min-width: 170px; font-size: 1.05rem; }
@media (max-width: 520px) {
  .save-bar .container { flex-direction: column; align-items: stretch; gap: .5rem; text-align: center; }
  .save-bar .btn { width: 100%; }
}
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 70;
  padding: .8rem 1.2rem; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
}
