/*
 * The cookie banner and the footer's Cookie settings button (cookie banner spec §3)
 * (content/templates/storefront/frame/cookie_banner.php, storefront-consent.js).
 *
 * Three layouts from Settings → Privacy and cookies: the corner box (a card in the bottom corner),
 * the bottom bar (full width) and the centre box (the page dimmed behind it, the only one that
 * covers the page). No cookie wall: the page keeps scrolling under every layout. The theme's
 * own values (paper, ink, accent, line, corners, fonts) make it fit every theme. On a phone every
 * layout is a sheet along the bottom, raised above the product page's buy bar while that shows.
 */

.sf-consent{ position: fixed; inset-block-end: 16px; inset-inline-start: 16px; z-index: 70; inline-size: min(420px, calc(100% - 32px)); }
.sf-consent[hidden]{ display: none; }
.sf-consent-box{ max-block-size: calc(100vh - 32px); overflow-y: auto; padding: 20px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px var(--shadow-lift); font-family: var(--font-body); font-size: 14px; line-height: 1.5; }
.sf-consent-box:focus{ outline: none; }

/* The bottom bar: edge to edge, its content in the page width. */
.sf-consent--bar{ inset-inline: 0; inset-block-end: 0; inline-size: auto; }
.sf-consent--bar .sf-consent-box{ max-block-size: 70vh; border-radius: 0; border-inline: 0; border-block-end: 0; padding-inline: max(16px, calc((100% - 1200px) / 2)); }

/* The centre box: a dialog over the dimmed page. */
.sf-consent--centre{ inset: 0; inline-size: auto; display: grid; place-items: center; padding: 16px; background: var(--backdrop); }
.sf-consent--centre .sf-consent-box{ inline-size: min(520px, 100%); }

.sf-consent-title{ margin: 0; margin-block-end: 8px; font-family: var(--font-heading); font-size: 18px; line-height: 1.3; }
.sf-consent-text{ margin: 0; margin-block-end: 16px; }
.sf-consent-text a{ color: inherit; text-decoration: underline; }
.sf-consent-note{ margin: 0; margin-block-end: 16px; color: var(--muted); font-size: 13px; }

/* Accept all, Reject all and Choose: the same size and look, side by side while they fit. */
.sf-consent-actions{ display: flex; flex-wrap: wrap; gap: 8px; }
.sf-consent-actions[hidden]{ display: none; }
.sf-consent-btn{ flex: 1 1 0; min-inline-size: max-content; }

/* The Choose panel: one row per group in use, its switch and its cookies. */
.sf-consent-panel[hidden]{ display: none; }
.sf-consent-groups{ list-style: none; margin: 0; margin-block-end: 16px; padding: 0; }
.sf-consent-group{ padding-block: 8px; border-block-start: 1px solid var(--line); }
.sf-consent-switch{ display: flex; align-items: center; justify-content: space-between; gap: 12px; min-block-size: 44px; font-weight: 600; cursor: pointer; }
.sf-consent-switch input{ flex: none; inline-size: 20px; block-size: 20px; margin: 0; accent-color: var(--accent-ink); cursor: pointer; }
.sf-consent-switch input:disabled{ cursor: default; }
.sf-consent-always{ margin-inline-start: 6px; font-weight: 400; font-size: 13px; color: var(--muted); }
.sf-consent-group-text{ margin: 0; color: var(--muted); font-size: 13px; }
.sf-consent-cookies summary{ display: flex; align-items: center; min-block-size: 44px; font-size: 13px; text-decoration: underline; cursor: pointer; }
.sf-consent-entries{ display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; font-size: 13px; }
.sf-consent-entry{ display: grid; gap: 2px; }
.sf-consent-entry-name{ font-family: var(--font-mono); font-weight: 600; overflow-wrap: anywhere; }
.sf-consent-entry-meta{ color: var(--muted); }

/* The footer's Cookie settings button, in the legal row: it reads as the links beside it. */
.sf-consent-open{ display: inline-flex; align-items: center; min-block-size: 44px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.sf-consent-open:hover{ color: var(--ink); text-decoration: underline; }

/* The product page's buy bar (product.css, 72px with its padding) stays in sight under the banner. */
.sf-buy-bar-on .sf-consent--corner, .sf-buy-bar-on .sf-consent--bar{ inset-block-end: 72px; }

/* A phone: every layout is a sheet along the bottom. The centre box keeps its dimmed page. */
@media (max-width: 720px){
	.sf-consent{ inset-inline: 0; inset-block-end: 0; inline-size: auto; }
	.sf-consent--centre{ inset: 0; place-items: end stretch; padding: 0; }
	.sf-consent-box, .sf-consent--centre .sf-consent-box{ inline-size: auto; max-block-size: 80vh; padding: 16px; border-inline: 0; border-block-end: 0; border-radius: 0; border-start-start-radius: var(--r); border-start-end-radius: var(--r); }
	.sf-buy-bar-on .sf-consent--centre{ padding-block-end: 72px; }
}
