/* Sharks Cookie Frontend
   Compact card design — original Marketing Sharks black & white style */

/* ── Shared banner base ──────────────────────────────────── */

.sharks-cookie-banner {
	position: fixed;
	z-index: 999999;
	background: var(--sc-banner-bg, #fff);
	color: var(--sc-banner-text, #111);
	box-sizing: border-box;
	font-family: var(--sc-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif);
	font-size: 14px;
	line-height: 1.55;
}

/* ── Full-width bottom bar (opt-in via admin) ─────────────── */

.sharks-cookie-pos-bottom {
	bottom: 0;
	left: 0;
	right: 0;
	padding: 20px 28px;
	border-top: 1px solid var(--sc-border-color, rgba(0,0,0,.10));
	box-shadow: 0 -4px 24px rgba(0,0,0,.09);
}

.sharks-cookie-pos-bottom .sharks-cookie-banner-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	max-width: 1200px;
	margin: 0 auto;
}

.sharks-cookie-pos-bottom .sharks-cookie-banner-text {
	flex: 1 1 320px;
}

.sharks-cookie-pos-bottom .sharks-cookie-banner-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex-shrink: 0;
	align-items: center;
}

/* In full-width bar, the secondary-row wrapper is inline */
.sharks-cookie-pos-bottom .sharks-cookie-banner-secondary-row {
	display: contents;
}

/* ── Compact card — bottom-left / bottom-right ────────────── */

.sharks-cookie-pos-bottom-left,
.sharks-cookie-pos-bottom-right {
	width: clamp(320px, 25vw, 420px);
	padding: 24px 26px 22px;
	border-radius: var(--sc-radius, 20px);
	border: 1px solid rgba(0, 0, 0, .08);
	box-shadow: 0 18px 45px rgba(0, 0, 0, .18), 0 4px 12px rgba(0, 0, 0, .07);
}

.sharks-cookie-pos-bottom-left {
	bottom: 24px;
	left: 24px;
}

.sharks-cookie-pos-bottom-right {
	bottom: 24px;
	right: 24px;
}

