/* Live menu and PWA ordering for Côté Caçuá (site/menu.css)
   Shared by /en/order/, /fr/order/, /pt/order/ and root order router. */

:root {
  --paper: #EEF2EF;
  --ink: #0E1B17;
  --ink-soft: #3F4F49;
  --green: #0B7A3E;
  --green-hover: #096834;
  --mint: #D8F0DF;
  --sage: #C9DDD2;
  --white: #FFFFFF;
  --wa: #25D366;
  --stripe: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E1B17;
    --ink: #EEF2EF;
    --ink-soft: #A9BDB4;
    --white: #162621;
  }
}

* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; border-radius: 6px; }

/* Market awning */
.awning-wrap {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 12px rgba(14, 27, 23, .18));
  transform-origin: top;
  animation: unroll .7s cubic-bezier(.2, .9, .25, 1) both;
}
.awning {
  height: 64px;
  background: repeating-linear-gradient(90deg, var(--green) 0 var(--stripe), #fff var(--stripe) calc(var(--stripe) * 2));
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - 24px) no-repeat,
    radial-gradient(circle 24px at 50% 0, #000 97%, transparent 100%) bottom / var(--stripe) 24px repeat-x;
          mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - 24px) no-repeat,
    radial-gradient(circle 24px at 50% 0, #000 97%, transparent 100%) bottom / var(--stripe) 24px repeat-x;
}
@keyframes unroll { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .awning-wrap { animation: none; } }

/* App / Layout Container */
.order-app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px 80px;
}

/* Nav & Top bar */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
}
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 6px 12px;
  background: rgba(201, 221, 210, .35);
  border-radius: 99px;
  transition: color .15s ease, background .15s ease;
}
.back-home:hover { color: var(--ink); background: var(--sage); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: flex;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}
.lang-switch a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current] { color: var(--green); border-bottom-color: var(--green); }

/* PWA Install Button */
.install-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: 99px;
  padding: 6px 14px;
  cursor: pointer;
  transition: filter .15s ease;
}
.install-btn:hover { filter: brightness(1.1); }
.install-btn[hidden] { display: none !important; }

/* Offline Status Banner */
.offline-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFF3CD;
  color: #856404;
  border: 1px solid #FFEEBA;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}
.offline-banner[hidden] { display: none !important; }

/* Header & Meta */
.menu-head {
  margin-bottom: 24px;
}
.menu-head .brand {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.cutoff-pill, .notice-pill {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 12px;
}
.cutoff-pill { background: rgba(11, 122, 62, .1); color: var(--green); }
.notice-pill { background: var(--mint); color: #0E1B17; }

/* Category Filter Tabs */
.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin: 20px 0;
  -webkit-overflow-scrolling: touch;
}
.cat-pill {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 99px;
  border: 0;
  cursor: pointer;
  background: rgba(201, 221, 210, .4);
  color: var(--ink);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.cat-pill:hover { background: var(--sage); }
.cat-pill.active {
  background: var(--ink);
  color: #fff;
}

/* Items Grid */
.items {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}
.item {
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(14, 27, 23, .06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14, 27, 23, .1);
}
.item-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: rgba(201, 221, 210, .25);
  overflow: hidden;
}
.item-img-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.item-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(14, 27, 23, .75);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 10px;
  border-radius: 99px;
  backdrop-filter: blur(4px);
}
.item-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.item-body h3 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.item-body p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.item-foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.item-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.item-foot b {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
}
.soldout {
  font-size: 14px;
  font-weight: 700;
  color: #B52B2B;
  background: #FDF2F2;
  padding: 4px 10px;
  border-radius: 99px;
}
.ask-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  background: #FFF4DB;
  padding: 4px 12px;
  border-radius: 99px;
}
.item.sold img {
  filter: grayscale(1);
  opacity: .5;
}

/* Action Buttons */
.item-actions {
  display: flex;
  /* wrap so the nowrap labels never clip: buttons share a row only when both fit */
  flex-wrap: wrap;
  gap: 8px;
}
.item-actions > .btn-wa, .item-actions > .btn-app { flex: 1 1 auto; }
.btn-wa, .btn-app {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 99px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: filter .12s ease, transform .1s ease;
}
.btn-wa {
  background: var(--wa);
  color: #fff;
}
.btn-wa:hover { filter: brightness(1.08); }
.btn-app {
  background: var(--mint);
  color: #0E1B17;
}
.btn-app:hover { filter: brightness(0.96); }

/* Bottom Catering / Event Banner (Matching iOS App) */
.event-banner {
  margin-top: 48px;
  background: var(--ink);
  color: #fff;
  border-radius: 24px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.event-info h3 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}
.event-info p {
  color: #BFD6CA;
  font-size: 15px;
  margin-top: 4px;
}
.event-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-light {
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 20px;
  border-radius: 99px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: filter .15s ease;
}
.btn-light:hover { filter: brightness(.95); }

/* Dialogs & Modal Sheets */
dialog {
  border: 0;
  border-radius: 24px;
  padding: 28px 24px;
  width: min(92vw, 440px);
  color: var(--ink);
  background: #fff;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
  margin: auto;
}
dialog::backdrop {
  background: rgba(14, 27, 23, .55);
  backdrop-filter: blur(3px);
}
dialog h3 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
}
dialog .dialog-sub {
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 6px;
}
.msg-preview-card {
  margin-top: 14px;
  background: var(--mint);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.45;
  color: #0E1B17;
  border-left: 4px solid var(--green);
}
.dialog-form {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dialog-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dialog-field label {
  font-size: 14px;
  font-weight: 700;
}
.dialog-field input, .dialog-field textarea {
  font: inherit;
  font-size: 16px;
  padding: 10px 14px;
  border: 2px solid var(--sage);
  border-radius: 12px;
  width: 100%;
  color: var(--ink);
  background: #fff;
}
.dialog-field input:focus, .dialog-field textarea:focus {
  outline: none;
  border-color: var(--green);
}
.dialog-field small {
  font-size: 12px;
  color: var(--ink-soft);
}
.dialog-error {
  color: #C5221F;
  font-size: 14px;
  font-weight: 600;
}
dialog menu {
  padding: 0;
  margin-top: 20px;
  display: flex;
  flex-direction: row-reverse;
  gap: 10px;
}
dialog button {
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  border-radius: 99px;
  padding: 11px 20px;
  border: 0;
  cursor: pointer;
  transition: filter .12s ease;
}
dialog button.btn-primary {
  background: var(--green);
  color: #fff;
}
dialog button.btn-primary:hover { filter: brightness(1.1); }
dialog button.btn-secondary {
  background: var(--paper);
  color: var(--ink);
}
dialog button.btn-secondary:hover { background: var(--sage); }

/* Sent State Confirmation View */
.sent-view {
  text-align: center;
  padding: 12px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.sent-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.sent-view h3 { font-size: 24px; font-weight: 800; }
.sent-view p { font-size: 16px; color: var(--ink-soft); line-height: 1.5; }

/* Responsive adjustments */
@media (max-width: 640px) {
  .order-app { padding: 16px 16px 60px; }
  .items { grid-template-columns: 1fr; gap: 18px; }
  .event-banner { padding: 22px 20px; }
  .top-nav { flex-wrap: wrap; }
}
