:root {
  color-scheme: light;

  --bg: #f6fbfa;
  --surface: #ffffff;
  --surface2: #eef7f5;
  --text: #071a20;
  --muted: #4e646b;
  --border: rgba(7, 26, 32, 0.1);

  --brand: #0f766e;
  --brand2: #115e59;

  --radius: 18px;
  --shadow: 0 16px 42px rgba(10, 30, 30, 0.1);

  --max: 1120px;

  /* used for sticky offsets (product page + cart summary + anchor jump) */
  --header-h: 76px;
  --sticky-gap: 14px;
  --sticky-offset: calc(var(--header-h) + var(--sticky-gap));
}

@media (max-width: 640px) {
  :root {
    --header-h: 68px;
    --sticky-gap: 12px;
  }
}

/* =========================
   Base
   ========================= */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  direction: rtl;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Tahoma,
    Arial;
  background:
    radial-gradient(
      1200px 600px at 10% 0%,
      rgba(15, 118, 110, 0.1),
      transparent 60%
    ),
    radial-gradient(
      1000px 500px at 90% 10%,
      rgba(17, 94, 89, 0.08),
      transparent 60%
    ),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px;
}

a {
  color: inherit;
  text-decoration: none;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.num {
  direction: ltr;
  unicode-bidi: plaintext;
}

/* anchors (so sections don’t hide behind sticky header) */
[id] {
  scroll-margin-top: var(--sticky-offset);
}

/* =========================
   Page layout (IMPORTANT for sticky on iPhone)
   ========================= */
.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto; /* topbar, header, main, footer */
}
.page > main.container {
  min-height: 0;
}

/* =========================
   Accessibility
   ========================= */
.skip-link {
  position: absolute;
  right: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  right: 18px;
  top: 12px;
  width: auto;
  height: auto;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  z-index: 9999;
}
:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--brand) 70%, white);
  outline-offset: 3px;
  border-radius: 12px;
}

/* =========================
   Primitives
   ========================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-color: transparent;
  color: #fff;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
}
.textarea {
  resize: vertical;
  min-height: 92px;
}

/* =========================
   Topbar (NOT sticky — header is sticky)
   ========================= */
.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(246, 251, 250, 0.7);
  backdrop-filter: blur(10px) saturate(140%);
  z-index: 10;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 900;
  font-size: 13px;
  min-width: 0;
}
.toppill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
}
.topsep {
  color: color-mix(in oklab, var(--muted) 70%, transparent);
}

.topbar-details {
  position: relative;
  flex: 0 0 auto;
}
.topbar-summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 950;
  font-size: 13px;
  white-space: nowrap;
}
.topbar-summary::-webkit-details-marker {
  display: none;
}

/* dropdown */
.topbar-pop {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  width: min(360px, calc(100vw - 36px));
  z-index: 999;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 10px;
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 6px;
}
.topbar-row + .topbar-row {
  border-top: 1px solid var(--border);
}
.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-weight: 950;
  font-size: 12px;
}
.pill.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-color: transparent;
  color: #fff;
}
.topbar-note {
  padding: 8px 6px 4px;
}

