/* Maktoob — site chrome (Batch 6): the cookie banner and settings dialog, the country prompt, the offline banner,
   and the footer's seller line and "Cookie settings" button. Loaded on every page, English and Arabic. */

/* ---------- the cookie banner and the country prompt: a bottom card, inset from the start edge ---------- */
.ck {
  position: fixed; z-index: 85; inset-inline-start: 24px; bottom: 24px; width: min(460px, calc(100vw - 48px));
  display: grid; gap: 16px; padding: 22px 22px 20px; border-radius: var(--r-lg);
  background: var(--white); color: var(--ink); box-shadow: var(--e3), 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
  font: 400 14.5px/1.55 var(--f-ui); text-align: start;
}
/* the card is lang="en" dir="ltr" on Arabic pages, but it still sits at the page's start edge (the right) */
html[dir="rtl"] .ck { inset-inline-start: auto; left: auto; right: 24px; }
.ck__b { display: grid; gap: 6px; }
.ck__t { display: flex; align-items: center; gap: 8px; font: 700 17px/1.3 var(--f-ui); letter-spacing: -.01em; }
.ck__t svg { width: 20px; height: 20px; flex: none; color: var(--blue); }
.ck__p { color: var(--ink-2); }
.ck__p .link { font-size: inherit; white-space: nowrap; }
.ck__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ck__acts .btn { flex: 1 1 auto; }
.ck--country { border-top: 3px solid var(--blue); }
/* a bottom card lifts the toast and the Demo pill above it (--ck-h is set by js/chrome.js) */
body:has(.ck) .toast { bottom: calc(var(--ck-h, 0px) + 40px); }
body:has(.ck) .demo-pill { bottom: calc(var(--ck-h, 0px) + 32px); }
@media (max-width: 600px) {
  .ck, html[dir="rtl"] .ck { left: 12px; right: 12px; bottom: 12px; width: auto; max-height: calc(100svh - 96px); overflow: auto; padding: 18px 18px 16px; gap: 14px; }
  .ck__t { font-size: 16px; }
  .ck__p { font-size: 14px; }
  .ck__acts { flex-direction: column; }
  .ck__acts .btn { width: 100%; height: 44px; }
  body:has(.ck) .toast { bottom: calc(var(--ck-h, 0px) + 24px); }
  body:has(.ck) .demo-pill { bottom: calc(var(--ck-h, 0px) + 20px); }
}
@media (prefers-reduced-motion: no-preference) {
  .ck { animation: ck-in 420ms var(--ease-out) both; }
  @keyframes ck-in { from { opacity: 0; transform: translateY(16px); } }
}

/* ---------- the cookie settings dialog ---------- */
.ck-dlg { width: min(560px, calc(100vw - 32px)); }
.ck-rows { display: grid; }
.ck-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 18px; padding: 16px 0; border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.ck-row:last-child { border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.ck-row__b { display: grid; gap: 4px; }
.dlg .ck-row__k { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 700 15.5px/1.3 var(--f-ui); color: var(--ink); }
.dlg .ck-row__s { font-size: 14px; line-height: 1.5; }
.ck-row__on { font: 600 12px/1 var(--f-ui); padding: 4px 8px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--ink); }
.ck-row .switch { margin-top: 2px; }
.ck-row .switch::before { content: ''; position: absolute; inset: -9px -4px; } /* 44 px touch target */
@media (max-width: 600px) {
  .ck-dlg form { padding: var(--s5); }
  .ck-dlg .dlg__acts .btn { flex: 1 1 100%; }
}

/* ---------- the offline banner (inside the fixed header, under its bar) ---------- */
.ck-off { justify-content: center; }
.ck-off .link { font-size: 14px; }
.hdr .ck-off { color: var(--ink); }

/* ---------- footer: the seller line, the legal links, the "Cookie settings" button ---------- */
.foot__base { gap: 8px 32px; flex-wrap: wrap; align-items: baseline; }
.foot__seller { max-width: 72ch; }
.foot__seller [dir="ltr"] { unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.foot__legal { display: flex; flex-wrap: wrap; align-items: baseline; }
.foot__legal > span[aria-hidden] { padding-inline: .5em; white-space: pre; }
.foot__btn {
  padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: none;
}
.foot__btn:hover { color: var(--white); }
.foot__btn:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 2px; }
@media (max-width: 600px) {
  .foot__base { gap: 12px; }
  .foot__legal a, .foot__btn { display: inline-flex; align-items: center; min-height: 44px; }
}
