/* Ali Baba Southwick — site styles
   Colours and sizes follow the original alibabasouthwick.com theme. */

:root {
  --c-bg: #4a4a4a;          /* page background */
  --c-ink: #f7d009;         /* brand yellow, all text */
  --c-btn: #f4cd08;         /* primary button fill */
  --c-btn-hover: #ffd920;
  --c-panel: #625b3a;       /* olive panels: hours band, cards, footer */
  --c-panel-hover: #575133; /* darker on hover keeps yellow text above 4.5:1 */
  --c-line: #867833;        /* card borders, header rule */
  --c-muted: #d9c35a;       /* secondary text on the grey background */
  --c-placeholder: #5c5743; /* product image placeholder */
  --c-placeholder-icon: #a8933a;
  --c-white: #ffffff;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;

  --radius: 8px;
  --gutter: 24px;
  --max: 1200px;
  --header-h: 88px;
  --hero-min: 520px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent; /* no grey flash on tap; controls have their own :active state */
  color-scheme: dark;
  scrollbar-color: var(--c-line) var(--c-bg);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

h1, h2, h3, p { margin: 0; }

main { flex: 1 0 auto; }

[hidden] { display: none !important; }

/* Taps fire immediately: these never double-tap-zoom. */
a,
button { touch-action: manipulation; }

::selection { background: var(--c-ink); color: var(--c-bg); }

:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  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;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--c-btn);
  color: var(--c-bg);
  font-weight: 600;
  font-size: 14px;
}
.skip-link:focus { top: 16px; }

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  /* Keep content clear of the notch / Dynamic Island in landscape. */
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.icon { width: 16px; height: 16px; flex: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--c-btn);
  border-color: var(--c-btn);
  color: var(--c-bg);
}

.btn-panel {
  min-height: 48px;
  padding-inline: 16px;
  background: var(--c-panel);
  border-color: var(--c-panel);
  color: var(--c-ink);
  font-size: 13px;
  font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--c-btn-hover); border-color: var(--c-btn-hover); }
  .btn-panel:hover { background: var(--c-panel-hover); border-color: var(--c-panel-hover); }
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 20;
  /* In the installed iPhone app the status bar sits over the page: pad below it. */
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand { flex: none; border-radius: 50%; }
.brand img { width: 71px; height: 71px; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 20px;
}

.nav-link {
  padding: 6px 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color 150ms ease;
}
.nav-link[aria-current="page"] { text-decoration-color: currentColor; }
@media (hover: hover) and (pointer: fine) {
  .nav-link:hover { text-decoration-color: currentColor; }
}

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .js .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 48px;
    height: 48px;
    margin-right: -8px;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--c-ink);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 200ms var(--ease-out), opacity 150ms ease;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .js .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-line);
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    transition:
      opacity 180ms var(--ease-out),
      transform 180ms var(--ease-out),
      visibility 0s linear 180ms;
  }
  .js .site-nav.is-open {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition:
      opacity 180ms var(--ease-out),
      transform 180ms var(--ease-out),
      visibility 0s;
  }
  .js .site-nav .nav-link { padding: 12px 0; font-size: 16px; }
  .js .site-nav .btn { margin-top: 12px; font-size: 15px; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  min-height: max(var(--hero-min), calc(100vh - var(--header-h) - env(safe-area-inset-top, 0px)));
  min-height: max(var(--hero-min), calc(100svh - var(--header-h) - env(safe-area-inset-top, 0px)));
  overflow: hidden;
  background: var(--c-panel);
  color: var(--c-white);
}

.hero-media,
.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-media { z-index: -2; }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px var(--gutter) 48px;
  text-align: center;
}

.hero-title {
  font-size: clamp(32px, 1.6vw + 26px, 46px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}
.store-badges a {
  border-radius: 8px;
  transition: transform 160ms var(--ease-out);
}
.store-badges a:active { transform: scale(0.97); }
.store-badges img { width: auto; height: 46px; }

.hero-facts-bar { background: rgba(0, 0, 0, 0.4); }

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-block: 0;
  padding-block: 12px;
  list-style: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.hero-facts li { display: flex; align-items: center; gap: 8px; }
.hero-facts a { text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .hero-facts a:hover { text-decoration: underline; }
}

@media (max-width: 600px) {
  .hero-facts { flex-direction: column; gap: 8px; }
  .store-badges img { height: 44px; }
}

/* One authored moment: the photo settles while the title and actions rise in. */
@media (prefers-reduced-motion: no-preference) {
  .hero-media img { animation: hero-settle 1600ms var(--ease-out) both; }
  .hero-content > * { animation: rise 700ms var(--ease-out) both; }
  .hero-content > :nth-child(2) { animation-delay: 80ms; }
  .hero-content > :nth-child(3) { animation-delay: 160ms; }
}

@keyframes hero-settle {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Phones in landscape: little height, so a slimmer header and a shorter first screen. */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --header-h: 64px; --hero-min: 320px; }
  .brand img { width: 52px; height: 52px; }
  .hero-content { gap: 14px; padding-block: 20px 28px; }
}

