/* Public storefront only; shared marketplace and seller editing retain their styles. */
.public-shop-page .site-header { display: flex; }
.public-shop-page .site-header > .secondary-action { margin-right: auto; white-space: nowrap; }
.public-shop-page .shop-page { padding: 0 0 64px; }
.public-shop-page .shop-page-shell { width: 100%; max-width: none; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.public-shop-page .shop-page-shell > :not(.shop-profile-hero),
.public-shop-page .shop-profile-summary { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.public-shop-page .shop-banner { height: 225px; min-height: 0; border: 0; border-radius: 0; }
.public-shop-page .shop-banner img { height: 100%; aspect-ratio: auto; }
.public-shop-page .shop-banner.is-placeholder { height: 88px; }
.public-shop-page .shop-profile-summary { grid-template-columns: 120px minmax(0, 1fr) auto; gap: 18px; padding: 0 0 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.public-shop-page .shop-profile-summary .shop-logo-mark.large { width: 120px; height: 120px; margin-top: -40px; color: var(--leaf-dark); background: var(--soft); z-index: 1; box-shadow: 0 5px 16px rgba(16,37,29,.1); }
.public-shop-page .shop-profile-summary > div { padding-top: 14px; }
.public-shop-page .shop-profile-summary > .favourite-button { margin-top: 14px; }
.public-shop-page .shop-profile-summary h1 { margin: 0 0 6px; font-size: clamp(2rem, 3.5vw, 2.75rem); line-height: 1.08; overflow-wrap: anywhere; }
.public-shop-page .shop-profile-summary p { margin: 0; max-width: 76ch; font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.public-shop-page .shop-profile-meta { gap: 6px 12px; margin-bottom: 6px; font-size: .85rem; align-items: center; }
.public-shop-page .shop-profile-meta a { color: var(--leaf-dark); text-underline-offset: 3px; }
.public-shop-page .shop-profile-meta > span + .rating-anchor::before { content: none; }
.public-shop-page .shop-profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 0; justify-content: end; }
.public-shop-page .shop-external-links { margin: 0; gap: 6px; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; min-width: 0; justify-content: safe end; scrollbar-width: thin; }
.public-shop-page .shop-external-links > * { flex-shrink: 0; white-space: nowrap; }
.public-shop-page .shop-profile-copy { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, auto); gap: 0 18px; align-items: center; }
.shop-profile-copy > :is(h1, .shop-profile-meta, .shop-closure-notice) { grid-column: 1 / -1; }
.shop-profile-copy > .shop-profile-actions { min-width: 0; max-width: 100%; }
.shop-external-link { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--leaf-dark); text-decoration: none; font-size: .8rem; line-height: 1.3; }
.shop-external-link svg { width: 15px; height: 15px; flex-shrink: 0; }
.shop-external-link span { overflow-wrap: anywhere; min-width: 0; }
.shop-external-link:hover { border-color: var(--leaf); background: var(--soft); }
.public-shop-page h2 { margin: 0; font-size: clamp(1.65rem, 2.4vw, 2rem); line-height: 1.2; }
.public-shop-page #shopProducts, .public-shop-page #shopLocations, .public-shop-page #shopReviews { min-width: 0; scroll-margin-top: 110px; }
.public-shop-page .seller-products { gap: 12px; }
.shop-section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; }
.shop-products-heading { display: flex; align-items: baseline; gap: 12px; }
#shopProductCount { color: var(--muted); font-size: .85rem; }
.shop-products-controls { display: flex; align-items: center; gap: 12px; }
.shop-product-search, .shop-product-sort { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; }
.shop-product-search input { width: 230px; min-width: 0; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font: inherit; }
.shop-product-search input::placeholder { color: var(--muted); opacity: 1; }
.shop-search-empty { margin: 0; padding: 20px 0; color: var(--muted); line-height: 1.5; }
.shop-product-sort select { max-width: 100%; min-height: 40px; padding: 7px 28px 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font: inherit; }
.shop-category-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-category-filters button { min-height: 34px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--leaf-dark); background: white; font: inherit; font-size: .85rem; max-width: 100%; overflow-wrap: anywhere; }
.shop-category-filters button[aria-pressed="true"] { background: var(--leaf-dark); color: white; border-color: var(--leaf-dark); }
.public-shop-page .compact-product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.public-shop-page .compact-product[hidden], .public-shop-page [hidden] { display: none !important; }
/* Square photography and compact captions, with equal-height cards within each row. */
.public-shop-page .compact-product { aspect-ratio: auto; min-height: 0; align-self: stretch; grid-template-rows: auto 1fr; }
.public-shop-page .compact-product-image-link { position: relative; aspect-ratio: 1; }
.public-shop-page .compact-product img { aspect-ratio: 1; width: 100%; height: 100%; object-fit: cover; }
.public-shop-page .compact-product > div { display: flex; flex-direction: column; justify-content: start; gap: 4px; min-width: 0; min-height: 0; padding: 10px; }
.public-shop-page .compact-product-title-link { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.3; }
.public-shop-page .compact-product div > span { margin-top: auto; color: var(--leaf-dark); font-weight: 700; }
.public-shop-page .seller-locations { gap: 16px; }
.shop-location-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shop-location-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: .85rem; overflow-wrap: anywhere; }
.shop-location-card h3 { margin: 0 0 8px; font-size: 1.05rem; line-height: 1.3; }
.shop-location-card h4 { margin: 0 0 8px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.shop-location-address > a { display: inline-block; color: var(--leaf-dark); text-underline-offset: 3px; line-height: 1.55; }
.shop-fulfilment { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.shop-fulfilment span { padding: 3px 7px; border-radius: 4px; background: var(--soft); color: var(--leaf-dark); font-size: .72rem; }
.shop-hours { display: grid; gap: 4px; margin: 0; }
.shop-hours > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; line-height: 1.5; }
.shop-hours dt { color: var(--muted); }
.shop-hours dd { margin: 0; }
.shop-hours-unlisted { margin: 0; color: var(--muted); }
.public-shop-page .reviews-section { gap: 18px; }
.shop-review-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: .85rem; color: var(--muted); }
.shop-review-controls { display: flex; gap: 8px; }
.public-shop-page .carousel-arrow { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); background: white; color: var(--leaf-dark); }
.public-shop-page .carousel-arrow:disabled { opacity: .4; cursor: default; }
.public-shop-page .review-carousel { display: grid; grid-auto-flow: column; align-items: start; overflow-y: hidden; grid-auto-columns: calc((100% - 48px) / 4); gap: 16px; padding: 0 0 12px; scroll-padding: 0; overscroll-behavior-x: contain; }
.public-shop-page .review-card { min-width: 0; min-height: 0; height: 220px; padding: 16px; gap: 8px; box-shadow: none; grid-template-rows: auto minmax(0, 1fr) 18px auto; align-content: start; overflow-wrap: anywhere; text-align: left; font: inherit; font-weight: normal; color: var(--ink); cursor: pointer; }
.public-shop-page .review-card:is(:hover, :focus-visible) { transform: none !important; border-color: var(--leaf); background: white; }
.public-shop-page .shop-review-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; align-self: start; max-height: 4.5em; margin: 0; font-size: .85rem; line-height: 1.5; }
.public-shop-page .shop-review-more { grid-row: 3; color: var(--leaf-dark); font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; }
.public-shop-page .shop-review-author { grid-row: 4; display: grid; gap: 3px; min-width: 0; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.public-shop-page .review-card > .shop-rating { justify-content: start; }
.public-shop-page .review-card time { white-space: nowrap; }
.shop-empty-reviews { margin: 0; color: var(--muted); }
.public-shop-page :is(a, button, select, [tabindex]):focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 4px; }
@media (max-width: 1100px) {
  .public-shop-page .compact-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .public-shop-page .review-carousel { grid-auto-columns: calc((100% - 16px) / 2); }
  .shop-location-grid { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
}
@media (max-width: 820px) {
  .public-shop-page .shop-banner { height: 180px; }
  .public-shop-page .compact-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-shop-page .shop-profile-summary { grid-template-columns: 104px minmax(0, 1fr) auto; gap: 16px; }
  .public-shop-page .shop-profile-summary .shop-logo-mark.large { width: 104px; height: 104px; margin-top: -32px; }
}
@media (max-width: 560px) {
  .public-shop-page .site-header { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 10px 18px; }
  .public-shop-page .site-header > .secondary-action { display: block; grid-column: 1 / -1; grid-row: 2; justify-self: start; min-height: 36px; margin: 0; padding: 8px 12px; font-size: .8rem; }
  .public-shop-page .shop-page-shell > :not(.shop-profile-hero), .public-shop-page .shop-profile-summary { width: calc(100% - 36px); }
  .public-shop-page .shop-page-shell { gap: 16px; }
  .public-shop-page .shop-banner { height: 132px; }
  .public-shop-page .shop-banner.is-placeholder { height: 56px; }
  .public-shop-page .shop-profile-summary { grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding-bottom: 12px; }
  .public-shop-page .shop-profile-summary .shop-logo-mark.large { grid-row: 1; width: 84px; height: 84px; }
  .public-shop-page .shop-profile-summary > div { grid-column: 1 / -1; grid-row: 2; padding-top: 10px; }
  .public-shop-page .shop-profile-summary > .favourite-button { grid-column: 2; grid-row: 1; margin-top: 10px; }
  .public-shop-page .shop-profile-summary h1 { font-size: 2rem; }
  .public-shop-page .shop-profile-meta { font-size: .8rem; }
  .public-shop-page .shop-profile-summary p { font-size: .9rem; }
  .public-shop-page .compact-product-grid { gap: 12px; }
  .public-shop-page .compact-product div { padding: 10px; gap: 6px; }
  .public-shop-page .compact-product-title-link { font-size: .8rem; }
  .shop-section-heading { align-items: start; }
  .shop-category-filters { flex-wrap: nowrap; overflow-x: auto; padding: 3px 0 8px; scrollbar-width: thin; }
  .shop-category-filters button { flex: 0 0 auto; max-width: 85vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .shop-products-controls { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .shop-product-search, .shop-product-sort { min-width: 0; font-size: .8rem; }
  .shop-product-sort { gap: 5px; white-space: nowrap; }
  .shop-product-sort select { flex: 1; padding-inline: 8px 20px; }
  .public-shop-page .shop-profile-copy { display: block; }
  .shop-profile-copy > .shop-profile-actions { max-width: none; margin-top: 8px; }
  .shop-product-search input, .shop-product-sort select { width: 100%; min-width: 0; }
  .shop-location-card { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 18px; }
  .shop-hours { max-width: 300px; }
  .public-shop-page .review-carousel { grid-auto-columns: 100%; }
  .public-shop-page #shopProducts, .public-shop-page #shopLocations, .public-shop-page #shopReviews { scroll-margin-top: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .public-shop-page .review-carousel { scroll-behavior: auto; }
  .public-shop-page .compact-product, .public-shop-page .compact-product img { transition: none; }
}

/* Native dialog provides focus containment, Escape dismissal and focus restoration. */
html.shop-review-modal-open { overflow: hidden; }
.shop-review-dialog { width: min(560px, calc(100% - 36px)); max-height: 85vh; max-height: 85dvh; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; box-shadow: var(--shadow); overflow-y: auto; overscroll-behavior: contain; }
.shop-review-dialog::backdrop { background: rgba(16, 37, 29, .42); }
.shop-review-dialog-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: white; }
.public-shop-page .shop-review-dialog-header h2 { font-size: 1.35rem; }
.shop-review-dialog-header .dialog-close { position: static; flex: 0 0 38px; }
.shop-review-dialog-body { max-height: calc(85vh - 76px); max-height: calc(85dvh - 76px); padding: 20px; overflow-y: auto; overscroll-behavior: contain; }
#shopReviewDialogText { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; margin: 16px 0 22px; }
.shop-review-dialog footer { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }

/* Shop views retain their DOM so product controls and favourites survive navigation. */
.public-shop-page .shop-view-nav { position: sticky; top: var(--shop-header-height, 86px); z-index: 19; display: flex; align-items: stretch; gap: 24px; min-height: 44px; margin-block: -8px; overflow-x: auto; white-space: nowrap; background: #f7faf7; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.shop-view-nav a { display: flex; align-items: center; flex: 0 0 auto; min-height: 44px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 700; }
.shop-view-nav a[aria-current="location"] { color: var(--leaf-dark); border-bottom-color: var(--leaf-dark); }
.shop-view-nav a:focus-visible { outline-offset: -4px; }
.public-shop-page .shop-about { max-width: 760px; min-height: calc(100dvh - var(--shop-header-height, 86px) - 64px); padding-block: 8px 24px; }
.shop-about .shop-story { line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.shop-about .shop-external-links { justify-content: start; }
.public-shop-page :is(#shopProducts, #shopLocations, #shopReviews, #shopAbout) { scroll-margin-top: calc(var(--shop-header-height, 86px) + 56px); }

.shop-location-summary { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.shop-location-summary svg { width: 17px; height: 17px; margin-right: 4px; flex-shrink: 0; }
.shop-location-count { white-space: nowrap; }

.public-shop-page .shop-profile-meta .rating-anchor { align-items: center; gap: 4px; }

/* Keep contact in the same wrapping row as website/social links. */
.shop-contact { position: relative; max-width: 100%; }
.shop-contact summary { cursor: pointer; list-style: none; }
.shop-contact summary::-webkit-details-marker { display: none; }
.shop-external-link:focus-visible { outline: 2px solid var(--leaf); outline-offset: -2px; }
.shop-contact-options { white-space: normal; position: fixed; z-index: 20; width: min(205px, calc(100vw - 16px)); padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 4px 16px #0002; }
.shop-contact-options a, .shop-contact-options button { display: block; width: 100%; padding: 8px; border: 0; border-radius: 5px; background: white; color: var(--leaf-dark); text-align: start; text-decoration: none; font: inherit; font-size: .85rem; cursor: pointer; }
.shop-contact-options a:hover, .shop-contact-options button:hover { background: var(--soft); }
.shop-contact-options small { display: block; font-size: .8rem; padding-inline: 8px; }
.shop-contact-options input { width: 100%; }
