:root{
  --primary:#FD774E;
  --primary-washed: color-mix(in srgb, var(--primary) 12%, white 88%);
  --primary-ink:#8A3D28;
  --bg:#FAFAF8;
  --surface:#FFFFFF;
  --ink:#1E1E1E;
  --muted:#6B7280;
  --line:#E6E6E0;
  --ok:#16A34A;
  --danger:#EF4444;
  --radius:18px;
  --shadow:0 8px 28px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.06);
  --bg-light:#e2deda;
  --text-dark:#171717
}

*{box-sizing:border-box}
html,body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: var(--bg);
}
body {
  margin:10px;
  font-family:"Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color:var(--ink);
  background:var(--bg);
}

/* FRAME */
.app{
  width: 100%;
  max-width: 440px;
  min-height:100dvh;
  background: var(--surface);
  /* border-radius: var(--radius); */
  box-shadow: 0 0 40px rgba(0,0,0,0.05);
  overflow: auto !important;          /* was: overflow: hidden */
  -webkit-overflow-scrolling: touch;  /* smooth scroll on iOS */
  display:flex;
  flex-direction:column;
  padding-bottom:88px;
}

header{
  position:sticky; top:0; z-index:20;
  backdrop-filter:saturate(180%) blur(10px);
  background:color-mix(in srgb, var(--bg) 80%, white 20%);
}
.bar{
  max-width:1100px; margin:0 auto; padding:12px 16px; min-height:80px;
  display:flex; align-items:center; gap:12px; justify-content:space-between;
  background: white;
  border-bottom: 1px solid var(--line);
}
.brand{display:flex; align-items:center; gap:0px; font-weight:700; letter-spacing:.2px;}
.brand-badge{
  inline-size:28px; block-size:28px; border-radius:8px;
  background:linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 65%, #FFB199 35%));
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.6), 0 6px 14px rgba(253,119,78,.28);
}
.brand .sub{color:var(--muted); font-weight:500; font-size:12px}

.brand-image {
    height: 30px;
}

/* NAV — fő- és alkategóriák */
.tabs, .subtabs{
  max-width:1100px; margin:8px auto; padding:0 16px;
  display:flex; gap:8px; overflow:auto; scrollbar-width:none;
}
.tabs::-webkit-scrollbar, .subtabs::-webkit-scrollbar{display:none}
.tab, .subtab{
  white-space:nowrap; padding:10px 14px; border-radius:999px;
  border:1px solid var(--line); background:var(--primary-washed); color:var(--primary);
  font-weight:600; font-size:14px; cursor:pointer; transition:.2s; border: 4px solid; border-color:transparent;
}
.tab[aria-selected="true"], .subtab[aria-selected="true"]{
  color:var(--primary); background:var(--primary); color: white; transform:scale(1.05); outline: 4px solid white; /* outer border */
}
.section-title{
  max-width:1100px; margin:28px auto 22px; padding:0 16px;
  font-size:18px; font-weight:600; color:var(--primary);
}

/* MENU GRID */
.menu{
  max-width:1100px; margin:0 auto; padding:8px 16px 24px;
  display:grid; gap:12px;
  grid-template-columns:repeat(2, minmax(0,1fr));
}
@media (min-width:880px){
  .menu{grid-template-columns:repeat(3, minmax(0,1fr))}
}
.card{
  border-bottom: 1px solid var(--line);
  overflow:hidden;
  display: flex;
  flex-direction:row;
}

.card-body{padding:0px 12px 18px 0px; display:grid; gap:3px; width: 68%;}
.name{font-weight:600; font-size:15px}
.desc{color:var(--muted); font-size:13px;}
.price-row{display:flex; align-items:center; justify-content:space-between}
.price{font-weight:400; font-size: 13px; color: var(--primary)}
.pill{
  font-size:12px; padding:4px 8px; border-radius:999px;
  background:var(--primary-washed);
  color:var(--primary);
}