/* Bigger touch areas for small text links, without changing the layout. */
@media (pointer: coarse) {
  .hero-facts a,
  .order-bar a,
  .order-offline a {
    padding-block: 10px;
    margin-block: -10px;
  }
  .footer-links a,
  .footer-install {
    padding-block: 10px;
    margin-block: -6px;
  }
  .contact-line {
    padding-block: 6px;
    margin-block: -3px;
  }
}

/* ---------- Sections ---------- */

.section { padding-block: 32px 40px; }

.section-title {
  margin-bottom: 16px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}
.section-title--sm { font-size: 16px; }

/* ---------- Popular products carousel ---------- */

.carousel { position: relative; }

.carousel-track {
  position: relative;
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--radius);
}
.carousel-track::-webkit-scrollbar { display: none; }

.product {
  display: flex;
  flex: 0 0 min(370px, 80%);
  scroll-snap-align: start;
}

.product-card {
  flex: 1;
  display: flex;
  min-height: 142px;
  overflow: hidden;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  transition: border-color 150ms ease, transform 160ms var(--ease-out);
}
.product-card:active { transform: scale(0.98); }
.product-card:focus-visible { outline-offset: -2px; }

.product-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.product-name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-desc {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: var(--c-muted);
  font-size: 12px;
  line-height: 1.4;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.product-price {
  margin-top: auto;
  padding-top: 6px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.product-media {
  flex: 0 0 43%;
  max-width: 160px;
  display: grid;
  place-items: center;
  background: var(--c-placeholder);
  color: var(--c-placeholder-icon);
}
.product-media svg {
  width: 56px;
  height: 56px;
  transition: transform 220ms var(--ease-out);
}

/* Narrow phones: give the dish name more room and let it run to three lines. */
@media (max-width: 400px) {
  .product { flex-basis: 84%; }
  .product-media { flex-basis: 34%; }
  .product-media svg { width: 44px; height: 44px; }
  .product-name { -webkit-line-clamp: 3; }
}

@media (hover: hover) and (pointer: fine) {
  .product-card:hover { border-color: var(--c-ink); }
  .product-card:hover .product-media svg { transform: rotate(-8deg) scale(1.06); }
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  background: rgba(74, 74, 74, 0.94);
  color: var(--c-ink);
  cursor: pointer;
  transition:
    opacity 150ms ease,
    border-color 150ms ease,
    transform 160ms var(--ease-out);
}
.carousel-arrow svg { width: 20px; height: 20px; }
.carousel-arrow--prev { left: -14px; }
.carousel-arrow--next { right: -14px; }
.carousel-arrow:active { transform: scale(0.94); }
.carousel-arrow:disabled { opacity: 0; pointer-events: none; }

@media (hover: hover) and (pointer: fine) {
  .js .carousel-arrow { display: grid; }
  .carousel-arrow:hover { border-color: var(--c-ink); }
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 12px;
}
.carousel-dots[hidden] { display: none; }

.carousel-dot {
  flex: 0 1 48px;
  min-width: 14px;
  display: grid;
  align-content: center;
  height: 28px; /* thin bar, but a comfortable tap area */
  padding: 0 2px;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.carousel-dot::before {
  content: "";
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--c-panel);
  transition: background-color 200ms ease;
}
.carousel-dot[aria-current="true"]::before { background: var(--c-ink); }
@media (max-width: 600px) {
  .carousel-dot { flex-basis: 26px; }
}
@media (hover: hover) and (pointer: fine) {
  .carousel-dot:hover::before { background: var(--c-line); }
  .carousel-dot[aria-current="true"]:hover::before { background: var(--c-ink); }
}

/* ---------- Opening hours ---------- */

.band { background: var(--c-panel); }
.hours-band { padding-block: 28px 32px; }

.hours-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.8;
  font-variant-numeric: tabular-nums;
}
.hours-table th,
.hours-table td {
  padding: 4px 8px;
  text-align: left;
  font-weight: 400;
  white-space: nowrap;
}
.hours-table thead th,
.hours-table tbody th { font-weight: 700; }

.hours-table tr.is-today { background: rgba(0, 0, 0, 0.16); }
.hours-table tr.is-today td { font-weight: 700; }

@media (max-width: 420px) {
  .hours-table { font-size: 13px; }
  .hours-table th,
  .hours-table td { padding-inline: 6px; }
  .hours-table th:first-child,
  .hours-table td:first-child { width: 34%; }
}

/* Folded foldables and the smallest Androids: let the times wrap instead of overflowing. */
@media (max-width: 359px) {
  .hours-table { font-size: 12px; line-height: 1.5; }
  .hours-table th,
  .hours-table td { padding: 6px 4px; white-space: normal; }
  .hours-table th:first-child,
  .hours-table td:first-child { width: 31%; }
}

/* ---------- Contact ---------- */

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 304px);
  padding: 16px;
  border-radius: var(--radius);
  background: var(--c-panel);
  font-style: normal;
}
.contact-name { font-weight: 600; }

