/*
 * SGG Icon Dock — shared across all SGG sites.
 * Spec: docs/specs/sgg-icon-dock-and-world-selector.md
 * Owner-locked size: desktop 760 x 92, mobile 342 x 72. States: active → quiet → active,
 * never hidden. A site may override the --dock-* tokens; shape: --round (Group) / --square (Hub).
 */

.sgg-dock {
	--dock-w: 760px;
	--dock-h: 92px;
	--dock-gap: 16px;
	--dock-radius: 30px;
	--dock-bg: rgba(12, 9, 5, 0.8);
	--dock-bg-quiet: rgba(12, 9, 5, 0.5);
	--dock-line: rgba(226, 180, 88, 0.5);
	--dock-line-quiet: rgba(226, 180, 88, 0.12);
	--dock-ink: #f3e3bd;
	--dock-gold: #e8b95a;
	--dock-glow: rgba(240, 190, 90, 0.45);
	--dock-icon: 30px;
	--dock-label: 10.5px;

	position: fixed;
	z-index: 90;
	left: 50%;
	bottom: calc(var(--dock-gap) + env(safe-area-inset-bottom, 0px));
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	gap: 4px;
	box-sizing: border-box;
	width: min(var(--dock-w), calc(100vw - 24px));
	height: var(--dock-h);
	margin: 0;
	padding: 10px 14px;
	border: 1px solid var(--dock-line);
	border-radius: var(--dock-radius);
	background: var(--dock-bg);
	box-shadow: 0 18px 44px rgba(20, 12, 2, 0.32), inset 0 1px 0 rgba(255, 236, 190, 0.12);
	-webkit-backdrop-filter: blur(18px) saturate(1.3);
	backdrop-filter: blur(18px) saturate(1.3);
	transform: translateX(-50%);
	font-family: "DM Sans", system-ui, sans-serif;
	transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, bottom 220ms ease;
}

.sgg-dock--square {
	--dock-radius: 12px;
}

.sgg-dock__item {
	position: relative;
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: calc(var(--dock-radius) - 10px);
	background: transparent;
	color: var(--dock-ink);
	font: inherit;
	cursor: pointer;
	transition: color 160ms ease, background-color 160ms ease;
}

.sgg-dock__icon {
	display: grid;
	place-items: center;
	width: var(--dock-icon);
	height: var(--dock-icon);
	color: var(--dock-gold);
	transform: translateY(0) scale(var(--dock-m, 1));
	transform-origin: 50% 80%;
	transition: transform 160ms ease, opacity 180ms ease, filter 180ms ease;
}

.sgg-dock__icon .sgg-icon {
	width: 100%;
	height: 100%;
}

.sgg-dock__label {
	overflow: hidden;
	max-width: 100%;
	font-size: var(--dock-label);
	font-weight: 500;
	letter-spacing: 0.1em;
	line-height: 1.1;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
	transition: opacity 180ms ease;
}

/* Hover / focus: the item lifts and gets a luminous edge. */
.sgg-dock__item:hover,
.sgg-dock__item:focus-visible,
.sgg-dock__item[aria-expanded="true"],
.sgg-dock__item[aria-pressed="true"] {
	background: rgba(232, 185, 90, 0.1);
	box-shadow: inset 0 0 0 1px rgba(232, 185, 90, 0.45), 0 0 18px var(--dock-glow);
	color: #fff4d8;
}

.sgg-dock__item:hover .sgg-dock__icon,
.sgg-dock__item:focus-visible .sgg-dock__icon {
	filter: drop-shadow(0 0 6px var(--dock-glow));
}

.sgg-dock__item:focus-visible {
	outline: 2px solid var(--dock-gold);
	outline-offset: 2px;
}

/* QUIET: after 2.5 s without interaction. Still visibly there. */
.sgg-dock[data-state="quiet"] {
	border-color: var(--dock-line-quiet);
	background: var(--dock-bg-quiet);
	box-shadow: 0 10px 30px rgba(20, 12, 2, 0.12);
}

.sgg-dock[data-state="quiet"] .sgg-dock__icon {
	opacity: 0.7;
}

