/* order.css — Order Now flip cards + reservation dialog. Uses the tokens from tokens.css only. */

body.ord-lock { overflow: hidden; }

.ord-overlay {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  padding: var(--sp-2); background: rgba(13, 39, 29, .62); backdrop-filter: blur(5px);
  opacity: 0; transition: opacity .24s var(--ease); overflow-y: auto;
}
.ord-overlay.open { opacity: 1; }
.ord-overlay.closing { opacity: 0; }

.ord-dialog {
  position: relative; width: min(100%, 520px); margin-block: auto;
  background: var(--cream); color: var(--text); border-radius: var(--radius-l);
  padding: var(--sp-4) var(--sp-3) var(--sp-3); box-shadow: 0 24px 60px rgba(0,0,0,.35);
  transform: translateY(18px) scale(.97); transition: transform .34s var(--ease);
}
.ord-overlay.open .ord-dialog { transform: none; }
.ord-close {
  position: absolute; top: .6rem; right: .7rem; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: var(--cream-2); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.ord-close:hover { background: var(--turmeric-2); transform: rotate(90deg); }

.ord-head { text-align: center; margin-bottom: var(--sp-3); padding-inline: var(--sp-3); }
.ord-eyebrow { font-family: var(--font-hand); font-size: 1.35rem; color: var(--brick); margin: 0; font-weight: 600; }
.ord-head h2 { font-family: var(--font-head); font-size: clamp(1.7rem, 5vw, 2.2rem); margin: .1rem 0 .25rem; color: var(--forest); }
.ord-sub { margin: 0; color: var(--muted); font-size: var(--fs-small); }

/* ---------- flip cards ---------- */
.ord-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); perspective: 1000px; }
.ord-card { display: block; text-decoration: none; color: #fff; aspect-ratio: 1 / 1.05; border-radius: var(--radius-l); outline-offset: 4px; }
.ord-card[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.ord-flip {
  position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d;
  transform: rotateY(180deg);                       /* starts face-down */
  transition: transform .9s cubic-bezier(.2, .85, .25, 1.15);
  transition-delay: calc(.18s + var(--i, 0) * .32s); /* Zomato flips first, Swiggy right after */
}
.ord-overlay.open .ord-flip { transform: rotateY(0); }
.ord-card:hover .ord-flip, .ord-card:focus-visible .ord-flip { transition-delay: 0s; transform: rotateY(0) translateY(-5px) scale(1.03); }
.ord-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .55rem; border-radius: var(--radius-l); padding: var(--sp-2); text-align: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow-lift);
}
.ord-back { transform: rotateY(180deg); background: var(--forest); border: 2px dashed rgba(240,146,43,.7); }
.ord-spark { font-family: var(--font-head); font-size: 3.2rem; color: var(--turmeric); animation: ordPulse 1.4s ease-in-out infinite; }
@keyframes ordPulse { 50% { transform: scale(1.18); opacity: .7; } }

