:root {
  --primary: #B22222;
  --dark: #111111;
  --bg: #FFFFFF;
  --text: #444444;
  --soft: #F9F9F9;
  --border: #EEEEEE;
  --footer-bg: #111111;
  --footer-bottom: #0A0A0A;
  --heading-font: 'Amatic SC', cursive;
  --body-font: 'Varela Round', system-ui, sans-serif;

  --topbar-h: 28px;
  --head-h: 58px;
  --tab-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 15px;
  line-height: 1.6;
  overscroll-behavior: none;
}

h1, h2, h3, .brand-name, .hero-title, .page-title, .sec-title, .card-name {
  font-family: var(--heading-font);
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

/* ---------- Header ---------- */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  background: #fff;
}
.top-bar {
  background: var(--primary);
  color: #fff;
  text-align: center;
  font-size: 12px;
  padding-top: var(--safe-top);
  height: calc(var(--topbar-h) + var(--safe-top));
  line-height: var(--topbar-h);
}
.top-bar { display: block; }
.head-row {
  height: var(--head-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 3px solid var(--primary);
  gap: 8px;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-logo { height: 42px; width: auto; display: block; }
.brand-logo[hidden] { display: none; }
.brand-name { font-size: 26px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brand-name[hidden] { display: none; }
.brand-logo { max-width: 45vw; object-fit: contain; }
.head-actions { flex-shrink: 0; }

.head-actions { display: flex; align-items: center; gap: 12px; }
.social-ico { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; }
.head-actions .social-ico { width: auto; height: 24px; }
.head-actions .social-ico svg { width: auto; }
.social-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.social-ico.wa { color: #25D366; }
.social-ico.ig { color: #C13584; }
.social-ico.fb { color: #1877F2; }
.social-ico .dot, .social-ico .fill { fill: currentColor; stroke: none; }

.cart-pill {
  background: #111;
  color: #fff;
  border: 0;
  border-radius: 50px;
  padding: 7px 14px;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ---------- Main / screens ---------- */
.app-main {
  padding: calc(var(--header-h, calc(var(--topbar-h) + var(--safe-top) + var(--head-h) + 3px)) + 14px) 0 calc(var(--tab-h) + var(--safe-bottom) + 14px);
  min-height: 100%;
}
.screen { display: none; padding: 0 16px; }
.screen.active { display: block; }
#screen-home { padding: 0; }

.page-title { font-size: 44px; line-height: 1.1; text-align: center; margin: 8px 0 14px; }
/* One heading per shop category, spanning the whole grid (catalog.js). */
.grid .shop-section-title { grid-column: 1 / -1; margin: 22px 0 4px; }
.grid .shop-section-title:first-child { margin-top: 4px; }
.sec-title { font-size: 40px; line-height: 1.1; text-align: center; margin-bottom: 8px; }
.lead { font-size: 16px; }
.note { color: #666; font-size: 14px; }
.status { color: #666; font-size: 14px; padding: 8px 0; text-align: center; }
.status:empty { display: none; }
.empty { text-align: center; color: #666; padding: 32px 0; }
.empty[hidden] { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 0;
  padding: 14px 24px;
  font-family: var(--body-font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.btn:active { background: var(--dark); }
.btn.block { display: block; width: 100%; }
.btn:disabled { opacity: .45; }
.btn.dark { background: var(--dark); }
.btn.wa { background: #0f7a3d; }

/* ---------- Home ---------- */
.hero {
  background: linear-gradient(160deg, #1d1d1d 0%, #111 100%);
  background-color: var(--dark, #111);   /* shows when the hero image is missing */
  background-size: cover;
  background-position: center;
  color: #fff;
  text-align: center;
  padding: 64px 20px 56px;
  position: relative;
}
.hero.has-image::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
}
.hero > * { position: relative; }
.hero-title { color: #fff; font-size: 72px; line-height: 1; }
.is-demo .hero-title { font-size: clamp(32px, 11vw, 56px); overflow-wrap: anywhere; padding: 0 14px; }
.hero-sub { margin: 6px 0 22px; font-size: 18px; color: #fff; }

.home-sec { padding: 30px 24px 6px; text-align: center; }
.home-sec p { margin: 0 auto; max-width: 520px; font-size: 15px; line-height: 1.7; }

.how { padding: 30px 20px 10px; text-align: center; }
.how .red-line { color: var(--primary); font-size: 15px; margin: 0; line-height: 1.6; }
.how-steps { margin: 26px 0 8px; display: grid; gap: 22px; }
.step { text-align: center; }
.step-num {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 26px;
  margin-bottom: 6px;
}
.step h3 { font-size: 30px; line-height: 1.1; margin-bottom: 4px; }
.step p { margin: 0; font-size: 14px; }
.how-closing { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 18px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: #ccc; margin-top: 28px; }
.footer-inner { padding: 28px 22px 8px; display: grid; gap: 22px; }
.site-footer h3 { color: #fff; font-size: 34px; line-height: 1.1; margin-bottom: 6px; }
.site-footer p { margin: 0; font-size: 14px; }
.site-footer a { color: #ccc; text-decoration: none; }
.footer-links { display: grid; gap: 6px; font-size: 14px; }
.footer-social { display: flex; gap: 10px; margin-top: 4px; }
.footer-social .social-ico { width: 36px; height: 36px; background: #fff; border-radius: 50%; padding: 9px; box-sizing: border-box; }
.footer-bottom { background: var(--footer-bottom); color: #888; text-align: center; font-size: 12px; padding: 14px; margin-top: 16px; }

/* ---------- Catalog ---------- */
.shop-sec { padding: 8px 16px 8px; max-width: 640px; margin: 0 auto; }
/* Always two products per row. Phone 390px wide: (390 - 32 side padding - 12 gap) / 2 = 173px per card. Wide screens keep the same card size by capping the section at 640px. */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card {
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  flex-direction: column;
  padding-bottom: 12px;
}
.card-img { border-radius: 12px 12px 0 0; width: 100%; aspect-ratio: 1 / 1; object-fit: var(--img-fit, cover); display: block; background: var(--img-bg, var(--soft)); }
.card-name { font-size: 28px; line-height: 1.05; text-align: center; padding: 10px 8px 2px; }
.card-desc { font-size: 11px; color: #777; text-align: center; padding: 0 10px; min-height: 30px; line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; padding: 10px 8px 4px; }
.chip {
  border: 1px solid #ccc;
  background: #fff;
  color: var(--dark);
  font-family: var(--body-font);
  font-size: 11px;
  padding: 6px 7px;
  cursor: pointer;
}
.chip.sel { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.chip:disabled { opacity: .4; text-decoration: line-through; }
.card-price { text-align: center; font-size: 20px; font-weight: 700; color: var(--dark); padding: 6px 0 8px; }
.card .btn { margin: 0 10px; padding: 11px 6px; font-size: 13px; }
.oos { text-align: center; font-size: 12px; color: #777; padding: 4px 0; }

/* ---------- Cart ---------- */
.cart-row { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-img { width: 72px; height: 72px; object-fit: cover; background: var(--soft); flex-shrink: 0; }
.cart-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cart-name { font-size: 16px; font-weight: 700; color: var(--dark); line-height: 1.3; }
.cart-sub { font-size: 12px; color: #777; }
.cart-price { font-size: 15px; color: var(--text); }
.qty { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.qty-btn {
  width: 32px; height: 32px;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  color: var(--dark);
  cursor: pointer;
}
.qty-num { min-width: 20px; text-align: center; font-weight: 700; color: var(--dark); }
.cart-footer { padding-top: 16px; }
.cart-footer[hidden] { display: none; }
.cart-total-row { display: flex; justify-content: space-between; font-size: 18px; margin-bottom: 10px; color: var(--dark); }
.min-note { background: var(--soft); border: 1px solid #ddd; color: var(--primary); font-size: 13px; padding: 10px 12px; margin-bottom: 12px; }
.min-note[hidden] { display: none; }
.hint { color: #666; font-size: 12px; margin-top: 8px; text-align: center; }

/* ---------- FAQ / contact ---------- */
details.faq { border-bottom: 1px solid var(--border); padding: 12px 0; }
details.faq summary { font-weight: 700; color: var(--dark); cursor: pointer; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; float: left; color: var(--primary); font-size: 20px; line-height: 1; }
details.faq[open] summary::after { content: '\2212'; }
details.faq p { margin: 8px 0 0; font-size: 14px; }
.help-box { background: var(--soft); border: 1px solid #ddd; padding: 20px 16px; margin-top: 22px; text-align: center; display: grid; gap: 8px; }
.help-box h3 { font-size: 34px; }
.help-box p { margin: 0; font-size: 14px; }
.help-box a { color: var(--dark); font-weight: 700; text-decoration: none; }

/* ---------- Bottom tab bar ---------- */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: #fff;
  border-top: 1px solid var(--border);
  z-index: 30;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  border: 0; background: none;
  color: #666;
  font-size: 11px;
  font-family: var(--body-font);
  cursor: pointer;
}
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--primary); }

/* ---------- Content blocks (config key "content") ---------- */
#contentBlocks[hidden] { display: none; }
.cb-actions { display: grid; grid-template-columns: repeat(var(--cb-cols, 4), minmax(0, 1fr)); gap: 10px; padding: 18px 16px 4px; max-width: 640px; margin: 0 auto; }
.cb-action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; background: #fff; border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.cb-action:active { background: var(--soft); }
.cb-action .ico-badge { flex: none; }
.cb-action-label { font-size: 13px; font-weight: 700; text-align: center; line-height: 1.2; }
.cb-sec { padding: 26px 16px 4px; max-width: 640px; margin: 0 auto; }
.cb-services { display: grid; gap: 12px; }
.cb-service { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.cb-service-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--soft); }
.cb-service-body { padding: 12px 14px 14px; }
.cb-service-title { margin: 0 0 4px; font-size: 30px; line-height: 1.05; color: var(--primary); }
.cb-service-text { margin: 0; font-size: 15px; line-height: 1.6; }
.cb-service-price { margin-top: 8px; font-weight: 700; color: var(--dark); }
.cb-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cb-thumb { padding: 0; border: 0; background: var(--soft); border-radius: 10px; overflow: hidden; aspect-ratio: 1 / 1; cursor: pointer; }
.cb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cb-hours { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 4px 14px; }
.cb-hours-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.cb-hours-row:last-child { border-bottom: 0; }
.cb-hours-days { font-weight: 700; }
.cb-lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.cb-lightbox[hidden] { display: none; }
.cb-lightbox img { max-width: 100%; max-height: 80vh; border-radius: 8px; }
.cb-lightbox-x { position: absolute; top: calc(var(--safe-top, 0px) + 10px); inset-inline-start: 12px; border: 0; background: none; color: #fff; font-size: 38px; line-height: 1; cursor: pointer; }
.cb-lightbox-cap { color: #fff; margin-top: 12px; font-size: 15px; text-align: center; }

.cb-form { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px 14px; display: grid; gap: 12px; }
.cb-field { display: grid; gap: 4px; }
.cb-label { font-size: 13px; font-weight: 700; }
.cb-field input, .cb-field textarea { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 16px; background: #fff; color: var(--text); }
.cb-field input:focus, .cb-field textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; }
.cb-hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; opacity: 0; }
.cb-note { margin: 0; font-size: 12px; opacity: .75; line-height: 1.5; }
.cb-note a { color: var(--primary); }
.cb-status { min-height: 18px; font-size: 14px; text-align: center; }
.cb-status.err { color: #b00020; font-weight: 700; }
.cb-success { text-align: center; padding: 18px 8px; font-size: 18px; font-weight: 700; color: var(--primary); line-height: 1.5; }

/* ---------- App types (features.appType): hide what does not exist in this kind of app ---------- */
html[data-app-type="catalog"] .cart-pill, html[data-app-type="content"] .cart-pill,
html[data-app-type="catalog"] #screen-cart, html[data-app-type="content"] #screen-cart,
html[data-app-type="catalog"] .tab[data-screen="areas"], html[data-app-type="content"] .tab[data-screen="areas"],
html[data-app-type="catalog"] #screen-areas, html[data-app-type="content"] #screen-areas,
html[data-app-type="catalog"] #orderBar, html[data-app-type="content"] #orderBar,
html[data-app-type="catalog"] #welcomeCard, html[data-app-type="content"] #welcomeCard,
html[data-app-type="catalog"] #reorderCard, html[data-app-type="content"] #reorderCard,
html[data-app-type="content"] #shopSection { display: none !important; }

/* ---------- App box / offline ---------- */
#appBox .btn { width: 100%; }
#appBox .btn[hidden] { display: none; }
.offline { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; }
.offline[hidden] { display: none; }
.offline-box { text-align: center; max-width: 320px; display: grid; gap: 12px; }
.offline-box h2 { font-size: 48px; line-height: 1.05; }
.offline-box p { margin: 0; }

/* ---------- Link groups (edited in the dashboard) ---------- */
.link-group { margin: 6px 0 22px; }
.link-title { font-size: 34px; line-height: 1.1; text-align: center; margin-bottom: 8px; }
.link-list { border: 1px solid var(--border); background: #fff; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--dark); text-decoration: none; font-weight: 700; }
.link-row:last-child { border-bottom: 0; }
.link-row:active { background: var(--soft); }
.ico-badge { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.ico-badge svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.link-emoji { font-size: 20px; width: 34px; text-align: center; }

.grid.cols-1 { grid-template-columns: 1fr; }
.grid.cols-1 .card-img { aspect-ratio: 16 / 10; }
.grid.no-desc .card-desc { display: none; }
.ship-bar { margin: 12px 0 0; padding: 12px; background: var(--soft); border: 1px solid #ddd; font-size: 13px; color: var(--dark); }
.ship-bar[hidden], .coupon-note[hidden] { display: none; }
.ship-track { height: 6px; background: #e3e3e3; margin-top: 8px; }
.ship-fill { height: 100%; background: var(--primary); }
.coupon-note { margin: 10px 0 0; padding: 10px 12px; border: 1px dashed var(--primary); color: var(--primary); font-size: 13px; text-align: center; }

/* First-visit offer card */
.welcome { position: relative; margin: 16px 16px 0; padding: 20px 18px 18px; border-radius: 16px; text-align: center;
  background: var(--soft); border: 1px dashed var(--primary); }
.welcome-x { position: absolute; top: 6px; inset-inline-start: 8px; border: 0; background: none; font-size: 24px; line-height: 1; color: var(--text); opacity: .6; cursor: pointer; }
.welcome-title { margin: 0 0 6px; font-size: 34px; color: var(--primary); line-height: 1.05; }
.welcome-text { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.welcome-code { display: inline-block; padding: 6px 18px; border-radius: 10px; background: #fff; border: 1px solid var(--border); font-weight: 700; letter-spacing: 2px; direction: ltr; }
.welcome-note { margin: 8px 0 12px; font-size: 12px; opacity: .75; }

/* Order cutoff bar and reorder card */
.order-bar { padding: 8px 14px; text-align: center; font-size: 14px; font-weight: 700; background: var(--dark); color: #fff; }
.order-bar.closed { background: #6b6b6b; }
.reorder { margin: 16px 16px 0; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--border); text-align: center; }
.reorder-title { margin: 0 0 4px; font-size: 30px; color: var(--primary); line-height: 1.05; }
.reorder-list { margin: 0 0 12px; font-size: 14px; line-height: 1.6; }

/* Scheduled promo banners, update gate, delivery check */
.promo { position: relative; padding: 10px 40px 10px 14px; background: var(--primary); color: #fff; font-size: 14px; line-height: 1.5; text-align: center; cursor: pointer; }
.promo-x { position: absolute; top: 4px; inset-inline-start: 6px; border: 0; background: none; color: #fff; font-size: 22px; line-height: 1; opacity: .85; cursor: pointer; }
.update-gate { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; padding: 24px; }
.update-gate[hidden] { display: none; }
.gate-box { background: #fff; border-radius: 18px; padding: 26px 22px; text-align: center; max-width: 340px; }
.gate-box h2 { margin: 0 0 8px; font-size: 36px; color: var(--primary); line-height: 1.05; }
.gate-box p { margin: 0 0 16px; line-height: 1.6; }
.areas-check { margin: 18px 16px 0; padding: 16px; border-radius: 14px; background: var(--soft); text-align: center; }
.areas-check[hidden] { display: none; }
.areas-check h3 { margin: 0 0 10px; font-size: 28px; color: var(--primary); line-height: 1.05; }
.check-row { display: flex; gap: 8px; }
.check-row input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; }
.check-result { margin: 10px 0 0; font-weight: 700; min-height: 1.2em; }
.check-result.yes { color: #1f7a45; } .check-result.no { color: #a33; }

/* Weight selector: a plain dropdown, like the website */
.var-wrap { padding: 8px 10px 0; }
.var-select { width: 100%; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.var-single { text-align: center; font-size: 13px; color: #555; padding: 8px 10px 0; }
.grid.cols-1 { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
.shop-sec { scroll-margin-top: 110px; }

.var-select { color: #222; -webkit-text-fill-color: #222; opacity: 1; line-height: 1.4; min-height: 42px; text-overflow: ellipsis; }
.var-select option { color: #222; background: #fff; }
.grid.cols-1 { max-width: none; }
.gate-block a.btn { text-decoration: none; display: block; }
#appBox .btn.ghost { background: transparent; color: var(--dark); border: 1px solid var(--border); }
#appBox .btn.danger { background: #fff; border: 3px solid #d00000; color: #d00000; font-weight: 800; }
#appBox .btn:disabled { opacity: .55; cursor: default; }

/* ---------- Tablets (768px and wider) ----------
   Phones are untouched. On a tablet the content gets a comfortable width instead of a narrow
   phone column in the middle of an empty screen, products fill more columns, and the tab bar
   no longer stretches across the whole screen. */
@media (min-width: 768px) {
  /* Other screens (delivery areas, contact, settings, cart) are a centered reading column. */
  .screen:not(#screen-home) { max-width: 720px; margin: 0 auto; padding: 0 24px; }
  .screen:not(#screen-home) .help-box, .screen:not(#screen-home) .link-group { max-width: 720px; }

  /* Home: hero keeps its full width but is a little taller and its text stays readable. */
  .hero { padding: 96px 32px 88px; }
  .hero-title { font-size: 92px; }
  .hero-sub { font-size: 21px; }
  .home-sec { padding: 40px 32px 8px; }
  .home-sec p { max-width: 640px; font-size: 16px; }

  /* "How to order": the steps sit side by side. */
  .how { padding: 40px 32px 12px; max-width: 1000px; margin: 0 auto; }
  .how-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; align-items: start; }

  /* Products: 3 per row on a tablet, 4 on a big landscape tablet. The cards keep a phone-like size. */
  .shop-sec { max-width: 980px; padding: 12px 24px 8px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .grid.cols-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }

  /* Content blocks (actions, services, gallery, hours, form). */
  .cb-actions, .cb-sec { max-width: 860px; padding-left: 24px; padding-right: 24px; }
  .cb-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

  .welcome, .reorder { max-width: 720px; margin-left: auto; margin-right: auto; }

  .footer-inner { max-width: 980px; margin: 0 auto; padding: 36px 32px 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Tab bar: tabs keep a sensible width and sit in the middle. */
  .tab-bar { justify-content: center; }
  .tab { flex: 0 1 150px; font-size: 12px; }
  .tab svg { width: 24px; height: 24px; }
}
@media (min-width: 1100px) {
  .shop-sec { max-width: 1120px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid.cols-1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cb-gallery { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ---------- Sales demo notice (shown only when the app runs inside the demo page) ---------- */
.demo-notice { position: fixed; inset-inline: 16px; bottom: calc(var(--tab-h) + var(--safe-bottom) + 14px); z-index: 60; background: #222; color: #fff; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; text-align: center; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.demo-notice.show { opacity: 1; transform: none; }

/* ---------- Site blocks (blocks.js): the business's own pages, in the order of its website ---------- */
html.has-blocks #hero, html.has-blocks #homeSections, html.has-blocks #howTo, html.has-blocks #shopSection { display: none; }
.sb { padding: 30px 18px; }
.sb:nth-of-type(even) { background: var(--soft, #f6f6f6); }
.sb-in { max-width: 720px; margin: 0 auto; }
.sb .sec-title { text-align: center; margin: 0 0 12px; }
.sb-sub { text-align: center; margin: 4px 0 10px; font-size: 22px; color: var(--dark); }
.sb-p { margin: 0 0 12px; font-size: 16px; line-height: 1.7; }
.sb-img { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; margin: 14px 0; }
.sb-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0 4px; }
.sb-btns .btn { margin: 0; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-width: 150px; }
.sb-hero { background-color: var(--dark, #111); background-size: cover; background-position: center; color: #fff; text-align: center; padding: 56px 18px 48px; }
.sb-hero .sec-title, .sb-hero .sb-sub, .sb-hero .sb-p { color: #fff; }
.sb-hero .sec-title { font-size: clamp(32px, 11vw, 56px); line-height: 1.1; overflow-wrap: anywhere; }
.sb-hero .sb-sub { font-size: 20px; }
.sb-hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.7); background: transparent; }
.sb-menu { display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px; background: #fff; border-bottom: 1px solid var(--border, #e5e5e5); scrollbar-width: none; }
.sb-menu::-webkit-scrollbar { display: none; }
.sb-chip { flex: 0 0 auto; border: 1px solid var(--primary); color: var(--primary); background: #fff; border-radius: 50px; padding: 8px 16px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.sb-chip.wa { background: var(--primary); color: #fff; }
.sb-cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 14px 0; }
.sb-card { background: #fff; border: 1px solid var(--border, #e5e5e5); border-radius: 14px; padding: 18px; text-align: center; }
.sb:nth-of-type(even) .sb-card { background: #fff; }
.sb-card-img { height: 56px; width: auto; max-width: 100%; object-fit: contain; margin-bottom: 8px; }
.sb-card-title { margin: 0 0 6px; font-size: 22px; color: var(--dark); }
.sb-card-text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text); }
.sb-quotes { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 14px; margin: 14px -18px 0; padding-inline: 18px; scrollbar-width: thin; }
.sb-quote { flex: 0 0 82%; max-width: 360px; scroll-snap-align: center; background: #fff; border: 1px solid var(--border, #e5e5e5); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.sb-stars { color: var(--primary); letter-spacing: 2px; }
.sb-quote .sb-card-text { font-size: 15px; }
.sb-quote-name { font-weight: 700; color: var(--dark); margin-top: auto; }
.sb-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.sb-stat { background: #fff; border-radius: 14px; border: 1px solid var(--border, #e5e5e5); padding: 18px 8px; text-align: center; }
.sb-stat-num { font-size: 38px; font-weight: 800; color: var(--primary); line-height: 1; direction: ltr; }
.sb-stat-label { margin-top: 8px; font-size: 14px; color: var(--text); }
.sb-back { display: inline-block; margin: 0 0 8px; border: 0; background: none; color: var(--primary); font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; padding: 6px 0; }
#screen-sitepage .sb { padding-inline: 4px; }
.card { position: relative; }
.card-badge { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--dark); color: #fff; font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 50px; }
.card.is-sold .card-img { filter: grayscale(.7); opacity: .75; }
.card-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; padding: 2px 8px 4px; }
.card-fact { font-size: 12px; color: #555; background: var(--soft, #f3f3f3); border-radius: 50px; padding: 2px 8px; }
.is-demo .card-name { font-size: 20px; line-height: 1.2; }
@media (min-width: 768px) {
  .sb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sb-quote { flex-basis: 46%; }
}
.sb .sec-title { font-size: clamp(24px, 7.2vw, 36px); line-height: 1.2; overflow-wrap: anywhere; }
.sb-hero .sec-title { font-size: clamp(32px, 11vw, 56px); }

/* Catalog: filter between available and sold, and the WhatsApp button of a car */
.cat-filter { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 4px 0 14px; }
.cat-chip { border: 1px solid var(--primary); color: var(--primary); background: #fff; border-radius: 50px; padding: 8px 16px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.cat-chip.on { background: var(--primary); color: #fff; }
.card .btn.card-site { display: block; width: calc(100% - 20px); margin: 0 10px 10px; background: transparent; color: var(--dark); border: 1px solid var(--border); }

/* Posts of the client's WordPress site (wpposts.js) */
.wp-list { display: grid; gap: 12px; }
.wp-card { display: block; width: 100%; text-align: start; font: inherit; color: inherit; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; padding: 0; cursor: pointer; }
.wp-card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--soft); }
.wp-card-body { padding: 12px 14px 14px; }
.wp-date { font-size: 13px; color: #6b6b6b; margin-bottom: 4px; }
.wp-card-title { margin: 0 0 6px; font-size: 22px; line-height: 1.2; color: var(--primary); }
.wp-card-text { margin: 0; font-size: 15px; line-height: 1.6; }
.wp-body { max-width: 640px; }
.wp-p { margin: 0 0 14px; font-size: 16px; line-height: 1.75; }
.wp-quote { border-inline-start: 4px solid var(--primary); padding-inline-start: 12px; color: #444; }
.wp-h { margin: 20px 0 8px; font-size: 22px; color: var(--primary); }
.wp-q { margin: 22px 0 6px; padding-top: 16px; border-top: 1px solid rgba(0,0,0,.12); font-size: 17px; line-height: 1.5; font-weight: 700; }
.wp-h + .wp-q { margin-top: 8px; padding-top: 0; border-top: 0; }
.wp-img { max-width: 100%; height: auto; border-radius: 12px; display: block; margin: 0 0 14px; }
.wp-cover { width: 100%; }

/* Demo: the prospect's own font is usually wider than the display font the template was drawn for, so the big titles are smaller. */
.is-demo .cb-sec .sec-title { font-size: clamp(24px, 7vw, 32px); line-height: 1.2; overflow-wrap: anywhere; }
.is-demo .shop-sec .page-title { font-size: clamp(26px, 8vw, 34px); line-height: 1.2; }
.is-demo .cb-service-title { font-size: 22px; line-height: 1.25; }

.sb:not(.sb-hero) .sec-title.sec-long { font-size: clamp(20px, 5.6vw, 26px); line-height: 1.3; }

/* Web App install card */
.install-card {
  position: fixed; z-index: 40;
  inset-inline: 10px; bottom: calc(var(--tab-h) + var(--safe-bottom) + 10px);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}
.install-logo { width: 44px; height: 44px; object-fit: contain; flex: none; }
.install-body { flex: 1; min-width: 0; }
.install-title { display: block; color: var(--dark); font-size: 15px; line-height: 1.3; }
.install-text { margin: 4px 0 8px; font-size: 13px; line-height: 1.4; }
.install-row { display: flex; align-items: center; gap: 10px; }
.install-row .btn { padding: 9px 14px; font-size: 14px; }
.install-later { border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; text-decoration: underline; padding: 8px 4px; cursor: pointer; }

/* Pull to refresh */
.ptr {
  position: fixed; z-index: 35; left: 50%;
  top: calc(var(--header-h, 120px) - 40px);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--bg); color: var(--dark);
  border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .15);
  font-size: 13px; opacity: 0; pointer-events: none;
  transform: translate(-50%, 0); transition: opacity .15s;
}
.ptr-arrow { display: inline-block; font-size: 16px; line-height: 1; transition: transform .15s; }
.ptr-spin { animation: ptr-rot .8s linear infinite; }
@keyframes ptr-rot { to { transform: rotate(360deg); } }

/* A page of the site shown inside the app */
.sf-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.sf-out { font-size: 12px; color: #777; text-decoration: underline; }
.sf-loading { text-align: center; color: #777; padding: 24px 0; }
.sf-loading[hidden] { display: none; }
.sf-frame { display: block; width: 100%; height: calc(100vh - var(--header-h, 120px) - var(--tab-h) - var(--safe-bottom) - 64px); border: 0; background: #fff; }
.sf-frame:not([src]) { display: none; }

/* New version notice (update.js): a card above the tab bar. The urgent one has no close button. */
.upd-bar {
  position: fixed; z-index: 90; inset-inline: 12px;
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 12px);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--dark, #222); color: #fff;
  border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  font-size: 14px; line-height: 1.4;
}
.upd-bar.is-urgent { background: var(--primary); }
.upd-text { flex: 1; font-weight: 600; }
.upd-go { border: 0; border-radius: 8px; padding: 8px 14px; background: #fff; color: #222; font: inherit; font-weight: 700; cursor: pointer; }
.upd-go:disabled { opacity: .7; }
.upd-x { border: 0; background: none; color: #fff; font-size: 22px; line-height: 1; padding: 2px 6px; cursor: pointer; }
