/*
 * MyLocal — directory pages: shops, products, local professionals, areas,
 * categories, search, the shopping list and the static pages.
 *
 * Built only on the tokens in app.css. Every rule here is new; nothing from
 * the old site.css survives.
 */

/* --------------------------------------------------------- page heads -- */

.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px;
}
.section-title { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); margin: 0; letter-spacing: -.02em; }
.section-sub { color: var(--muted); margin: 6px 0 0; font-size: .95rem; }
.section-head .form-select { min-height: 44px; border-radius: 10px; }

/* --------------------------------------------------------- tiles/cards -- */

.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .card-grid.wide-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 400px) { .card-grid { gap: 10px; } }

.tile {
  display: flex; flex-direction: column; min-width: 0; height: 100%; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: var(--ink);
  transition: box-shadow .15s, border-color .15s;
}
a.tile:hover { color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow); }
a.tile:hover .tile-title { text-decoration: underline; }
.tile-inert { opacity: .75; }
.tile-media {
  position: relative; aspect-ratio: 4 / 3; background: linear-gradient(145deg, var(--bg-soft), #e9edf2); overflow: hidden;
  display: grid; place-items: center;
}
.tile-media img { width: 100%; height: 100%; object-fit: cover; }
.tile-fallback {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-weight: 800; font-size: 1.35rem;
  color: var(--brand-ink); background: var(--brand-soft); letter-spacing: -.02em;
}
.tile-fallback .bi { font-size: 1.6rem; }
.tile-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.tile-title { font-size: .95rem; font-weight: 700; line-height: 1.3; margin: 0; color: var(--ink); }
.tile-meta { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.tile-text { font-size: .85rem; color: var(--ink-2); margin: 6px 0 0; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge-verified { color: var(--info); font-size: .85rem; margin-left: 2px; }
@media (max-width: 575.98px) { .tile-body { padding: 10px 12px 12px; } .tile-title { font-size: .9rem; } }

/* ------------------------------------------------------ listing layout -- */

.listing-split { display: grid; gap: 24px; align-items: start; }
@media (min-width: 992px) { .listing-split { grid-template-columns: 260px minmax(0, 1fr); gap: 28px; } }
.filter-sidebar { position: sticky; top: calc(var(--stick, var(--header-h)) + 64px); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; background: #fff; }
.filter-form { display: grid; gap: 18px; }
.filter-group { border: 0; margin: 0; padding: 0; }
.filter-label { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.filter-group .form-check { display: flex; align-items: center; gap: 8px; min-height: 36px; margin: 0; padding-left: 0; }
.filter-group .form-check-input { margin: 0; float: none; flex-shrink: 0; }
.filter-group .form-check-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; font-size: .9rem; cursor: pointer; }
.filter-count { font-size: .75rem; color: var(--muted); background: var(--bg-soft); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.filter-actions { display: flex; gap: 8px; align-items: center; position: sticky; bottom: 0; background: #fff; padding-top: 8px; }
.filter-actions .btn { flex: 1; }
.filter-badge { display: inline-grid; place-items: center; min-width: 1.67em; height: 1.67em; border-radius: .83em; background: var(--ink); color: #fff; font-size: .75rem; margin-left: 4px; }
.filter-sheet { height: 82vh !important; border-radius: 20px 20px 0 0; }
.filter-sheet .offcanvas-header { border-bottom: 1px solid var(--line); }
@media (max-width: 991.98px), (pointer: coarse) { .filter-group .form-check { min-height: 44px; } }

.empty { text-align: center; padding: 48px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); }
.empty > .bi { font-size: 2.6rem; color: var(--muted); display: block; margin-bottom: 10px; }

/* ---------------------------------------------------------------- pills -- */

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-size: .85rem; font-weight: 600; text-decoration: none;
}
.pill:hover { background: var(--bg-soft); color: var(--ink); }
.pill.active, .pill[aria-current="page"], .pill[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill.is-tight { min-height: 30px; padding: 0 10px; font-size: .8rem; }
@media (max-width: 991.98px) { .pill { min-height: 44px; } }
.trust-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--info-soft); color: var(--info); font-size: .78rem; font-weight: 700; }

/* --------------------------------------------------------------- panels -- */

.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; background: #fff; margin-bottom: 16px; scroll-margin-top: calc(var(--stick, var(--header-h)) + 72px); }
.panel-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 14px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.field-error { color: var(--danger); font-size: .85rem; margin-top: 4px; font-weight: 500; }
.btn-amber { --bs-btn-bg: #fff7e6; --bs-btn-color: #7a4504; --bs-btn-border-color: #f3c97a; --bs-btn-hover-bg: #ffeccc; --bs-btn-hover-color: #5f3603; --bs-btn-hover-border-color: #e8ad45; }

/* ------------------------------------------------------- business page -- */

/* Name beside the logo (or initials), contact card in the same column as the
   sidebar below, so the page has one right-hand edge from top to bottom. */
.vendor-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 20px; }
.vendor-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.vendor-logo {
  width: 56px; height: 56px; flex: none; border-radius: 16px; overflow: hidden; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em;
}
.vendor-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.vendor-name { font-size: 1.4rem; line-height: 1.25; margin: 0 0 4px; }
.vendor-head .contact-card { max-width: none; }
@media (min-width: 992px) {
  .vendor-head { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; margin-bottom: 24px; align-items: center; }
  .vendor-id { gap: 18px; }
  .vendor-logo { width: 72px; height: 72px; border-radius: 20px; font-size: 1.5rem; }
  .vendor-name { font-size: 1.65rem; }
}

/* The business's banner behind its name, under a dark wash so the white words
   read on any photograph. The upload is 1600 x 400; phones show its middle. */
.vendor-id.has-cover {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 18px; min-height: 172px;
  padding: 18px; align-items: flex-end; background: #0f172a;
}
.vendor-cover { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.vendor-id.has-cover::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(0deg, rgba(15, 23, 42, .9) 0%, rgba(15, 23, 42, .5) 60%, rgba(15, 23, 42, .15) 100%);
}
.has-cover .vendor-name { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.has-cover .text-muted, .has-cover .rating { color: rgba(255, 255, 255, .88) !important; }
.has-cover .vendor-logo { box-shadow: 0 0 0 3px rgba(255, 255, 255, .92); }
/* Phones and tablets: the logo above the name, both at the foot of the
   picture, so the top of the photograph stays in view. */
@media (max-width: 991.98px) {
  .vendor-id.has-cover { flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 10px; padding-top: 56px; }
  .has-cover .vendor-logo { width: 48px; height: 48px; border-radius: 14px; font-size: 1rem; }
}
@media (min-width: 992px) {
  .vendor-head.with-cover { align-items: stretch; }
  .vendor-id.has-cover { padding: 24px 28px; align-items: center; }
  .vendor-id.has-cover::before {
    background: linear-gradient(90deg, rgba(15, 23, 42, .88) 0%, rgba(15, 23, 42, .55) 50%, rgba(15, 23, 42, .12) 100%);
  }
}
.kv-full { grid-column: 1 / -1; }
.hours-table th { white-space: nowrap; }

.profile-nav {
  position: sticky; top: var(--stick, var(--header-h)); z-index: 1010; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  background: #fff; border-bottom: 1px solid var(--line); margin: 0 0 20px; padding: 0;
}
.profile-nav::-webkit-scrollbar { display: none; }
.profile-nav a {
  flex-shrink: 0; display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; color: var(--ink-2); font-weight: 600;
  font-size: .9rem; text-decoration: none; border-bottom: 2px solid transparent;
}
.profile-nav a:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-split { display: grid; gap: 20px; align-items: start; }
@media (min-width: 992px) { .detail-split { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; } .detail-split > :last-child { position: sticky; top: calc(var(--stick, var(--header-h)) + 64px); } }
.direct-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand-ink); font-size: .85rem; font-weight: 600; }

.service-list { list-style: none; padding: 0; margin: 0; }
.service-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.service-row:last-child { border-bottom: 0; }
.service-name { font-weight: 700; margin: 0; font-size: .95rem; }
.service-desc { color: var(--ink-2); font-size: .875rem; margin: 4px 0 0; }
.service-side { text-align: right; flex-shrink: 0; }
.service-price { font-weight: 700; white-space: nowrap; }

.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gallery-grid a, .gallery-grid figure { display: block; margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--bg-soft); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery-grid a:hover img { transform: scale(1.03); }

.review-summary { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; margin-bottom: 16px; }
.review-score { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.review-spread { display: grid; gap: 6px; flex: 1; min-width: 200px; }
.review-spread-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 32px; gap: 8px; align-items: center; font-size: .8rem; color: var(--muted); }
.review-spread-bar { height: 8px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; }
.review-spread-bar > span { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.review-spread-count { text-align: right; }
.review-writer { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.review-writer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.type-choice { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.type-option { position: relative; display: block; cursor: pointer; }
.type-option input { position: absolute; opacity: 0; }
.type-option-body { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line-2); border-radius: var(--radius); min-height: 72px; background: #fff; }
.type-option input:checked + .type-option-body { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.type-option input:focus-visible + .type-option-body { outline: 3px solid var(--brand-ring); }
.type-option-title { font-weight: 700; display: block; }
.type-option-hint { font-size: .82rem; color: var(--muted); display: block; }

/* ------------------------------------------------------ city / area hub -- */

.hero-path { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); text-decoration: none; color: var(--ink); background: #fff; height: 100%; }
.hero-path:hover { border-color: var(--line-2); box-shadow: var(--shadow); color: var(--ink); }
.hero-paths { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.hero-path-title { font-weight: 700; font-size: 1rem; }
.hero-path-sub { font-size: .85rem; color: var(--muted); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 20px; }
.hero-stat strong { display: block; font-size: 1.4rem; font-weight: 800; }
.hero-stat span { color: var(--muted); font-size: .85rem; }
.hero-search { max-width: 560px; }
.how-it-works { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.cat-group { border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; margin-bottom: 12px; overflow: hidden; }
.cat-group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; min-height: 56px; }
.cat-group-name { font-weight: 700; margin: 0; font-size: 1rem; }
.cat-group-count { color: var(--muted); font-size: .85rem; }
.cat-group-body { padding: 0 18px 18px; }

/* ------------------------------------------------------- shopping list -- */

.shop-group { border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; padding: 18px; }
.shop-group + .shop-group { margin-top: 16px; }
.checkout-line { display: grid; grid-template-columns: auto 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.checkout-line:last-of-type { border-bottom: 0; }
.checkout-line img, .checkout-line .tile-fallback { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; font-size: .95rem; }
.checkout-line-item { min-width: 0; }
.checkout-line-item .name { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.qty-form { display: inline-flex; align-items: center; gap: 6px; }
.qty-form .form-select { min-height: 40px; width: auto; padding-right: 2rem; }
.order-box { border-top: 1px dashed var(--line-2); margin-top: 12px; padding-top: 16px; }

/* ----------------------------------------------------------- accordion -- */

.accordion { --bs-accordion-border-color: var(--line); --bs-accordion-border-radius: var(--radius-lg); --bs-accordion-inner-border-radius: var(--radius-lg); --bs-accordion-active-bg: var(--bg-soft); --bs-accordion-active-color: var(--ink); --bs-accordion-btn-focus-box-shadow: 0 0 0 4px var(--brand-ring); }
.accordion-button { font-weight: 600; min-height: 56px; color: var(--ink); }
.faq-group { font-size: 1.1rem; margin: 28px 0 8px; }
.faq-group:first-child { margin-top: 0; }

/* ---------------------------------------------- quick-commerce products -- */

.pgrid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 576px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1200px) { .pgrid.wide { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.pcard { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: visible; }
.pcard.is-inert { opacity: .7; }
.pcard-media { position: relative; aspect-ratio: 1; margin: 8px 8px 0; border-radius: 10px; background: var(--bg-soft); display: grid; place-items: center; }
.pcard-media > a { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 10px; overflow: hidden; }
.pcard-media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.pcard-media .tile-fallback { width: 64px; height: 64px; }
.pcard-off {
  position: absolute; left: 6px; top: 6px; background: #1d4ed8; color: #fff; font-size: .75rem; font-weight: 800; letter-spacing: .02em;
  padding: 3px 6px; border-radius: 6px;
}
.pcard-add { position: absolute; right: 6px; bottom: -14px; width: 76px; z-index: 2; }
.pcard-add form { margin: 0; }
.pcard-add-btn {
  width: 100%; min-height: 36px; border-radius: 9px; border: 1px solid var(--success); background: #fff; color: var(--success);
  font-weight: 800; font-size: .82rem; letter-spacing: .04em; box-shadow: var(--shadow-sm);
}
.pcard-add-btn:hover { background: var(--success-soft); }
.pcard-stepper {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 36px; border-radius: 9px; background: var(--success); color: #fff;
  font-weight: 800; box-shadow: var(--shadow-sm);
}
.pcard-stepper button { border: 0; background: transparent; color: #fff; font-size: 1.05rem; font-weight: 800; min-height: 36px; border-radius: 9px; }
.pcard-stepper output { min-width: 16px; text-align: center; font-size: .9rem; }
.pcard-stepper[hidden], .pcard-add form[hidden] { display: none; }
@media (max-width: 991.98px), (pointer: coarse) { .pcard-add-btn, .pcard-stepper, .pcard-stepper button { min-height: 44px; } .pcard-add { bottom: -18px; } }

.pcard-body { padding: 22px 10px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pcard-price { display: flex; align-items: baseline; gap: 6px; font-size: .95rem; }
.pcard-price strong { font-weight: 800; color: var(--ink); }
.pcard-price s { color: var(--muted); font-size: .8rem; }
.pcard-name { font-size: .85rem; font-weight: 600; line-height: 1.3; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pcard-name a { color: var(--ink); text-decoration: none; }
.pcard-name a:hover { text-decoration: underline; }
.pcard-shop { font-size: .75rem; color: var(--muted); display: flex; gap: 4px; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pcard-oos { font-size: .75rem; color: var(--danger); font-weight: 700; }
.rail > .pcard { height: 100%; }

/* store: category column + grid, Instamart-style on phones too */
.store-layout { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 992px) { .store-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; } }
.store-cats { position: sticky; top: calc(var(--stick, var(--header-h)) + 8px); max-height: calc(100vh - var(--header-h) - 90px); overflow-y: auto; scrollbar-width: thin; border-right: 1px solid var(--line); padding-right: 8px; }
.store-cats a {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px; border-radius: 12px; color: var(--ink-2);
  text-decoration: none; font-size: .85rem; font-weight: 600; position: relative;
}
.store-cats a .cat-icon { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 12px; flex-shrink: 0; }
.store-cats a:hover { background: var(--bg-soft); color: var(--ink); }
.store-cats a[aria-current="page"] { background: var(--success-soft); color: var(--ink); }
.store-cats a[aria-current="page"]::after { content: ""; position: absolute; right: -9px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--success); }
@media (max-width: 991.98px) {
  .store-cats { padding-right: 4px; }
  .store-cats a { flex-direction: column; text-align: center; gap: 4px; font-size: .75rem; line-height: 1.2; padding: 8px 2px; min-height: 72px; }
  .store-cats a[aria-current="page"]::after { right: -5px; }
  .store-layout .pgrid { gap: 10px; }
}
.store-toolbar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.store-toolbar::-webkit-scrollbar { display: none; }

/* the shopping-list bar, Zepto-style */
.list-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 1036; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 14px;
  background: var(--success); color: #fff; text-decoration: none; box-shadow: var(--shadow-lg);
}
.list-bar:hover { color: #fff; filter: brightness(1.05); }
.list-bar[hidden] { display: none; }
.list-bar strong { display: block; font-size: 1rem; }
.list-bar span { font-size: .8rem; opacity: .9; }
.list-bar .go { font-weight: 800; display: flex; align-items: center; gap: 6px; }
@media (min-width: 992px) { .list-bar { bottom: 24px; } }
@media (max-width: 575.98px) { .pcard-add { width: 68px; right: 4px; } .pcard-body { padding: 24px 8px 10px; } .pcard-media { margin: 6px 6px 0; } }

/* product page, Blinkit-style */
.pview-media { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius-xl); background: #fff; display: grid; place-items: center; overflow: hidden; }
.pview-media img { width: 100%; height: 100%; object-fit: contain; }
.pview-media .tile-fallback { width: 120px; height: 120px; border-radius: 32px; }
.pview-media .tile-fallback .bi { font-size: 3rem; }
.pview-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.pview-thumbs button { width: 64px; height: 64px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; background: #fff; }
.pview-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pview-add form { margin: 0; }
/* Add, Ask and Call span the column, lined up with the boxes under them. */
.pview-contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.pview-contact .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pview-add-btn { --bs-btn-bg: var(--success); --bs-btn-color: #fff; --bs-btn-border-color: var(--success); --bs-btn-hover-bg: #166534; --bs-btn-hover-color: #fff; font-weight: 800; }
.pview-stepper { min-height: 52px; font-size: 1.1rem; }
.pview-stepper button { min-height: 52px; font-size: 1.3rem; }
.pview-why { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.pview-why-row { display: flex; gap: 12px; align-items: flex-start; }
.pview-why-row + .pview-why-row { margin-top: 12px; }
.pview-why-row .bi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); flex-shrink: 0; }
.pview-why-row strong { display: block; font-size: .9rem; }
.pview-why-row span { font-size: .82rem; color: var(--muted); }
.rail > .pcard { min-width: 0; }
@media (max-width: 575.98px) { .rail:has(> .pcard) { grid-auto-columns: 42%; } }

/* One or two cards share a whole row (app.css, rails): they lie on their side,
   picture, words, then ADD at the far end, instead of a picture 500px tall. */
:is(.rail:not(.wide), .pgrid, .card-grid):not(:has(> :nth-child(3))) > .pcard { flex-direction: row; align-items: center; position: relative; }
:is(.rail:not(.wide), .pgrid, .card-grid):not(:has(> :nth-child(3))) > .pcard .pcard-media { position: static; flex: none; width: clamp(96px, 28%, 152px); margin: 8px 0 8px 8px; }
:is(.rail:not(.wide), .pgrid, .card-grid):not(:has(> :nth-child(3))) > .pcard .pcard-media > a { position: static; width: 100%; height: 100%; }
:is(.rail:not(.wide), .pgrid, .card-grid):not(:has(> :nth-child(3))) > .pcard .pcard-off { left: 14px; top: 14px; }
:is(.rail:not(.wide), .pgrid, .card-grid):not(:has(> :nth-child(3))) > .pcard .pcard-add { right: 14px; bottom: auto; top: 50%; transform: translateY(-50%); }
:is(.rail:not(.wide), .pgrid, .card-grid):not(:has(> :nth-child(3))) > .pcard .pcard-body { min-width: 0; padding: 12px 104px 12px 16px; }
:is(.rail:not(.wide), .pgrid, .card-grid):not(:has(> :nth-child(3))) > .pcard .pcard-name { min-height: 0; }
:is(.rail:not(.wide), .pgrid, .card-grid):not(:has(> :nth-child(3))) > .tile { flex-direction: row; }
:is(.rail:not(.wide), .pgrid, .card-grid):not(:has(> :nth-child(3))) > .tile > .tile-media { flex: none; width: clamp(120px, 36%, 260px); aspect-ratio: auto; min-height: 150px; }
@media (min-width: 992px) {
  :is(.rail:not(.wide), .pgrid, .card-grid):has(> :nth-child(3)):not(:has(> :nth-child(4))) > .pcard .pcard-media { aspect-ratio: 4 / 3; }
}

/* No photograph yet: most of the catalogue. A tinted panel with the
   category's icon on a white chip, so it reads as chosen, not missing. */
.pcard-media:has(> .tile-fallback, > a > .tile-fallback), .tile-media:has(> .tile-fallback) { background: linear-gradient(145deg, var(--bg-tint), var(--brand-soft)); }
.pcard-media .tile-fallback, .tile-media > .tile-fallback { background: #fff; color: var(--brand); box-shadow: 0 6px 16px rgba(15, 23, 42, .08); }

/* ------------------------------------------------ store as an app shell -- */
/* The page stays still; the rail and the grid scroll on their own. The
   height is set by app.js (--store-h) from the space left on screen. */
.app-frame.app-shell, .app-frame.app-shell body { overflow: hidden; height: 100%; }
.app-shell .site-footer { display: none; }
.app-shell .store-shell { height: var(--store-h, calc(100svh - 300px)); }
.app-shell .store-shell > .store-cats,
.app-shell .store-shell > .store-main {
  position: static; height: 100%; max-height: none; overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.app-shell .store-cats { scrollbar-width: none; }
.app-shell .store-cats::-webkit-scrollbar { display: none; }
.app-shell .store-main { padding-bottom: 16px; scrollbar-width: thin; }
.app-shell .store-toolbar { position: sticky; top: 0; z-index: 5; background: #fff; margin: 0 0 10px; padding-bottom: 8px; }
.store-main { transition: opacity .15s; }
.store-main.is-loading { opacity: .45; pointer-events: none; }
.store-more { display: flex; justify-content: center; padding: 18px 0 6px; }
.store-more.is-loading .btn { visibility: hidden; }
.store-more.is-loading::after {
  content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand);
  animation: store-spin .7s linear infinite;
}
.store-end { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px 0 4px; margin: 0; }
@keyframes store-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .store-main { transition: none; } .store-more.is-loading::after { animation-duration: 2s; } }
@media (min-width: 992px) { .app-shell .store-main { padding-bottom: 96px; } }
/* The rail scrolls up and down only. Its active marker used to sit outside
   the rail, which gave it a sideways scroll on iPhone that shifted the
   whole column. */
.app-shell .store-shell > .store-cats { overflow-x: hidden; touch-action: pan-y; }
.app-shell .store-cats a[aria-current="page"]::after { right: 0; }
.app-shell .store-shell > .store-main { overflow-x: hidden; }

/* ------------------------------------------- one product, several shops -- */
.pcard-from { font-size: .75rem; color: var(--muted); margin-right: 3px; font-weight: 600; }
.pcard-shops { font-size: .75rem; color: var(--brand); font-weight: 700; display: flex; gap: 4px; align-items: center; text-decoration: none; }
.pcard-shops:hover { text-decoration: underline; }

.offers { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fff; }
.offer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.offer { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.offer.is-current { border-color: color-mix(in srgb, var(--brand) 45%, #fff); background: color-mix(in srgb, var(--brand) 5%, #fff); }
.offer-main { min-width: 0; }
.offer-shop { font-weight: 700; color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer-shop:hover { text-decoration: underline; }
.offer-meta { font-size: .78rem; color: var(--muted); }
.offer-meta a { color: var(--ink); font-weight: 600; text-decoration: none; }
.offer-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.offer-tag { font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-2, #334155); }
.offer-tag.tag-low { background: #dcfce7; color: #15803d; }
.offer-tag.tag-oos { background: #fee2e2; color: #b91c1c; }
.offer-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.offer-price { font-size: 1rem; }
.offer-add { width: 84px; }

/* The lowest price, when more than one business offers the same thing. */
.offer.is-lowest { border: 2px solid #16a34a; background: #f0fdf4; box-shadow: 0 6px 18px -12px rgba(22, 163, 74, .7); }
.offer.is-lowest .offer-price { color: #15803d; font-size: 1.1rem; }
.offer-tag.tag-low { background: #16a34a; color: #fff; display: inline-flex; gap: 3px; align-items: center; }
.pcard-lowest { font-size: .75rem; font-weight: 700; color: #15803d; display: flex; gap: 4px; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ------------------------------------------------------------------------
   Screens beyond the usual phone / laptop pair.
   ------------------------------------------------------------------------ */

/* A folded phone's cover screen (280-340px): one card a row, or two cards of
   120px each squeeze names and prices into nothing. */
@media (max-width: 359.98px) {
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .container { padding-left: 10px; padding-right: 10px; }
}

/* Wide and 4K screens: room for more columns, then larger type. Sizes on
   this site are in rem, so raising the root size scales the text everywhere
   (a 4K screen at 100% scaling otherwise shows 14px type across 3840px). */
@media (min-width: 1600px) {
  .container { max-width: 1440px; }
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pgrid.wide { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 2000px) {
  .container { max-width: 1680px; }
  .listing-split { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (min-width: 2400px) {
  html { font-size: 18px; }
  .container { max-width: 2000px; }
  .card-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 3200px) {
  html { font-size: 22px; }
  .container { max-width: 2600px; }
}
