/* PoolBros owns its geometry, including inherited core pages and overlays.
   Keep this sheet theme-scoped so classic storefronts and admin stay unchanged.
   Full-width page bands, dividers, table cells and backdrops are not cards. */
[data-storefront-theme="poolbros"] {
  --pb-surface-radius: 24px;
  --pb-control-radius: 14px;
  --pb-pill-radius: 9999px;
}

[data-storefront-theme="poolbros"] :where(button, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  border-radius: var(--pb-control-radius);
}

[data-storefront-theme="poolbros"] :is(a, button):is([class~="bg-ui-text"], [class~="bg-brand-orange"], [class~="border"]) {
  border-radius: var(--pb-pill-radius);
}

[data-storefront-theme="poolbros"] :is(button, a, span, div)[class~="rounded-full"] {
  border-radius: var(--pb-pill-radius);
}

/* Only complete borders denote a contained surface. Do not round border-b/y
   layout separators or constrain overflow on tables and focusable content. */
[data-storefront-theme="poolbros"] :where(div, section, article, aside, form, fieldset, details, figure, label, p):is([class~="border"], [class~="border-2"]) {
  border-radius: var(--pb-surface-radius);
}

/* WebKit's fieldset min-content default can widen the inherited checkout. */
[data-storefront-theme="poolbros"] .pb-core-page fieldset {
  min-inline-size: 0;
  max-inline-size: 100%;
}

@media (max-width: 1023px) {
  /* A zero-minimum single track lets WebKit shrink native form controls. */
  [data-storefront-theme="poolbros"] [data-storefront-page="checkout"] form.grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

[data-storefront-theme="poolbros"] [role="dialog"],
[data-storefront-theme="poolbros"] .pb-cart-wrapper [role="dialog"] {
  border-radius: var(--pb-surface-radius);
}

/* These panels already scroll in an inner body. Clip their header/footer
   backgrounds, without changing their inner body's scrolling. */
[data-storefront-theme="poolbros"] [role="dialog"]:is([aria-label="Επιλογές cookies"], [aria-label="Καλάθι αγορών"], [aria-label="Φίλτρα προϊόντων"], [aria-labelledby="quick-shop-title"], [aria-labelledby="size-guide-title"]),
[data-storefront-theme="poolbros"] [role="dialog"][aria-labelledby$="-title"]:has([aria-label="Κλείσιμο μεγέθυνσης"]) {
  overflow: hidden;
}

[data-storefront-theme="poolbros"] [aria-label="Επιλογές cookies"] label,
[data-storefront-theme="poolbros"] :where(span, div)[class~="bg-brand-orange/10"] {
  border-radius: var(--pb-control-radius);
}

[data-storefront-theme="poolbros"] :where([role="progressbar"], [role="progressbar"] > *) {
  border-radius: var(--pb-pill-radius);
}

/* ProductGallery portals directly to body. Bridge only that gallery while a
   public PoolBros shell exists, never admin or an unrelated global dialog. */
body:has(.storefront-theme[data-storefront-theme="poolbros"]) > div:has(> [role="dialog"] [aria-label="Κλείσιμο μεγέθυνσης"]) {
  --pb-surface-radius: 24px;
  --pb-control-radius: 14px;
  font-family: "PoolBros Geologica", sans-serif;
}

body:has(.storefront-theme[data-storefront-theme="poolbros"]) > div > [role="dialog"]:has([aria-label="Κλείσιμο μεγέθυνσης"]) {
  border-radius: var(--pb-surface-radius);
  overflow: hidden;
}

body:has(.storefront-theme[data-storefront-theme="poolbros"]) > div > [role="dialog"]:has([aria-label="Κλείσιμο μεγέθυνσης"]) button {
  border-radius: var(--pb-control-radius);
}