.thumb {
    aspect-ratio:3/2;
    width:100%;
    object-fit:cover;
    display:block;
    background:#ddd;
    border-radius: 10px;
}

/* STICKY BAR */
.stickybar{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:30;
  background:transparent;
  color:#fff;
  padding:12px 16px;
}
.sticky-wrap{
  max-width:1100px; margin:0 auto; display:flex; gap:12px; align-items:center;
}
.sticky-btn{
  flex:1; display:flex; align-items:center; justify-content:center; gap:10px;
  background:var(--primary); color:#fff; border:none; border-radius:14px;
  padding:14px 16px; font-weight:700; font-size:16px; cursor:pointer;
}
.sticky-btn:disabled{display:none; cursor:not-allowed;}
.sticky-meta{margin-left:auto; color:#fff; opacity:.85; font-weight:600}

/* ITEM SHEET */
.sheet{
  position:fixed; inset:auto 0 0 0; z-index:40;
  translate:0 100%; transition:translate .28s ease;
  background:var(--surface); border-radius:18px 18px 0 0; box-shadow:0 -12px 30px rgba(0,0,0,.18);
  max-height:85dvh; display:flex; flex-direction:column; overflow:hidden;
}
.sheet.open{translate:0 0}
.sheet-body{padding:0; overflow:auto; background:white}
.sheet-title{font-size:22px; font-weight:700; margin-bottom:6px}
.opts{display:grid; gap:14px; margin-top:8px}
.opt-group{display:grid; gap:8px}
.opt-label{font-weight:600; font-size:15px}
.opt-row{display:flex; gap:8px; flex-wrap:wrap}
.chip{
  border:1px solid var(--line); padding:8px 12px; border-radius:12px; background:#fff; cursor:pointer; font-size: 15px;
}
.chip input{display:none}
.chip:has(input:checked){border-color:var(--primary); background:var(--primary-washed); color:var(--primary);}

.note textarea{
  width:100%; min-height:80px; padding:10px 12px; border-radius:12px; border:1px solid var(--line); resize:none; font:inherit;
  background:#fff; font-size:15px;
}

.sheet-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
}

.sheet-footer{
  position:sticky; bottom:0;
  padding:12px 16px; display:grid; gap:10px;
}
.qty-row{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  background:var(--bg); border:1px solid var(--line); border-radius:12px; padding:8px;
}
.qty-ctrl{display:flex; align-items:center; gap:8px}
.btn-icon{
  width:30px; height:30px; border-radius:999px; border: none; background:#fff; font-size:18px; font-weight:500; cursor:pointer; color: var(--primary);
}
.add-btn{
  display:flex; align-items:center; justify-content:center; gap:10px;
  width:100%; padding:14px; border-radius:14px; border:none; cursor:pointer;
  background:var(--primary); color:#fff; font-weight:700;
}
.close-sheet{
  position:absolute; right:12px;
   background: white; color:var(--text-dark); border:none; width:36px; height:36px; border-radius:999px; cursor:pointer;
}

/* KOSÁR */
.view{display:none}
.view.active{display:block}
.cart{
  max-width:1100px; margin:0 auto; padding:14px 16px 14px;
  display:grid; gap:12px;
}
.cart-title{font-weight:600; font-size:20px; margin:6px 0 4px 0; padding-bottom: 10px; color: var(--text-dark)}
.item{
  display:grid; grid-template-columns:40px 1fr 72px; gap:12px; align-items:center;
}
.item img{width:96px; height:72px; object-fit:cover; border-radius:12px}
.item h4{margin:0 0 8px 0; font-size:15px; font-weight:600;}
.item .muted{color:var(--muted); font-size:13px}
.qty-mini{
  display:inline-flex; align-items:center; gap:8px; padding:4px 6px; background:#fff;width:110px;
}
.item .price{font-weight:600}
.trash{
  background:#fff; color:var(--danger); border:1px solid var(--line);
  width:38px; height:38px; border-radius:10px; cursor:pointer;
}

