body[data-seo-storefront-page]:has(.seo-storefront-overlay:not([hidden])),
html.seo-storefront-open,
body.seo-storefront-open {
  overflow: hidden;
}

.seo-storefront-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  isolation: isolate;
}

.seo-storefront-overlay[hidden] { display: none; }

.seo-storefront-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(23, 18, 15, .42);
}

.seo-storefront-dialog {
  --header-main-h: 40px;
  --header-total-h: 40px;
  width: min(1320px, 100%);
  max-height: calc(100vh - 2 * clamp(12px, 3vw, 40px));
  max-height: calc(100dvh - 2 * clamp(12px, 3vw, 40px));
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink, #17120f);
  background: var(--surface, #fffcf7);
  border: 1px solid var(--line, #d9cab8);
  border-radius: var(--radius-card, 8px);
  box-shadow: 0 20px 64px rgba(23, 18, 15, .18);
}

.seo-storefront-controls {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line, #d9cab8);
  background: var(--surface, #fffcf7);
}

.seo-storefront-close {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 44px;
  color: var(--ink, #17120f);
  font: 500 14px var(--utility, sans-serif);
  text-decoration: none;
}

.seo-storefront-close span { font-size: 26px; line-height: 1; }
.seo-storefront-close:focus-visible { outline: 2px solid var(--accent, #6f1228); outline-offset: 4px; }
.seo-storefront-dialog .seo-page-shell { width: auto; margin: 0; padding: clamp(16px, 3vw, 40px); }
.seo-storefront-dialog .seo-product-page { align-items: start; }
.seo-storefront-dialog :target { scroll-margin-top: 72px; }

@media (max-width: 600px) {
  .seo-storefront-overlay { padding: 8px; }
  .seo-storefront-dialog { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .seo-storefront-controls { padding: 4px 12px; }
  .seo-storefront-dialog .seo-page-shell { padding: 16px; }
}

@media print {
  .seo-storefront-home[inert], .seo-storefront-controls, .seo-storefront-backdrop { display: none; }
  .seo-storefront-overlay { position: static; display: block; padding: 0; }
  .seo-storefront-dialog { width: 100%; max-height: none; overflow: visible; box-shadow: none; border: 0; }
}