/* Stacked inner layout for card */
.sharks-cookie-pos-bottom-left .sharks-cookie-banner-inner,
.sharks-cookie-pos-bottom-right .sharks-cookie-banner-inner {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.sharks-cookie-pos-bottom-left .sharks-cookie-banner-text,
.sharks-cookie-pos-bottom-right .sharks-cookie-banner-text {
	margin-bottom: 18px;
}

/* Card button layout: secondary row on top, primary full-width below */
.sharks-cookie-pos-bottom-left .sharks-cookie-banner-actions,
.sharks-cookie-pos-bottom-right .sharks-cookie-banner-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sharks-cookie-pos-bottom-left .sharks-cookie-banner-actions .sharks-cookie-btn-secondary,
.sharks-cookie-pos-bottom-right .sharks-cookie-banner-actions .sharks-cookie-btn-secondary {
	/* Secondary buttons sit in a row together */
	flex: 1;
}

/* Group the two secondary buttons into a flex row */
.sharks-cookie-pos-bottom-left .sharks-cookie-banner-secondary-row,
.sharks-cookie-pos-bottom-right .sharks-cookie-banner-secondary-row {
	display: flex;
	gap: 8px;
}

.sharks-cookie-pos-bottom-left .sharks-cookie-banner-actions .sharks-cookie-btn-primary,
.sharks-cookie-pos-bottom-right .sharks-cookie-banner-actions .sharks-cookie-btn-primary {
	width: 100%;
}

/* ── Center modal-style banner ───────────────────────────── */

.sharks-cookie-pos-center {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-width: 520px;
	width: calc(100% - 40px);
	padding: 24px 28px;
	border-radius: var(--sc-radius, 20px);
	border: 1px solid rgba(0, 0, 0, .08);
	box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
}

.sharks-cookie-pos-center .sharks-cookie-banner-inner {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.sharks-cookie-pos-center .sharks-cookie-banner-text {
	margin-bottom: 18px;
}

.sharks-cookie-pos-center .sharks-cookie-banner-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sharks-cookie-pos-center .sharks-cookie-banner-secondary-row {
	display: flex;
	gap: 8px;
}

.sharks-cookie-pos-center .sharks-cookie-banner-secondary-row .sharks-cookie-btn {
	flex: 1;
}

.sharks-cookie-pos-center .sharks-cookie-banner-actions .sharks-cookie-btn-primary {
	width: 100%;
}

/* ── Text inside banner ───────────────────────────────────── */

.sharks-cookie-banner-title {
	display: block;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin-bottom: 8px;
	line-height: 1.3;
}

.sharks-cookie-banner-desc {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--sc-banner-text, #111);
	opacity: .75;
}

/* ── Buttons ─────────────────────────────────────────────── */

.sharks-cookie-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	border-radius: calc(var(--sc-radius, 20px) * 0.6);
	transition: opacity .15s, box-shadow .15s;
	font-family: inherit;
	line-height: 1.2;
	min-height: 40px;
	white-space: nowrap;
	text-align: center;
}

.sharks-cookie-btn:hover {
	opacity: .85;
}

.sharks-cookie-btn:focus-visible {
	outline: 2px solid var(--sc-btn-primary-bg, #111);
	outline-offset: 2px;
}

.sharks-cookie-btn-primary {
	background: var(--sc-btn-primary-bg, #111);
	color: var(--sc-btn-primary-text, #fff);
	border: 1px solid var(--sc-btn-primary-bg, #111);
}

.sharks-cookie-btn-secondary {
	background: var(--sc-btn-secondary-bg, #fff);
	color: var(--sc-btn-secondary-text, #111);
	border: 1px solid var(--sc-btn-secondary-border, #111);
}

/* ── Overlay ─────────────────────────────────────────────── */

.sharks-cookie-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	background: rgba(0, 0, 0, .45);
}

/* ── Preferences modal ───────────────────────────────────── */

.sharks-cookie-modal {
	position: fixed;
	z-index: 1000001;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: var(--sc-modal-bg, #fff);
	color: var(--sc-banner-text, #111);
	max-width: 600px;
	width: calc(100% - 40px);
	max-height: 90vh;
	border-radius: var(--sc-radius, 20px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .20), 0 4px 16px rgba(0, 0, 0, .08);
	border: 1px solid rgba(0, 0, 0, .07);
	font-family: var(--sc-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif);
	font-size: 14px;
	line-height: 1.55;
	display: flex;
	flex-direction: column;
}

.sharks-cookie-modal-inner {
	display: flex;
	flex-direction: column;
	max-height: 90vh;
}

.sharks-cookie-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px 14px;
	border-bottom: 1px solid var(--sc-border-color, rgba(0,0,0,.08));
}

.sharks-cookie-modal-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.sharks-cookie-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	padding: 4px 8px;
	line-height: 1;
	color: inherit;
	border-radius: 8px;
	opacity: .55;
	transition: opacity .15s;
}

.sharks-cookie-modal-close:hover {
	opacity: 1;
	background: rgba(0, 0, 0, .05);
}

.sharks-cookie-modal-close:focus-visible {
	outline: 2px solid var(--sc-btn-primary-bg, #111);
	outline-offset: 2px;
	opacity: 1;
}

.sharks-cookie-modal-body {
	padding: 18px 24px;
	overflow-y: auto;
	flex: 1 1 auto;
}

.sharks-cookie-modal-intro {
	margin: 0 0 18px;
	font-size: 13px;
	line-height: 1.6;
	opacity: .75;
}

/* ── Category accordion items ────────────────────────────── */

.sharks-cookie-category-item {
	border: 1px solid var(--sc-border-color, rgba(0,0,0,.10));
	border-radius: 12px;
	margin-bottom: 8px;
	overflow: hidden;
	transition: box-shadow .15s;
}

.sharks-cookie-category-item:last-child {
	margin-bottom: 0;
}

.sharks-cookie-category-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 13px 16px;
	cursor: pointer;
	user-select: none;
	background: none;
	border: none;
	width: 100%;
	font: inherit;
	color: inherit;
	text-align: left;
}

.sharks-cookie-category-header:hover {
	background: rgba(0, 0, 0, .025);
}

.sharks-cookie-category-header:focus-visible {
	outline: 2px solid var(--sc-btn-primary-bg, #111);
	outline-offset: -2px;
}

.sharks-cookie-category-name {
	font-weight: 600;
	font-size: 14px;
}

.sharks-cookie-category-badge {
	font-size: 11px;
	font-weight: 500;
	color: var(--sc-toggle-active, #111);
	opacity: .55;
	margin-left: 8px;
}

.sharks-cookie-category-right {
	display: flex;
	align-items: center;
	gap: 10px;
}

.sharks-cookie-category-desc {
	padding: 0 16px 14px;
	font-size: 13px;
	line-height: 1.55;
	opacity: .72;
	display: none;
}

.sharks-cookie-category-item.open .sharks-cookie-category-desc {
	display: block;
}

/* ── Toggle switch ───────────────────────────────────────── */

.sharks-cookie-toggle {
	position: relative;
	width: 44px;
	height: 24px;
	flex-shrink: 0;
}

.sharks-cookie-toggle input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.sharks-cookie-toggle-slider {
	position: absolute;
	inset: 0;
	background: var(--sc-toggle-inactive, #ccc);
	border-radius: 24px;
	cursor: pointer;
	transition: background .2s;
}

.sharks-cookie-toggle-slider::before {
	content: '';
	position: absolute;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	top: 3px;
	left: 3px;
	transition: transform .2s;
	box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.sharks-cookie-toggle input:checked + .sharks-cookie-toggle-slider {
	background: var(--sc-toggle-active, #111);
}

.sharks-cookie-toggle input:checked + .sharks-cookie-toggle-slider::before {
	transform: translateX(20px);
}

.sharks-cookie-toggle input:focus-visible + .sharks-cookie-toggle-slider {
	outline: 2px solid var(--sc-btn-primary-bg, #111);
	outline-offset: 2px;
}

.sharks-cookie-toggle input:disabled + .sharks-cookie-toggle-slider {
	opacity: .55;
	cursor: default;
}

/* ── Modal footer ────────────────────────────────────────── */

.sharks-cookie-modal-footer {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 14px 24px 20px;
	border-top: 1px solid var(--sc-border-color, rgba(0,0,0,.08));
	justify-content: flex-end;
}

/* ── Floating preferences wrapper ────────────────────────── */

.sharks-cookie-floating-wrap {
	position: fixed;
	/* Above the page, below the site's own drawers and dialogs: an open menu or
	   cart should not have a launcher floating over it. The banner and the
	   preferences dialog keep their own, higher layer. */
	z-index: 100;
	bottom: 24px;
	left: 24px;
}

/* ── Floating preferences button ─────────────────────────────
   A quiet round control in the banner's own surface: cream, a hairline in the
   border colour, a line icon in the primary colour. 44px — a full touch target. */

.sharks-cookie-floating-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--sc-border-color, rgba(0,0,0,.12));
	border-radius: 50%;
	background: var(--sc-banner-bg, #fff);
	color: var(--sc-btn-primary-bg, #111);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
	font-family: inherit;
	cursor: pointer;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.sharks-cookie-floating-btn:hover {
	border-color: var(--sc-btn-primary-bg, #111);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
	transform: translateY(-1px);
}

.sharks-cookie-floating-btn:focus-visible {
	outline: 2px solid var(--sc-btn-primary-bg, #111);
	outline-offset: 3px;
}

.sharks-cookie-floating-icon {
	display: block;
	width: 20px;
	height: 20px;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.sharks-cookie-floating-btn,
	.sharks-cookie-floating-btn:hover {
		transition: none;
		transform: none;
	}
}

/* ── Privacy policy link in the banner ───────────────────── */

.sharks-cookie-policy-link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ── Cookies listed under a category ─────────────────────── */

.sharks-cookie-cookie-list {
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--sc-border-color, rgba(0,0,0,.08));
}

.sharks-cookie-cookie-list li {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 10px;
	padding: 8px 0;
	border-bottom: 1px solid var(--sc-border-color, rgba(0,0,0,.08));
	font-size: 12px;
	line-height: 1.5;
}

.sharks-cookie-cookie-list code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
	font-weight: 600;
	background: none;
	padding: 0;
}

.sharks-cookie-cookie-meta {
	opacity: .75;
}

.sharks-cookie-cookie-desc {
	flex-basis: 100%;
	opacity: .85;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 600px) {
	/* Compact cards collapse to near-full width on mobile */
	.sharks-cookie-pos-bottom-left,
	.sharks-cookie-pos-bottom-right {
		width: calc(100% - 32px);
		max-width: none;
		left: 16px;
		right: 16px;
		bottom: 16px;
		border-radius: 18px;
	}

	/* Full-width bar gets simpler on mobile */
	.sharks-cookie-pos-bottom {
		padding: 16px 18px;
	}

	.sharks-cookie-pos-bottom .sharks-cookie-banner-inner {
		flex-direction: column;
		align-items: stretch;
	}

	.sharks-cookie-pos-bottom .sharks-cookie-banner-actions {
		flex-direction: column;
	}

	.sharks-cookie-pos-bottom .sharks-cookie-banner-actions .sharks-cookie-btn {
		width: 100%;
	}

	/* Modal */
	.sharks-cookie-modal {
		width: calc(100% - 24px);
		max-height: 95vh;
		border-radius: 18px;
	}

	.sharks-cookie-modal-footer {
		flex-direction: column;
	}

	.sharks-cookie-modal-footer .sharks-cookie-btn {
		width: 100%;
	}

	/* Same 44px control; only closer to the edge. */
	.sharks-cookie-floating-wrap {
		bottom: 16px;
		left: 16px;
	}
}

/* ── Touch targets (1.3.0) ────────────────────────────────
   Every control reachable by a finger is at least 44px in the
   direction that matters; the switches keep their drawn size and
   get an invisible hit area. */

.sharks-cookie-btn {
	min-height: 44px;
}

.sharks-cookie-modal-close {
	min-width: 44px;
	min-height: 44px;
}

.sharks-cookie-toggle {
	position: relative;
}

.sharks-cookie-toggle::after {
	content: '';
	position: absolute;
	inset: -10px -4px;
}

/* ── Stepping aside (1.3.1) ───────────────────────────────
   While the site's own menu, drawer or modal is open, the banner and the
   launcher are out of the way (frontend.js sets the class); the launcher is
   also out of the way while a form field has focus. visibility, not display,
   so nothing is re-laid out and they return exactly where they were. */

html.sharks-cookie-step-aside .sharks-cookie-banner,
html.sharks-cookie-step-aside .sharks-cookie-floating-wrap,
html.sharks-cookie-typing .sharks-cookie-floating-wrap {
	visibility: hidden;
	pointer-events: none;
}

/* ── Never taller than the screen (1.3.1) ─────────────────
   On a 320 x 568 phone the card ran past the bottom edge. It now stops 16px
   short of the top and scrolls inside itself; every choice stays reachable. */

.sharks-cookie-pos-bottom,
.sharks-cookie-pos-bottom-left,
.sharks-cookie-pos-bottom-right {
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* ── Compact on small and short screens (1.3.1) ───────────
   Tighter spacing and text on phones; the same three choices, the same order. */

@media (max-width: 600px) {
	.sharks-cookie-pos-bottom-left,
	.sharks-cookie-pos-bottom-right {
		padding: 16px 18px 14px;
	}

	.sharks-cookie-banner-title {
		margin-bottom: 4px;
		font-size: 15px;
	}

	.sharks-cookie-banner-desc {
		line-height: 1.5;
	}

	.sharks-cookie-pos-bottom-left .sharks-cookie-banner-text,
	.sharks-cookie-pos-bottom-right .sharks-cookie-banner-text {
		margin-bottom: 12px;
	}
}

/* A phone on its side: one wide row, text beside the buttons, instead of a
   card that covered four fifths of the screen. */
@media (max-height: 500px) and (min-width: 560px) {
	.sharks-cookie-pos-bottom-left,
	.sharks-cookie-pos-bottom-right {
		width: auto;
		max-width: none;
		left: 16px;
		right: 16px;
		bottom: 12px;
		padding: 14px 18px;
		border-radius: 14px;
	}

	.sharks-cookie-pos-bottom-left .sharks-cookie-banner-inner,
	.sharks-cookie-pos-bottom-right .sharks-cookie-banner-inner {
		flex-direction: row;
		align-items: center;
		gap: 18px;
	}

	.sharks-cookie-pos-bottom-left .sharks-cookie-banner-text,
	.sharks-cookie-pos-bottom-right .sharks-cookie-banner-text {
		flex: 1 1 auto;
		min-width: 0;
		margin-bottom: 0;
	}

	.sharks-cookie-pos-bottom-left .sharks-cookie-banner-actions,
	.sharks-cookie-pos-bottom-right .sharks-cookie-banner-actions {
		flex: 0 0 auto;
		width: 300px;
	}

	.sharks-cookie-banner-title {
		margin-bottom: 2px;
		font-size: 15px;
	}

	.sharks-cookie-banner-desc {
		line-height: 1.45;
	}
}