.totals{
  margin-top:10px; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:12px; display:grid; gap:8px;
}
.row{display:flex; justify-content:space-between}
.row.total{font-weight:700; font-size:18px}

/* UTIL */
.hidden{display:none !important}
.badge{
  display:inline-flex; align-items:center; justify-content:center; min-width:24px; height:24px; padding:0 8px;
  border-radius:999px; background:#fff; color:var(--primary-ink); font-weight:700; font-size:12px;
}

/* Frame width token */
:root { --frame: 440px; }

/* Constrain fixed bottom bars to the app width */
.stickybar{
  position: fixed;
  bottom: 0;
  left: 50%;             /* center in viewport */
  right: auto;
  width: 100%;
  max-width: var(--frame);
  translate: -50% 0;     /* pull back by half width */
  padding-bottom: max(12px, env(safe-area-inset-bottom)); /* iOS safe area */
}

/* The inner wrap should just fill the bar */
.sticky-wrap{
  width: 100%;
  max-width: none;
  margin: 0;
}

/* Constrain the bottom sheet to the app width */
.sheet{
  position: fixed;
  bottom: 0;
  left: 50%;
  right: auto;           /* stop stretching full width */
  width: 100%;
  max-width: var(--frame);
  translate: -50% 100%;  /* start off-screen but centered */
}

/* When sheet is open, slide up while keeping it centered */
.sheet.open{
  translate: -50% 0;
}

/* === Hard lock app to exactly 440px wide === */
:root { --frame: 440px; }

html, body {
  height: 100%;
  margin: 0;
  display: flex;
  justify-content: center;  /* center the fixed-width app */
  background: var(--bg);
  overflow-x: hidden;
}