.ord-card--zo .ord-front { background: linear-gradient(150deg, #F0485A, #CB202D); }
.ord-card--sw .ord-front { background: linear-gradient(150deg, #FF9A3C, #FC6A0B); }
.ord-mark { font-family: var(--font-ui); font-weight: 700; font-size: clamp(1.6rem, 6vw, 2rem); letter-spacing: -.02em; text-transform: lowercase; }
.ord-line { font-size: var(--fs-small); font-weight: 500; opacity: .95; }
.ord-go {
  margin-top: .3rem; background: #fff; border-radius: var(--radius-pill); padding: .4rem .95rem;
  font-size: var(--fs-tiny); font-weight: 700; display: inline-flex; gap: .35rem; align-items: center;
}
.ord-card--zo .ord-go { color: #CB202D; }
.ord-card--sw .ord-go { color: #D9560A; }
.ord-go i { font-style: normal; transition: transform var(--dur-fast) var(--ease); }
.ord-card:hover .ord-go i { transform: translateX(4px); }

.ord-alt { display: grid; gap: var(--sp-1); margin-top: var(--sp-3); justify-items: center; }
.ord-wa { width: 100%; justify-content: center; }
.ord-wa .ico, .ord-submit .ico { width: 20px; height: 20px; }
.ord-link { background: none; border: 0; color: var(--muted); font: inherit; font-size: var(--fs-small); cursor: pointer; padding: .4rem; }
.ord-link b { color: var(--brick); text-decoration: underline; text-underline-offset: 3px; }
.ord-link:hover b { color: var(--turmeric); }

/* ---------- reservation form ---------- */
.ord-form { display: grid; gap: .8rem; }
.ord-form label { display: grid; gap: .3rem; font-size: var(--fs-small); font-weight: 600; color: var(--forest); }
.ord-opt { font-weight: 400; color: var(--muted); }
.ord-form input, .ord-form select {
  font: inherit; font-weight: 400; color: var(--text); background: #fff; width: 100%;
  border: 1.5px solid #D9CDB0; border-radius: var(--radius-s); padding: .65rem .75rem; min-height: 46px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.ord-form input:focus, .ord-form select:focus { outline: none; border-color: var(--turmeric); box-shadow: 0 0 0 3px rgba(240,146,43,.25); }
.ord-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.ord-err { margin: 0; color: var(--brick); font-size: var(--fs-small); font-weight: 600; }
.ord-submit { width: 100%; justify-content: center; margin-top: .2rem; }
.ord-submit[disabled] { opacity: .5; cursor: not-allowed; }
.ord-fine { margin: 0; font-size: var(--fs-tiny); color: var(--muted); text-align: center; }

.ord-done { text-align: center; padding: var(--sp-2) var(--sp-2) var(--sp-1); outline: none; }
.ord-done h3 { font-family: var(--font-head); color: var(--forest); margin: .6rem 0 .3rem; }
.ord-done p { color: var(--muted); margin: 0 0 var(--sp-2); }
.ord-check { width: 64px; height: 64px; fill: none; stroke: var(--whatsapp); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ord-check circle { stroke-dasharray: 145; stroke-dashoffset: 145; animation: ordDraw .6s .05s var(--ease) forwards; }
.ord-check path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: ordDraw .4s .55s var(--ease) forwards; }
@keyframes ordDraw { to { stroke-dashoffset: 0; } }

/* ---------- top-bar buttons (same on every page) ---------- */
.nav-reserve, .nav-order { white-space: nowrap; }
.nav-reserve .ico, .nav-order .ico { width: 17px; height: 17px; }
@media (max-width: 1000px) { .nav-reserve { display: none; } }
/* Order Now stays in the top bar on every screen size (main.css hides .btn in the bar on small screens) */
.topbar-actions .btn.nav-order { display: inline-flex; }
@media (max-width: 640px) {
  .topbar-actions .nav-reserve { display: none; }
  .topbar-actions { gap: .45rem; }
  .topbar-actions .btn.nav-order { padding: .5rem .8rem; min-height: 42px; font-size: .8rem; }
  .topbar-actions .btn.nav-order .ico { width: 16px; height: 16px; }
}
@media (max-width: 380px) {
  .topbar-actions .btn.nav-order { padding: .5rem .6rem; }
  .topbar-actions .btn.nav-order [data-icon] { display: none; }
}

/* reservation entry in the mobile sticky bar: 4 equal columns */
@media (max-width: 640px) { .sticky-cta--4 { grid-template-columns: repeat(4, 1fr) !important; } }

@media (max-width: 420px) {
  .ord-dialog { padding-inline: var(--sp-2); }
  .ord-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ord-flip { transform: rotateY(0) !important; transition: none !important; }
}

/* keep the nav links on one line now that Reserve + Order Now share the row */
.nav-list a { white-space: nowrap; }
@media (min-width: 1001px) and (max-width: 1240px) {
  .nav-reserve { display: none; }
}

/* very small phones: tighten the bar so logo, call, Order Now and ☰ all fit without sideways scroll */
@media (max-width: 400px) {
  .topbar-inner { gap: .4rem; }
  .topbar .rt-logo { width: 42px; height: 42px; }
  .topbar .rt-the { font-size: 1.15rem; }
  .topbar .rt-sub { font-size: .52rem; letter-spacing: .12em; }
  .topbar .nav-call { width: 38px; height: 38px; }
  .topbar-actions { gap: .3rem; }
  .topbar-actions .btn.nav-order { padding: .45rem .65rem; font-size: .76rem; min-height: 38px; }
  .topbar .cart-btn { width: 38px; height: 38px; }
  .nav-toggle { padding-inline: .3rem; }
}

/* menu posters keep their full artwork (text near the edges would otherwise be cropped in the tall tiles) */
img[src*="-poster."] { object-fit: contain !important; background: #1b0e07; object-position: 50% 50% !important; }

/* ---------- dialog alignment fixes (reservation + order) ---------- */
.ord-dialog { overflow: hidden; }
.ord-dialog > * { min-width: 0; }
.ord-head { padding-inline: var(--sp-4); }                       /* keeps the title clear of the close button */
.ord-form { width: 100%; }
.ord-form label { min-width: 0; text-align: left; }
.ord-form input, .ord-form select {
  display: block; height: 46px; max-width: 100%; margin: 0; line-height: 1.2;
  -webkit-appearance: none; appearance: none;                    /* same look + height for text, date and select */
}
.ord-form select {
  padding-right: 2.2rem; background-repeat: no-repeat; background-position: right .8rem center; background-size: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2316362A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.ord-form input[type="date"] { min-width: 0; text-align: left; }
.ord-form input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.2em; }
.ord-row { align-items: start; }
.ord-row > label { min-width: 0; }
.ord-submit, .ord-wa {
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  width: 100%; text-align: center; white-space: normal; line-height: 1.25;
}
.ord-err:not([hidden]) { text-align: center; }
.ord-alt { width: 100%; }
.ord-cards { width: 100%; }
@media (max-width: 420px) {
  .ord-head { padding-inline: var(--sp-3); }
  .ord-cards { gap: .6rem; }
}