.sgg-dock[data-state="quiet"] .sgg-dock__label {
	opacity: 0.75;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

/* SCROLL (mobile): quieter still, labels step back, icons stay readable. */
.sgg-dock[data-state="scroll"] {
	border-color: var(--dock-line-quiet);
	background: rgba(12, 9, 5, 0.3);
	box-shadow: none;
}

.sgg-dock[data-state="scroll"] .sgg-dock__icon {
	opacity: 0.6;
}

.sgg-dock[data-state="scroll"] .sgg-dock__label {
	opacity: 0;
}

/* Sheet: opens above the dock for Search, Cart, Saved, GOAT ID and Help. */
.sgg-dock-sheet {
	position: fixed;
	z-index: 91;
	left: 50%;
	bottom: calc(var(--sheet-bottom, 124px) + env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
	width: min(460px, calc(100vw - 24px));
	max-height: min(70vh, 560px);
	overflow: auto;
	padding: 18px 20px 20px;
	border: 1px solid rgba(226, 180, 88, 0.5);
	border-radius: 24px;
	background: rgba(14, 10, 6, 0.94);
	box-shadow: 0 24px 60px rgba(10, 6, 0, 0.45);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	color: #f3e3bd;
	font-family: "DM Sans", system-ui, sans-serif;
	transform: translateX(-50%);
}

.sgg-dock-sheet--square {
	border-radius: 12px;
}

.sgg-dock-sheet[hidden] {
	display: none;
}

.sgg-dock-sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.sgg-dock-sheet__title {
	margin: 0;
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 26px;
	font-weight: 500;
	letter-spacing: 0.04em;
	color: #f7e6bf;
	text-transform: uppercase;
}

.sgg-dock-sheet__close {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid rgba(226, 180, 88, 0.4);
	border-radius: 50%;
	background: transparent;
	color: #e8b95a;
	cursor: pointer;
}

.sgg-dock-sheet__close .sgg-icon {
	width: 18px;
	height: 18px;
}

.sgg-dock-sheet p {
	margin: 0 0 12px;
	font-size: 15px;
	line-height: 1.5;
	color: #eadcbf;
}

.sgg-dock-sheet a {
	color: #f2c96c;
}

.sgg-dock-sheet :focus-visible {
	outline: 2px solid #e8b95a;
	outline-offset: 2px;
}

.sgg-dock-search {
	box-sizing: border-box;
	width: 100%;
	height: 48px;
	margin: 0 0 12px;
	padding: 0 16px;
	border: 1px solid rgba(226, 180, 88, 0.55);
	border-radius: 999px;
	background: rgba(255, 244, 214, 0.06);
	color: #fff4d8;
	font: inherit;
	font-size: 16px;
}

.sgg-dock-search::placeholder {
	color: rgba(243, 227, 189, 0.6);
}

.sgg-dock-results {
	display: grid;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sgg-dock-results a {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 12px;
	color: #f3e3bd;
	text-decoration: none;
}

.sgg-dock-results a:hover,
.sgg-dock-results a:focus-visible {
	background: rgba(232, 185, 90, 0.12);
}

.sgg-dock-results small {
	color: rgba(243, 227, 189, 0.6);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sgg-dock-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 6px;
}

.sgg-dock-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 20px;
	border: 1px solid rgba(226, 180, 88, 0.7);
	border-radius: 999px;
	background: transparent;
	color: #f3e3bd;
	font: inherit;
	font-size: 15px;
}

.sgg-dock-btn--gold {
	border-color: #ebb94f;
	background: #ebb94f;
	color: #1b1307;
}

.sgg-dock-btn[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: 0.55;
}

.sgg-dock-note {
	display: inline-block;
	margin: 0 0 12px;
	padding: 4px 10px;
	border: 1px solid rgba(226, 180, 88, 0.45);
	border-radius: 999px;
	color: #f2c96c;
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.sgg-dock-sheet .sgg-vh {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* The page keeps real space for the dock, so nothing ends up behind it. */
.sgg-dock-space {
	height: calc(var(--dock-space, 124px) + env(safe-area-inset-bottom, 0px));
}

/* Phones, standing or lying down, use the Owner's mobile dock (342 x 72). */
@media (max-width: 600px), (max-height: 520px) and (orientation: landscape) {
	.sgg-dock {
		--dock-w: 342px;
		--dock-h: 72px;
		--dock-gap: 12px;
		--dock-radius: 24px;
		--dock-icon: 26px;
		--dock-label: 9.5px;

		gap: 2px;
		padding: 7px 8px;
	}

	.sgg-dock__item {
		gap: 4px;
	}

	.sgg-dock-sheet {
		--sheet-bottom: 96px;
	}

	.sgg-dock-space {
		--dock-space: 100px;
	}
}

/* Calm mode (dock "Calm") and reduced motion: no magnification, no transitions. */
:root[data-sgg-calm="on"] .sgg-dock *,
:root[data-sgg-calm="on"] .sgg-dock {
	transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.sgg-dock,
	.sgg-dock * {
		transition: none !important;
	}

	.sgg-dock__icon {
		transform: none !important;
	}
}

/*
 * LIGHT variant (Owner, 2026-09-27): light, beige, translucent glass as in the Figma Make
 * reference — not the dark dock. Applies when the site runs its light theme.
 */
:root[data-sgg-theme="light"] .sgg-dock {
	--dock-bg: rgba(252, 246, 234, 0.72);
	--dock-bg-quiet: rgba(252, 246, 234, 0.42);
	--dock-line: rgba(186, 140, 58, 0.45);
	--dock-line-quiet: rgba(186, 140, 58, 0.16);
	--dock-ink: #3d2d14;
	--dock-gold: #9c6a16;
	--dock-glow: rgba(214, 164, 72, 0.35);

	box-shadow: 0 16px 40px rgba(120, 86, 30, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.7);
	-webkit-backdrop-filter: blur(20px) saturate(1.4);
	backdrop-filter: blur(20px) saturate(1.4);
}

:root[data-sgg-theme="light"] .sgg-dock__item:hover,
:root[data-sgg-theme="light"] .sgg-dock__item:focus-visible,
:root[data-sgg-theme="light"] .sgg-dock__item[aria-expanded="true"],
:root[data-sgg-theme="light"] .sgg-dock__item[aria-pressed="true"] {
	background: rgba(214, 164, 72, 0.14);
	box-shadow: inset 0 0 0 1px rgba(186, 140, 58, 0.5), 0 0 16px var(--dock-glow);
	color: #1f1608;
}

:root[data-sgg-theme="light"] .sgg-dock[data-state="quiet"] {
	box-shadow: 0 8px 24px rgba(120, 86, 30, 0.08);
}

:root[data-sgg-theme="light"] .sgg-dock[data-state="quiet"] .sgg-dock__label {
	text-shadow: 0 1px 2px rgba(255, 250, 238, 0.9);
}

:root[data-sgg-theme="light"] .sgg-dock[data-state="scroll"] {
	background: rgba(252, 246, 234, 0.34);
}

:root[data-sgg-theme="light"] .sgg-dock-sheet {
	border-color: rgba(186, 140, 58, 0.45);
	background: rgba(252, 247, 237, 0.9);
	box-shadow: 0 24px 60px rgba(120, 86, 30, 0.2);
	color: #3d2d14;
}

:root[data-sgg-theme="light"] .sgg-dock-sheet__title {
	color: #1f1608;
}

:root[data-sgg-theme="light"] .sgg-dock-sheet p {
	color: #3d2d14;
}

:root[data-sgg-theme="light"] .sgg-dock-sheet a,
:root[data-sgg-theme="light"] .sgg-dock-note {
	color: #7a5210;
}

:root[data-sgg-theme="light"] .sgg-dock-sheet__close {
	border-color: rgba(186, 140, 58, 0.45);
	color: #7a5210;
}

:root[data-sgg-theme="light"] .sgg-dock-search {
	border-color: rgba(186, 140, 58, 0.55);
	background: rgba(255, 255, 255, 0.6);
	color: #1f1608;
}

:root[data-sgg-theme="light"] .sgg-dock-search::placeholder {
	color: rgba(61, 45, 20, 0.6);
}

:root[data-sgg-theme="light"] .sgg-dock-results a {
	color: #3d2d14;
}

:root[data-sgg-theme="light"] .sgg-dock-results a:hover,
:root[data-sgg-theme="light"] .sgg-dock-results a:focus-visible {
	background: rgba(214, 164, 72, 0.14);
}

:root[data-sgg-theme="light"] .sgg-dock-results small {
	color: rgba(61, 45, 20, 0.62);
}

:root[data-sgg-theme="light"] .sgg-dock-btn {
	border-color: rgba(156, 106, 22, 0.6);
	color: #3d2d14;
}

:root[data-sgg-theme="light"] .sgg-dock-btn--gold {
	border-color: #14110c;
	background: #14110c;
	color: #fbf6ec;
}

:root[data-sgg-theme="light"] .sgg-dock-note {
	border-color: rgba(186, 140, 58, 0.5);
}

:root[data-sgg-theme="light"] .sgg-dock-sheet :focus-visible,
:root[data-sgg-theme="light"] .sgg-dock__item:focus-visible {
	outline-color: #7a5210;
}