.contact-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.3;
  text-underline-offset: 3px;
}
.contact-line .icon { width: 20px; height: 20px; margin-top: -1px; }
@media (hover: hover) and (pointer: fine) {
  .contact-line:hover span { text-decoration: underline; }
}

/* ---------- Restaurant info page ---------- */

.page { padding-block: 40px 72px; }

.page-title {
  margin-bottom: 28px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.page .hours-table tr.is-today { background: var(--c-panel); }

.info-side { display: grid; gap: 24px; }
.info-side .section-title { margin-bottom: 8px; }

.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  line-height: 1.6;
}
.info-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--c-panel);
  transition: background-color 150ms ease;
}
.info-text { flex: 1; min-width: 0; }
.info-row .chevron {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .info-row:hover .info-icon { background: var(--c-panel-hover); }
  .info-row:hover .chevron { transform: translateX(3px); }
}

@media (max-width: 760px) {
  .page { padding-top: 28px; }
  .info-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Order page ---------- */

.order-bar {
  display: flex;
  justify-content: flex-end;
  padding-block: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.order-bar a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.order-frame { display: block; background: #f7f1e8; }

.order-offline {
  margin-bottom: 12px;
  padding-block: 12px;
  border-radius: var(--radius);
  background: var(--c-panel);
  font-size: 14px;
  line-height: 1.5;
}
.order-offline a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 32px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); /* clear the iPhone home bar */
  background: var(--c-panel);
  font-size: 12px;
  line-height: 1.5;
}

.footer-top,
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.footer-bottom { margin-top: 24px; }

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius);
}
.footer-brand img { width: 48px; height: 48px; }
.footer-brand strong { display: block; font-size: 15px; line-height: 1.2; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a {
  display: inline-block;
  padding-block: 4px;
  text-underline-offset: 3px;
}
.footer-install {
  display: inline-block;
  padding: 4px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover,
  .footer-install:hover { text-decoration: underline; }
}

/* ---------- Install the app ---------- */

.nav-install {
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
/* Desktop browsers show their own install icon in the address bar. */
@media (min-width: 761px) {
  .nav-install { display: none !important; }
}

.install-sheet {
  width: min(100% - 32px, 420px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 24px;
  border: 0;
  border-radius: 16px;
  background: var(--c-bg);
  color: var(--c-ink);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.55);
}
.install-sheet::backdrop { background: rgba(0, 0, 0, 0.55); }
.install-sheet:focus,
.install-sheet:focus-visible { outline: none; }

.install-sheet-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 13px;
}
.install-sheet-title {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}
.install-steps {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.5;
}
.install-steps .icon { display: inline-block; vertical-align: -3px; }
.install-sheet-close { width: 100%; font-size: 15px; font-weight: 600; }

html:has(.install-sheet[open]) { overflow: hidden; }

/* On phones it rises from the bottom like a native sheet. */
@media (max-width: 600px) {
  .install-sheet {
    width: 100%;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .install-sheet[open] { animation: sheet-in 280ms var(--ease-out); }
  .install-sheet[open]::backdrop { animation: fade-in 200ms ease-out; }
}
@media (max-width: 600px) and (prefers-reduced-motion: no-preference) {
  .install-sheet[open] { animation: sheet-up 360ms cubic-bezier(0.32, 0.72, 0, 1); }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
  .btn:active,
  .product-card:active,
  .store-badges a:active,
  .carousel-arrow:active { transform: none; }
}