/* Mobile topbar: compact + popup as overlay (prevents stretching) */
@media (max-width: 640px) {
  .topbar-inner {
    padding: 8px 18px;
    gap: 8px;
  }
  .topsep {
    display: none;
  }
  .toppill {
    padding: 6px 8px;
    font-size: 12px;
  }
  /* show only orders pill on small screens (cleaner) */
  .toppill:last-of-type {
    display: none;
  }

  /* popup becomes fixed overlay */
  .topbar-pop {
    position: fixed;
    left: 12px;
    right: 12px;
    top: calc(12px + env(safe-area-inset-top) + 52px);
    width: auto;
    max-width: none;
  }
  .topbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .topbar-actions {
    width: 100%;
  }
  .pill {
    flex: 1;
  }
  .topbar-row .num {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* =========================
   Header (THIS is sticky always)
   ========================= */
.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(246, 251, 250, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 950;
  min-width: 0;
}
.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--brand);
  flex: 0 0 auto;
}
.brand-name {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-link {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.nav-link:hover {
  border-color: var(--border);
  background: var(--surface);
}
.cart-badge {
  margin-inline-start: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 420px) {
  .brand-name {
    font-size: 14px;
  }
  .nav-link {
    padding: 9px 10px;
  }
}

/* =========================
   Footer
   ========================= */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 28px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
}
.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* =========================
   Hero
   ========================= */
.hero {
  margin: 12px 0 16px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(
      1200px 500px at 20% 0%,
      rgba(15, 118, 110, 0.14),
      transparent 60%
    ),
    radial-gradient(
      900px 400px at 90% 30%,
      rgba(17, 94, 89, 0.1),
      transparent 60%
    ),
    url("/animals.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
.hero-inner {
  padding: 18px;
}
.hero-title {
  margin: 0 0 8px;
  font-size: 28px;
}
.hero-sub {
  margin: 0 0 14px;
}
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================
   Home panels (About / Consult / etc)
   ========================= */
.panel,
.section,
.info {
  padding: 16px;
  margin: 0 0 16px;
  box-shadow: none;
}

.panel-head,
.section-head,
.info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.panel-title,
.section-title,
.info-title {
  margin: 0;
  font-size: 16px;
  font-weight: 950;
}
.panel-sub,
.section-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.panel-body p,
.section-body p {
  margin: 10px 0 0;
}

.panel-grid,
.section-grid,
.info-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 900px) {
  .panel-grid,
  .section-grid,
  .info-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.tile,
.mini,
.info-box {
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 16px;
  padding: 12px;
}

.tile-k,
.mini-k,
.info-k {
  font-weight: 950;
  margin-bottom: 6px;
}

/* =========================
   Filters toolbar
   ========================= */
.toolbar {
  padding: 14px;
  margin: 0 0 16px;
}
.toolbar-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 900px) {
  .toolbar-row {
    grid-template-columns: 1.3fr 1fr 1fr 1fr; /* q + dep + cat + sort */
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.label {
  font-size: 12px;
  font-weight: 950;
  color: var(--muted);
}
.toolbar-foot {
  margin-top: 10px;
  font-size: 13px;
}

/* =========================
   Products grid + cards
   ========================= */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}
.grid-item {
  display: flex;
}
.grid-item > .product-card {
  width: 100%;
}

.product-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 12px;
  background: var(--surface2);
  overflow: hidden;
}
.product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.product-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.product-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.product-info {
  min-width: 0;
}
.product-name {
  font-weight: 950;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-meta {
  font-size: 12px;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.price {
  font-weight: 950;
  white-space: nowrap;
}
.product-variant {
  display: grid;
  gap: 8px;
}
.product-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* =========================
   Product page
   ========================= */
.product-page {
  overflow: hidden;
}
.product-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 900px) {
  .product-layout {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.product-media-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-page-img {
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
  object-position: center;
  display: block;
}

.product-info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: var(--sticky-offset);
}

.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.breadcrumb a {
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--muted) 50%, transparent);
}

.product-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
}

/* Product extra blocks (desc etc) */
.pstack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.psub {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.pdesc {
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 16px;
  padding: 12px 14px;
}
.pdesc-title {
  font-weight: 950;
  margin-bottom: 6px;
}

.product-price-big {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-weight: 950;
}
.product-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}
.product-actions-wide {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.product-help {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed color-mix(in oklab, var(--brand) 35%, transparent);
  background: color-mix(in oklab, var(--surface2) 85%, white);
  color: var(--muted);
  font-size: 13px;
}

/* =========================
   Cart
   ========================= */
.cart {
  padding: 18px;
}
.cart-title {
  margin: 0;
}
.cart-head {
  margin-bottom: 12px;
}
.cart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 900px) {
  .cart-grid {
    grid-template-columns: 1.6fr 0.9fr;
  }
}
.cart-items {
  display: grid;
  gap: 10px;
}
.cart-item {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.cart-item-name {
  font-weight: 950;
}
.cart-item-meta {
  font-size: 12px;
  margin-top: 6px;
}
.cart-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qty {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.qty button {
  border: 0;
  background: var(--surface2);
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  font-weight: 950;
}
.qty span {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  font-weight: 950;
  min-width: 40px;
  justify-content: center;
}

.cart-summary {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  position: sticky;
  top: var(--sticky-offset);
  height: fit-content;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.summary-form {
  margin: 12px 0;
}

/* =========================
   Toast
   ========================= */
.toast-host {
  position: fixed;
  left: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 9999;
  max-width: min(360px, calc(100vw - 36px));
}
.toast {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 900;
}

/* =========================
   Docs / privacy pages
   ========================= */
.doc {
  padding: 18px;
}
.doc h1 {
  margin: 0 0 10px;
}
.doc-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 900px) {
  .doc-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.doc-box {
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 16px;
  padding: 14px;
}
.doc-box h2 {
  margin: 0 0 8px;
  font-size: 16px;
}
.doc-sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
/* =========================
   Departments chips (cats) — premium styling
   ========================= */
.cats {
  padding: 16px;
  margin: 0 0 16px;
  box-shadow: none;
}

.cats-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.cats-title {
  margin: 0;
  font-size: 16px;
  font-weight: 950;
}

.cats-sub {
  font-size: 13px;
}

.cats-row {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ✅ make chips look consistent + not cramped */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 950;
  font-size: 13px;
  line-height: 1;
  transition:
    transform 0.12s ease,
    background 0.12s ease,
    border-color 0.12s ease;
  white-space: nowrap;
}

.chip:hover {
  transform: translateY(-1px);
  background: color-mix(in oklab, var(--surface2) 70%, white);
  border-color: color-mix(in oklab, var(--brand) 18%, var(--border));
}

/* optional “active” state if you later add it */
.chip[aria-current="true"] {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-color: transparent;
  color: #fff;
}

/* ✅ mobile: make chips easier to tap */
@media (max-width: 640px) {
  .cats {
    padding: 14px;
  }
  .cats-row {
    gap: 8px;
  }
  .chip {
    padding: 11px 14px;
    font-size: 14px;
  }
}
/* chips: match theme (not pure white) */
.chip {
  background: color-mix(in oklab, var(--surface2) 78%, white); /* soft mint */
  border-color: color-mix(in oklab, var(--border) 85%, transparent);
}

.chip:hover {
  background: color-mix(
    in oklab,
    var(--surface2) 55%,
    white
  ); /* slightly brighter on hover */
  border-color: color-mix(in oklab, var(--brand) 20%, var(--border));
}
/* FIX: Topbar popup hidden under sticky header (mobile) */
@media (max-width: 640px) {
  :root {
    --topbar-h-mobile: 44px; /* تقريبًا ارتفاع topbar على الموبايل */
  }

  .topbar-pop {
    /* نزل الـpopup تحت topbar + header عشان ميغطيش */
    top: calc(
      env(safe-area-inset-top) + 12px + var(--topbar-h-mobile) + var(--header-h)
    );
    z-index: 2000;
  }

  .site-header {
    z-index: 900; /* أقل من الـpopup */
  }
}
/* ================================
   Topbar dropdown always ABOVE header
   ================================ */
.topbar {
  z-index: 5000 !important;
  position: relative !important;
}
.site-header {
  z-index: 4000 !important;
}
.topbar-pop {
  z-index: 6000 !important;
}
/* consultations contacts layout */
/* consultations contacts layout — CLEAN (no accents, no decorations) */
.contact-list {
  display: grid;
  gap: 10px;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;

  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface2) 72%, white);
  border-radius: 16px;
  padding: 12px 12px;

  box-shadow: 0 8px 18px rgba(10, 30, 30, 0.05);
}

.contact-num {
  font-weight: 950;
  letter-spacing: 0.2px;
}

.contact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .contact-item {
    flex-direction: column;
    align-items: stretch;
  }
  .contact-actions {
    width: 100%;
  }
  .contact-actions .pill {
    flex: 1;
  }
}
@media (max-width: 640px) {
  .contact-num {
    text-align: right;
    align-self: flex-end; /* keeps it on the right side in the column layout */
    width: 100%;
  }
}
/* Topbar dropdown — mobile: number on the right + pro layout */
@media (max-width: 640px) {
  .topbar-row .num {
    width: 100%;
    text-align: right; /* ✅ right aligned */
    align-self: flex-end; /* ✅ stick to the right in column layout */
    font-weight: 950;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .pill {
    flex: 1; /* ✅ equal buttons width */
  }
}
@media (max-width: 640px) {
  .topbar-pop {
    padding: 12px;
    border-radius: 18px;
  }
  .topbar-row {
    padding: 10px 6px;
  }
}