/* Any top content rows should not exceed the frame width. */
.bar,
.tabs,
.subtabs,
.section-title,
.menu,
.cart {
  width: var(--frame) !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Keep sticky bar strictly within the frame and centered. */
.stickybar{
  position: fixed;
  bottom: 0;
  left: 50%;
  right: auto;
  width: var(--frame) !important;
  max-width: none !important;
  translate: -50% 0;
}

/* Inner sticky content just fills the bar. */
.sticky-wrap{
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

/* Bottom sheet locked to the frame and centered. */
.sheet{
  position: fixed;
  bottom: 0;
  left: 50%;
  right: auto;
  width: var(--frame) !important;
  max-width: none !important;
  translate: -50% 100%;
}
.sheet.open{ translate: -50% 0; }

/* Order items grid is fine, but ensure long text never pushes layout */
.item .muted,
.desc {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Safety: prevent any overflow from forcing wider layout */
* { box-sizing: border-box; max-width: 100vw; }

/* === Fluid frame: fills small screens, caps at 440px on larger === */
:root{
  --frame: 440px;
  --frame-fluid: min(100vw, var(--frame));
}

html, body{
  height: 100%;
  margin: 0;
  display: flex;
  justify-content: center;   /* centers on wide screens */
  background: var(--bg);
  overflow-x: hidden;        /* no sideways scroll on tiny screens */
}

/* App frame now fluid up to 440px */
.app{
  width: var(--frame-fluid) !important;
  max-width: none !important;
}

/* Core sections follow the same fluid width */
.bar,
.tabs,
.subtabs,
.section-title,
.menu,
.cart,
.view{
  width: var(--frame-fluid) !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

/* Sticky bar stays centered and fluid */
.stickybar{
  position: fixed;
  bottom: 0;
  left: 50%;
  width: var(--frame-fluid) !important;
  translate: -50% 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.sticky-wrap{
  width: 100% !important;
  margin: 0 !important;
}

/* Bottom sheet stays centered and fluid */
.sheet{
  position: fixed;
  bottom: 0;
  left: 50%;
  width: var(--frame-fluid) !important;
  translate: -50% 100%;
}
.sheet.open{ translate: -50% 0; }

/* Optional: stabilize number widths to avoid tiny layout shifts */
.price,
.badge,
.sticky-meta,
#qty,
.qty-mini{
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  white-space: nowrap;
}

.menu {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

.card-thumb {
    width: 28%;
    flex: 1;
    padding-bottom: 18px;
}

/* Hide the old tab bars */
.tabs, .subtabs { display: none !important; }

/* New horizontal scrolling menu */
.hmenu{
  background: white;
  width: var(--frame-fluid);
  margin: 0px auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  border-bottom:1px solid var(--line);
}

.hmenu::-webkit-scrollbar{ display:none; }

.hbtn{
  scroll-snap-align: start;
  white-space: nowrap;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: var(--surface);
  color: var(--primary);
  font-weight: 400;
  font-size: 14px;
  font-family: "Poppins";
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.hbtn.is-active{
  background: var(--primary-washed);
  color: var(--primary);
  font-weight: 600;
  border-color: transparent;
}
.hbtn:focus-visible{
  outline: 2px solid color-mix(in srgb, var(--primary) 50%, white 50%);
  outline-offset: 2px;
}

/* Make section titles stop below the fixed header when scrolled into view */
.section-title{ scroll-margin-top: 170px; } /* adjust if your header height changes */

/* Full-width sticky CTA layout */
.sticky-btn.sticky-btn--full{
  width:100%;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:14px 16px;
  font-family: "Poppins", sans-serif;
}

.sticky-btn__left{
  display:flex;
  flex-direction:row;
  align-items:flex-start;
  gap:14px;
  line-height:1.1;
}

.sticky-btn__label{
  font-family: "Poppins", sans-serif;
  font-weight:500;
  margin: auto 0;
  font-size:15px;
}

.sticky-btn__price{
  margin-left:auto;
  font-weight:500;
  font-size:15px;
  white-space:nowrap;
}

.badge{
  background:#fff;                /* already defined as a pill elsewhere; ensure high contrast */
  color:var(--primary);
  font-weight:600;
  font-size:13px;
  min-width:auto;                 /* let content define width */
  height:30px;
  width:30px;
}

/* Outline version of sticky button for "Tételek hozzáadása" */
.sticky-btn--outline {
  background: var(--primary-washed);
  color: var(--primary);
  box-shadow: 0 0 0 2px white; /* acts like an extra outer border */
  border-radius: 14px;
  justify-content: flex-start !important; /* align content left */
  width: 100%;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.sticky-btn--outline .badge {
  background: var(--primary);
  color: var(--primary-washed);
  width: 30px;
  height: 30px;
  font-size: 18px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between; /* minus and qty left, plus right */
}

/* Cart item: qty | details | image */
.item{
  display: grid;
  grid-template-columns: 40px 1fr 72px; /* LEFT qty | MIDDLE details | RIGHT img */
  gap: 16px;
  align-items: center;
  padding-bottom: 20px;
}

/* Left column */
.item__qty{
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Middle column */
.item__main{
  display: grid;
  gap: 0px;
}
.item__price{
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
}

/* Right column (image) */
.item__thumb{
  display:flex;
  align-items:center;
  justify-content:flex-end;
}
.item__thumb img{
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 12px;
}

/* Item quantity group — fixed 40px width */
.qty-mini{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--primary-washed);
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  padding: 5px 0;
  gap: 4px;
  border-radius: 8px;
  color: var(--primary);
}

.item { position: relative; }

/* Outer container: square white base, no radius */
.confirm-overlay{
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0 0 20px 0;                /* bottom margin only */
  padding: 0;                        /* no padding here */
  background: #fff;                  /* white base with NO radius */
  border-radius: 0;
  display: flex;
  align-items: stretch;              /* let inner box define its padding/radius */
  justify-content: center;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Inner box: rounded, tinted background, actual padding */
.confirm-box{
  display: flex;
  flex-direction: column;
  justify-content: center;           /* vertical centering of all content */
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--primary-washed);
  width: 100%;
  height: 100%;
}

/* Title */
.confirm-title{
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  color: var(--text-dark);
}

/* Actions row */
.confirm-actions{
  display: flex;
  gap: 10px;
  width: 100%;
}

/* Buttons */
.confirm-actions .btn{
  flex: 1;
  height: 42px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  display: flex;
  align-items: center;    /* vertical centering */
  justify-content: center;/* horizontal centering */
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Left: "Mégse" — primary text on white */
.confirm-actions .btn-cancel{
  background: transparent;
  color: var(--primary);
}

/* Right: "Eltávolítás" — white text on primary */
.confirm-actions .btn-danger{
  background: var(--primary);
  color: #fff;
}

/* === Side-by-side layout for Add + Qty controls === */
.sheet-footer--side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Quantity control: minus left, qty center, plus right */
.sheet-footer--side .qty-ctrl {
  display: flex;
  align-items: center;
  justify-content: space-between; /* left / right alignment */
  gap: 8px;
  background: var(--primary-washed);
  color: var(--primary);
  border-radius: 14px;
  padding: 6px 10px;
  width: 120px; /* fixed width for balance */
  height: 58px;
}

.sheet-footer--side .qty-ctrl strong {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
}

.sheet-footer--side .btn-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: var(--primary);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
}

.sheet-footer--side .add-btn {
  flex: 1;
  height: 58px;
  font-size: 15px;
  font-family: "Poppins", sans-serif;
  font-weight: 500;
}

/* --- Sticky-over-body footer for item sheet --- */
:root{
  --sheet-footer-h: 74px; /* footer height incl. padding */
}

/* The sheet is already fixed; we'll absolutely position the footer inside it */
.sheet{
  position: fixed; /* already present; ensures abs children use this as containing block */
  overflow: hidden; /* already present; keeps footer overlap clean */
}

/* Make the body scroll under the footer and reserve space so content isn't hidden */
.sheet-body{
  overflow: auto;
  padding: 16px 16px calc(16px + var(--sheet-footer-h) + env(safe-area-inset-bottom));
}

/* Turn the footer into an overlay that stays stuck to the bottom of the sheet */
.sheet-footer{
  position: absolute !important;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px;
  height: var(--sheet-footer-h);
  display: flex; /* ensure layout holds even if a different modifier is used */
  align-items: center;
}

/* Keep your side-by-side layout (quantity + add) */
.sheet-footer--side{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--sheet-footer-h); /* match reserved space */
}

.sheet-body {
  padding: 0;
  overflow: auto;
}

.sheet-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
}

.sheet-body {
  padding: 0;
  overflow: auto;
}

/* Product image */
.sheet-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
}

/* Inner content after image */
.sheet-content {
  background: var(--surface);
}

/* Sticky title section under image */
.sheet-header-sticky {
  position: sticky;
  top: 0;
  background: var(--surface);
  padding: 12px 0;
}

/* Title + price style */
.sheet-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.sheet-header-sticky .price {
  font-size: 16px;
  color: var(--primary);
  font-weight: 500;
}

.sheet-body {
  padding: 0;
  overflow: auto;
}

/* Top image */
.sheet-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
}

/* Sticky full-width title bar */
.sheet-header-sticky {
  position: sticky;
  top: 0;
  background: var(--surface);
}

/* Inner wrapper (controls padding and layout of text) */
.sheet-header-inner {
  padding: 0px 16px;
  display: flex;
  flex-direction: column;     /* stack name over price */
  align-items: flex-start;
  max-width: var(--frame-fluid);
  margin: 0 auto;
}

/* Title + price styling */
.sheet-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.sheet-header-sticky .price {
  font-size: 16px;
  color: var(--primary);
  font-weight: 500;
}


/* ===== Sheet: header sticks, content scrolls OVER the image ===== */

/* Make the sheet's scroll container explicit */
.sheet-body{
  position: relative;
  overflow: auto; /* already set above; repeat here to win cascade */
  padding: 0;     /* content spacing handled below */
}

/* The hero image becomes the base layer, stuck to the top of the scroller */
.sheet-img{
  position: sticky;
  top: 0;
  z-index: 41;                 /* sits behind everything */
  width: 100%;
  height: min(42vh, 280px);   /* nice tall visual without hiding content */
  object-fit: cover;
  margin: 0;
  border-radius: 0;
  pointer-events: none;       /* taps don't hit the image */
}

/* Sticky title bar that floats over the image while scrolling */
.sheet-header-sticky{
  position: sticky;
  top: 0;
  /* translucent + blur for readability over the photo */
  background: white;
}

.sheet-header-inner{
  padding: 10px 0px;         /* compact, matches your frame gutters */
  max-width: var(--frame-fluid);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.sheet-header-sticky .price{
  font-size: 16px;
  color: var(--primary);
  font-weight: 500;
}

/* Scrollable content panel sits ABOVE the image */
.sheet-content{
  position: relative;
  padding: 16px 16px 0px 16px;
  /* subtle fade so text remains readable while overlaying the photo */
  background: white;
  margin: 0; /* ensure no accidental gaps */
}

/* Keep the footer as an overlaid control bar (you already reserve space for it) */
.sheet-footer{
  position: absolute !important;
  left: 0; right: 0; bottom: 0;
  z-index: 45; /* on top of content */
}

/* ensure the panel positions against the scroller */
.sheet-body{ position: relative; }

.allergen-panel {
    width: 100%;
    padding: 8px 16px;
    background: var(--primary-washed);
    border-radius: 14px 14px 0px 0px;
    z-index: 43;
}

.allergen-body {
  display: flex;
  flex-direction: row;
  justify-content: space-between; /* spreads them evenly */
  align-items: center;
  gap: 5px;                       /* 5px gap between icons */
  width: 100%;
  flex-wrap: nowrap;              /* keep them all in one row */
  overflow: hidden;               /* prevent accidental wrap overflow */
}

.allergen-body .allergen-icon {
  flex: 1;
  max-width: calc((100% - (13 * 5px)) / 14);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Keep SVGs nicely scaled */
.allergen-body .allergen-icon svg {
  width: 100%;
  height: auto;
  display: block;
}
/* Make banner obviously tappable */
.allergen-panel{ cursor:pointer; }

/* Modal overlay that sits inside .sheet-body */
.allergen-modal{
  position: absolute;       /* positioned relative to .sheet-body */
  left: 0; right: 0; top: 0;
  /* height is set dynamically to match image + banner */
  background: var(--primary-washed);
  box-shadow: var(--shadow);
  border-radius: 0;
  overflow: auto;
}

.allergen-modal[hidden]{ display:none !important; }

.allergen-modal-inner{
  padding: 16px;
  width: 100%;
}

.allergen-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.allergen-cell{
  display:flex; align-items:center; gap:10px;
  padding:6px 0px;
  background:transparent;
}
.allergen-cell .allergen-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.allergen-cell .allergen-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.allergen-cell span{
  font-size:15px; font-weight:400;
}

/* Stacking order
   8  = allergen modal's own close button (always topmost)
   7  = sheet header + content (should cover the modal while scrolling)
   6  = allergen modal window
   5  = sheet close button (kept below modal so it doesn't show through)
*/

/* modal window: above sheet close, below header/content; non-scrolling */
.allergen-modal{
  position: absolute;
  left: 0; right: 0;
  /* top + height are set dynamically */
  box-shadow: var(--shadow);
  overflow: hidden;              /* not scrollable */
  pointer-events: auto;
}

.allergen-modal[hidden]{ display:none !important; }

/* ensure header + content are above the modal */
.sheet-content{
  position: relative; /* ensure a stacking context if needed */
  z-index: 42;
}

/* ensure the sheet's own close button is below the modal */
.close-sheet{
  position: relative;
}

/* Layer order (top → bottom)
   8  = allergens modal close button
   7  = header + content + allergens banner
   6  = allergens modal window (covers only the image)
   5  = sheet close button (below modal, hidden when modal open)
   0  = product image
*/

/* Sheet close button — restored position & look */
.close-sheet {
  position: absolute;
  top: 22px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  z-index: 50; /* stays below the allergen modal */
  transition: background 0.2s ease;
}

/* Allergens modal window — covers only the image */
.allergen-modal {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 42; /* above sheet close, below header/content */
  box-shadow: var(--shadow);
  overflow: hidden;
  pointer-events: auto;
  display: flex;
  align-items: center;
}

.allergen-modal[hidden] {
  display: none !important;
}

/* Sticky header + content + banner stay above modal */
.sheet-header-sticky,
.sheet-content,
.allergen-panel {
  position: relative;
}
/* Sticky header restored */
.sheet-header-sticky {
  position: sticky;
  top: 0;                         /* stays pinned to the top of the sheet */
  background: var(--surface);     /* ensures text is readable when scrolled over image */
  padding: 12px 16px;
  z-index: 43;
}

/* Allergens modal close "bar" — sits exactly where the allergen panel is */
.allergen-close{
  position:absolute;           /* we position it via JS to match the panel */
  left:0;                      /* width + top set in JS */
  height:12px;                 /* requested height */
  background: var(--primary-washed);             /* white background */
  color: var(--primary);       /* primary text color */
  border:none;                 /* no borders */
  border-radius:0;             /* no rounded corners */
  padding:0 16px;
  margin:0;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height:12px;
  text-align:left;
  cursor:pointer;
  z-index:43;                  /* above the modal window */
  display:none;                /* only visible while modal is open */
  inset-inline: auto;       /* allow left to be set by JS */
}

/* Prevent double-tap zoom on interactive elements (mobile Safari/Chrome) */
html, body, .app,
button, a, .hbtn, .chip {
  touch-action: manipulation; /* removes double-tap zoom gesture */
}

/* Stop iOS "zoom on focus" for form controls */
input, select, textarea {
  font-size: 16px !important; /* iOS won’t zoom if 16px+ */
}

/* Ensure iOS doesn't auto-resize text (which can trigger zoom-like behavior) */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.sheet-content {
  position: relative;
  top: -22px;
}

.tab, .subtab {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start !important; /* align items left */
  text-align: left !important;        /* align text left */
}

/* Description on sheet: 15px Poppins, var(--text-dark), weight 400 */
.sheet-desc {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-dark);
  margin: 0 0 16px 0;
}

/* Hide all option groups (size, spicy, extras, note) */
.sheet-content .opts {
  display: none;
}

/* Hide quantity + Hozzáadás footer on item sheet */
.sheet-footer {
  display: none;
}

/* Turn allergen modal into a static block under the description */
.sheet-content .allergen-modal {
  position: static;
  background: var(--primary-washed);
  border-radius: 16px;
  box-shadow: none;
  margin-top: 8px;
  pointer-events: auto;
}

.sheet-content .allergen-modal-inner {
  padding: 12px 16px;
}

.sheet-content .allergen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.allergen-panel {
  display: none;
  cursor: default;
}

.allergen-empty {
  font-size: 15px;
  color: var(--text-dark);
  margin: 0;
  font-weight: 400;
}

/* Main-card description: up to 2 lines, JS adds "..." */
.desc {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: clip; /* override earlier ellipsis, JS handles the "..." */
}

/* Default: allow wrapping on small screens */
#googleRatingBtn span {
  white-space: normal;
}

/* From 360px and up: keep the text on one line */
@media (min-width: 360px) {
  #googleRatingBtn span {
    white-space: nowrap;
  }
}

.notfound {
  padding: 64px 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-dark);
}
