/* Gelato Lab: base styles. A neutral, working layer until the final design templates arrive.
   Uses logical properties (margin-inline, inset-inline...) so Arabic mirrors automatically. */

:root {
  --bg: #f6f1e9;          /* warm off-white */
  --surface: #fffdf9;
  --surface-alt: #efe7da;
  --ink: #2b211c;         /* dark chocolate */
  --muted: #6d6058;
  --line: #e2d8c9;
  --brand: #2e6b4f;       /* buttons and links: dark enough for white text */
  --logo-green: #99d420;  /* the green of the logo file */
  --brand-ink: #ffffff;
  --danger: #a3261b;
  --success: #1f6b3a;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(43 33 28 / 6%), 0 8px 24px rgb(43 33 28 / 6%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Noto Kufi Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --container: 1120px;
}

/* The tagline font: close to "GELATO & CHOCOLATE" in the logo. SIL Open Font License (public/fonts). */
@font-face { font-family: "Questrial"; src: url("/fonts/questrial-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.65 var(--font); }
:lang(ar) body, body:lang(ar) { font-family: var(--font-ar); line-height: 1.85; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.narrow { max-width: 760px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -3rem; background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: 8px; z-index: 10; }
.skip-link:focus { top: 1rem; }

/* top bar with the language switch */
.topbar { background: var(--ink); color: #f6f1e9; font-size: .875rem; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 40px; }
.topbar-note { opacity: .85; }
.lang-switch { text-decoration: none; font-weight: 600; padding: .2rem .8rem; border: 1px solid rgb(246 241 233 / 45%); border-radius: 999px; }
.lang-switch:hover { background: rgb(246 241 233 / 12%); }

.site-header { background: var(--surface); border-block-end: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.3rem; text-decoration: none; letter-spacing: .02em; }
.nav { list-style: none; display: flex; gap: .25rem 1.25rem; margin: 0; padding: 0; flex-wrap: wrap; align-items: center; }
.nav a { text-decoration: none; font-weight: 500; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav .nav-cta { background: var(--brand); color: var(--brand-ink); padding: .45rem 1rem; border-radius: 999px; }
.nav .nav-cta:hover { text-decoration: none; filter: brightness(1.08); }

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-alt { background: var(--surface-alt); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--brand); margin-bottom: .5rem; }
:lang(ar) .eyebrow { letter-spacing: 0; text-transform: none; font-size: .95rem; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: .6rem 1.4rem; border-radius: 999px; border: 2px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--ink); color: #fff; }
.btn-ghost { border-color: currentColor; background: transparent; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .65; cursor: progress; }
.link-button { background: none; border: 0; padding: 0; color: var(--danger); font: inherit; font-size: .875rem; text-decoration: underline; cursor: pointer; }

/* home */

/* contact + forms */
.page-head { padding-block-end: 1rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.tabs a { text-decoration: none; padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; }
.form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: grid; gap: .35rem; }
label, legend { font-weight: 600; }
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: .7rem .85rem; border: 1px solid #cfc3b2; border-radius: 10px; background: var(--surface); }
textarea { resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.hint { font-size: .875rem; color: var(--muted); margin: 0; }
.field-error { color: var(--danger); font-size: .875rem; font-weight: 600; margin: 0; }
.form-status { padding: .9rem 1.1rem; border-radius: 10px; background: #fdecea; color: var(--danger); font-weight: 600; }
.form-status.is-success { background: #e7f4ec; color: var(--success); }
.form-status p { margin: 0; }
.notice { background: #fff6e2; padding: .9rem 1.1rem; border-radius: 10px; }
.hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }

fieldset.step { border: 0; padding: 0; margin: 0 0 1.75rem; min-width: 0; }
.step legend { font-size: 1.1rem; margin-bottom: .75rem; padding: 0; }
.order-summary { position: sticky; top: 90px; background: var(--surface); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); display: grid; gap: .9rem; }
.order-summary h3 { margin: 0; }



.cart { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; padding-block-end: .75rem; border-block-end: 1px solid var(--line); }
.cart-text { display: grid; }
.cart-text small { color: var(--muted); }
.cart-price { font-weight: 700; white-space: nowrap; }
.totals { margin: 0; display: grid; gap: .35rem; }
.totals div { display: flex; justify-content: space-between; gap: 1rem; }
.totals dt { font-weight: 500; }
.totals dd { margin: 0; font-weight: 600; }
.totals .total { border-block-start: 2px solid var(--ink); padding-block-start: .5rem; font-size: 1.15rem; }
.fineprint { font-size: .8rem; color: var(--muted); margin: 0; }
.delivery-info { background: var(--surface-alt); border-radius: 10px; padding: .8rem 1rem; display: grid; gap: .2rem; }
.delivery-info p { margin: 0; }
.delivery-info span { color: var(--muted); }

/* home: five framed photos that slide down in turn, with the name in the middle */
.reel-hero { padding-block: clamp(1.4rem, 3.5vw, 2.75rem) clamp(.5rem, 1.5vw, 1rem); }
.reel { position: relative; width: min(100% - 2.5rem, var(--container)); margin-inline: auto; padding: 4px;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(.75rem, 1.6vw, 1.4rem); }
.reel-box { background: #000; border-radius: 4px; padding: clamp(3px, .45vw, 6px); outline: 1px solid #000; outline-offset: 3px; }
.reel-frame { position: relative; overflow: hidden; aspect-ratio: 3 / 4; border-radius: 2px; background: #000; }
.reel-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .8;
  transition: transform .9s cubic-bezier(.65, 0, .35, 1), opacity .7s ease; }
.reel-frame img.is-entering { transform: translateY(-100%); transition: none; }
.reel-frame img.is-leaving { transform: translateY(100%); }
.reel.is-calm .reel-frame img.is-entering, .reel.is-calm .reel-frame img.is-leaving { transform: none; opacity: 0; }
.reel-spot { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none; }
.lockup { margin: 0; display: grid; justify-items: center; gap: .35rem; text-align: center; font-family: var(--font); line-height: 1;
  padding: clamp(.9rem, 2vw, 1.5rem) clamp(1.5rem, 4vw, 3.25rem); background: rgb(255 253 249 / 95%);
  border-radius: 4px; outline: 1px solid #000; outline-offset: 3px; box-shadow: 0 18px 45px rgb(0 0 0 / 30%); pointer-events: auto; }
.lockup-name { color: var(--logo-green); font-size: clamp(2.3rem, 5.6vw, 4.75rem); font-weight: 800; letter-spacing: -.015em; }
/* styled like "GELATO & CHOCOLATE" under the logo: capitals, wide spacing (the padding re-centres the last letter's spacing) */
.lockup-tag { color: #000; font-family: "Questrial", "Century Gothic", Futura, var(--font); font-weight: 400; text-transform: uppercase;
  font-size: clamp(.7rem, 1.2vw, 1rem); letter-spacing: .3em; padding-left: .3em; line-height: 1.3; }
.reel-controls { width: min(100% - 2.5rem, var(--container)); margin: .9rem auto 0; display: flex; justify-content: flex-end; }
.reel-toggle { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid #000; background: var(--surface); color: #000;
  display: grid; place-items: center; cursor: pointer; }
.reel-toggle:hover { background: #000; color: #fff; }
.reel-toggle-icon { width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.reel-toggle.is-paused .reel-toggle-icon { width: 0; height: 0; border-block: 6px solid transparent; border-left: 10px solid currentColor; border-right: 0; margin-left: 3px; }

.gelato { background: var(--surface); border-block-start: 1px solid var(--line); }
.gelato-inner { max-width: 760px; }
.gelato h2 { text-align: center; margin-bottom: 1.4em; }
.gelato h2::after { content: ""; display: block; width: 56px; height: 3px; margin: .55em auto 0; border-radius: 2px; background: var(--logo-green); }
.gelato p { font-size: clamp(1.02rem, 1.4vw, 1.12rem); }

@media (max-width: 639px) {
  /* phones: three photos, the name, then two photos */
  .reel { width: min(100% - 1.5rem, var(--container)); grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: .9rem; }
  .reel-box { grid-column: span 2; }
  .reel-box:nth-child(4) { grid-column: 2 / span 2; grid-row: 3; }
  .reel-box:nth-child(5) { grid-column: 4 / span 2; grid-row: 3; }
  .reel-spot { position: relative; inset: auto; grid-column: 1 / -1; grid-row: 2; margin-block: -1.6rem; }
  .reel-controls { width: min(100% - 1.5rem, var(--container)); }
  .lockup-tag { letter-spacing: .2em; padding-left: .2em; }
}

/* private shop */
.brand-sub { font-weight: 500; color: var(--muted); font-size: .95rem; margin-inline-start: .35rem; }
.shop-head { padding-block-end: 1.5rem; }
.delivery-banner { margin-top: 1rem; max-width: 640px; }
.notice-closed { margin-top: 1rem; background: #fdecea; color: var(--danger); }
.notice-closed p { margin: .25rem 0 0; }
.h3 { font-size: 1.15rem; margin: 0; }
.shop-layout { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); align-items: start; }
.product-cat { margin: 1.75rem 0 .75rem; font-size: 1.2rem; }
.product-cat:first-child { margin-top: 0; }
.product-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.product { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.product-photo { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-alt); display: block; }
.product-body { padding: 1rem 1.1rem 1.1rem; display: grid; gap: .3rem; flex: 1; align-content: start; }
.product-name { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.product-unit, .product-meta { margin: 0; font-size: .85rem; color: var(--muted); }
.product-desc { margin: 0; font-size: .92rem; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .6rem; }
.product-price { font-variant-numeric: tabular-nums; }
/* Sold out: grey the photo only, so the text keeps full contrast */
.product.is-sold-out .product-photo { filter: grayscale(1); opacity: .55; }
.product.is-sold-out .product-price { color: var(--muted); }
.sold-out { font-size: .85rem; font-weight: 700; color: var(--danger); }
.btn-small { min-height: 38px; padding: .35rem 1rem; font-size: .92rem; }
.shop .cart-line { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
.stepper { display: inline-flex; align-items: center; border: 1px solid #cfc3b2; border-radius: 999px; background: var(--surface); }
.stepper button { width: 34px; height: 34px; border: 0; background: none; font: inherit; font-size: 1.1rem; cursor: pointer; color: inherit; }
.stepper button[disabled] { opacity: .35; cursor: not-allowed; }
.stepper span { min-width: 1.5rem; text-align: center; font-variant-numeric: tabular-nums; }

/* order result pages */
.status h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.status-paid h1 { color: var(--success); }
.summary { background: var(--surface); border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); display: grid; gap: .9rem; margin: 1.5rem 0 0; }
.summary dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
:lang(ar) .summary dt { text-transform: none; letter-spacing: 0; font-size: .9rem; }
.summary dd { margin: 0; }
.summary-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.summary-items li { display: grid; grid-template-columns: 1fr auto; }
.summary-items small { grid-column: 1; color: var(--muted); }
.summary-items strong { grid-row: 1; grid-column: 2; }

.site-footer { background: var(--ink); color: #d9cfc3; font-size: .9rem; padding-block: 2rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner p { margin: 0; }

@media (max-width: 860px) {
  .shop-layout { grid-template-columns: 1fr; }
  .order-summary { position: static; }
  .topbar-note { display: none; }
  .topbar-inner { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
