/* ==========================================================================
   COMPONENTS — topbar, header, nav, theme switch, drawer, tab bar, forms,
   accordion, lightbox, footer, back-to-top
   ========================================================================== */

/* ---------- Emergency top bar ---------- */
.gdr-topbar {
	background: var(--gdr-red);
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 600;
	position: relative;
	z-index: 1031;
}
.gdr-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 40px;
}
.gdr-topbar a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.gdr-topbar a:hover { text-decoration: underline; }
.gdr-topbar__msg { display: inline-flex; align-items: center; gap: 0.4rem; }

/* ---------- Sticky header ---------- */
.gdr-header {
	position: sticky;
	top: 0;
	z-index: 1030;
	background: color-mix(in srgb, var(--bg) 92%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid var(--line);
	transition: box-shadow 0.25s, background-color 0.25s;
}
.gdr-header.is-stuck { box-shadow: var(--shadow-md); }
.gdr-navbar { padding: 0; }
.gdr-navbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: nowrap;
	gap: 0.75rem;
	min-height: var(--header-h);
	transition: min-height 0.25s var(--ease);
}
.gdr-header.is-stuck .gdr-navbar__inner { min-height: 64px; }

.gdr-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.8rem;
	text-decoration: none;
	color: var(--ink);
	min-width: 0;
}
.gdr-brand:hover { color: var(--ink); }
.gdr-logo {
	display: inline-flex;
	flex: none;
	background: var(--logo-bg);
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 3px;
	box-shadow: var(--shadow-sm);
}
.gdr-logo img { width: 100%; height: auto; border-radius: 12px; }
.gdr-logo--header { width: 64px; transition: width 0.25s var(--ease); }
.gdr-header.is-stuck .gdr-logo--header { width: 54px; }
.gdr-logo--footer { width: 150px; }

.gdr-brand__text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.gdr-brand__text strong {
	font-family: var(--font-head);
	font-weight: 400;
	font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
	letter-spacing: 0.02em;
	white-space: nowrap;
}
.gdr-brand__text em { font-style: normal; color: var(--accent-ink); }
.gdr-brand__text small { font-size: 0.8125rem; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; }

.gdr-navbar__menu { margin-inline: auto; }
.gdr-nav { display: flex; flex-direction: row; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.gdr-nav .nav-link {
	position: relative;
	padding: 0.6rem 0.9rem;
	font-weight: 700;
	font-size: 1.0625rem;
	color: var(--ink);
	border-radius: var(--r-sm);
	transition: color 0.18s;
}
.gdr-nav .nav-link::after {
	content: "";
	position: absolute;
	left: 0.9rem;
	right: 0.9rem;
	bottom: 0.25rem;
	height: 3px;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s var(--ease);
}
.gdr-nav .nav-link:hover,
.gdr-nav .nav-link.is-active { color: var(--accent-ink); }
.gdr-nav .nav-link:hover::after,
.gdr-nav .nav-link.is-active::after { transform: scaleX(1); }

.gdr-navbar__actions { display: flex; align-items: center; gap: 0.6rem; }

/* ---------- Theme switcher ---------- */
.gdr-theme { position: relative; }
.gdr-theme__icon--dark { display: none; }
html[data-theme="dark"] .gdr-theme__icon--light { display: none; }
html[data-theme="dark"] .gdr-theme__icon--dark { display: inline; }
.gdr-theme__menu {
	position: absolute;
	right: 0;
	top: calc(100% + 10px);
	min-width: 170px;
	margin: 0;
	padding: 0.4rem;
	list-style: none;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	box-shadow: var(--shadow-lg);
	z-index: 1040;
}
.gdr-theme__menu[hidden] { display: none; }
.gdr-theme__menu button {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
	min-height: 44px;
	padding: 0.5rem 0.8rem;
	font: inherit;
	font-weight: 600;
	color: var(--ink);
	background: transparent;
	border: 0;
	border-radius: var(--r-sm);
	cursor: pointer;
	text-align: left;
}
.gdr-theme__menu button:hover { background: var(--bg-soft); }
.gdr-theme__menu button[aria-checked="true"] { background: var(--bg-tint); color: var(--accent-ink); }
.gdr-theme__menu button[aria-checked="true"]::after { content: "\F26E"; font-family: bootstrap-icons; margin-left: auto; }

/* ---------- Off-canvas drawer ---------- */
.gdr-offcanvas { background: var(--bg); color: var(--ink); width: min(88vw, 360px); border-left: 1px solid var(--line); }
.gdr-offcanvas .offcanvas-title { font-family: var(--font-head); font-size: 1.75rem; letter-spacing: 0.03em; }
.gdr-nav--drawer { flex-direction: column; gap: 0.25rem; }
.gdr-nav--drawer .nav-link { display: flex; align-items: center; min-height: 54px; padding: 0.75rem 1rem; font-size: 1.2rem; border-radius: var(--r-md); }
.gdr-nav--drawer .nav-link::after { display: none; }
.gdr-nav--drawer .nav-link:hover,
.gdr-nav--drawer .nav-link.is-active { background: var(--bg-tint); }
.gdr-offcanvas__cta { margin-top: 1.75rem; }
.gdr-offcanvas__hours { margin: 1rem 0 0; font-size: 0.9375rem; color: var(--muted); display: flex; gap: 0.5rem; }

/* ---------- Mobile bottom tab bar ---------- */
.gdr-tabbar { display: none; }

/* ---------- Forms ---------- */
.gdr-form { display: flex; flex-direction: column; gap: 1.1rem; }
.gdr-form__title { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); margin: 0; }
.gdr-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.gdr-label { display: block; margin-bottom: 0.35rem; font-weight: 700; font-size: 0.9375rem; color: var(--ink); }
.gdr-label span { font-weight: 400; color: var(--muted); }
.gdr-input {
	min-height: 52px;
	padding: 0.7rem 0.95rem;
	font-size: 1.0625rem;
	color: var(--ink);
	background-color: var(--surface-2);
	border: 1.5px solid var(--line);
	border-radius: var(--r-sm);
	transition: border-color 0.18s, box-shadow 0.18s, background-color 0.18s;
}
textarea.gdr-input { min-height: 120px; resize: vertical; }
.gdr-input:focus {
	color: var(--ink);
	background-color: var(--surface);
	border-color: var(--accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
.gdr-input.is-invalid { border-color: #dc2626; }
.gdr-input::placeholder { color: var(--muted); opacity: 0.8; }
.gdr-form__fine { margin: 0; font-size: 0.875rem; color: var(--muted); }
.gdr-form__msg {
	padding: 0.9rem 1rem;
	font-weight: 600;
	border-radius: var(--r-sm);
	background: #e7f6ec;
	color: #14532d;
	border: 1px solid #a7e0bb;
}
.gdr-form__msg[hidden] { display: none; }
.gdr-form__msg.is-error { background: #fdeceb; color: #7a1010; border-color: #f2b4b0; }
html[data-theme="dark"] .gdr-form__msg { background: #12301f; color: #b7ecc9; border-color: #1f5a37; }
html[data-theme="dark"] .gdr-form__msg.is-error { background: #3a1513; color: #ffd0cc; border-color: #7a2824; }

/* ---------- Accordion (FAQ) ---------- */
.gdr-accordion { --bs-accordion-bg: transparent; --bs-accordion-border-width: 0; display: grid; gap: 0.75rem; }
.gdr-accordion .accordion-item {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	overflow: hidden;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.gdr-accordion .accordion-item:has(.show) { border-color: var(--accent); box-shadow: var(--shadow-md); }
.gdr-accordion .accordion-button {
	gap: 1rem;
	min-height: 64px;
	padding: 1rem 1.25rem;
	font-family: var(--font-body);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--ink);
	background: transparent;
	box-shadow: none;
}
.gdr-accordion .accordion-button:not(.collapsed) { color: var(--accent-ink); background: var(--bg-tint); }
.gdr-accordion .accordion-button:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.gdr-accordion .accordion-button::after { flex: none; }
html[data-theme="dark"] .gdr-accordion .accordion-button::after { filter: invert(1) brightness(1.6); }
.gdr-accordion .accordion-body { padding: 1.1rem 1.25rem 1.4rem; color: var(--ink-2); font-size: 1.0625rem; }

/* ---------- Lightbox ---------- */
.gdr-lightbox {
	position: fixed;
	inset: 0;
	z-index: 2100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4.5rem 1rem 2rem;
	background: rgba(6, 12, 24, 0.92);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
.gdr-lightbox[hidden] { display: none; }
.gdr-lightbox__figure { margin: 0; max-width: min(1000px, 100%); text-align: center; }
.gdr-lightbox__figure img { width: auto; max-width: 100%; max-height: 72vh; margin-inline: auto; border-radius: var(--r-md); box-shadow: var(--shadow-lg); background: #111; }
.gdr-lightbox__figure figcaption { margin-top: 0.9rem; color: #dbe5f3; font-size: 1rem; max-width: 46em; margin-inline: auto; }
.gdr-lightbox__close,
.gdr-lightbox__nav {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	font-size: 1.4rem;
	color: #fff;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.18s, transform 0.18s;
}
.gdr-lightbox__close:hover,
.gdr-lightbox__nav:hover { background: rgba(255, 255, 255, 0.3); }
.gdr-lightbox__close { top: 1rem; right: 1rem; }
.gdr-lightbox__nav { top: 50%; transform: translateY(-50%); }
.gdr-lightbox__nav--prev { left: 1rem; }
.gdr-lightbox__nav--next { right: 1rem; }
body.gdr-lb-open { overflow: hidden; }

/* ---------- Footer ---------- */
.gdr-footer { background: var(--band); color: var(--band-muted); font-size: 1.0625rem; }
.gdr-footer__top { padding-block: clamp(3.5rem, 2.5rem + 4vw, 6rem) clamp(2.5rem, 2rem + 2vw, 4rem); }
.gdr-footer a { color: #fff; text-decoration: none; }
.gdr-footer a:hover { color: var(--gdr-blue); text-decoration: underline; }
.gdr-footer__brand { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.gdr-footer__tagline { margin: 0; font-family: var(--font-head); font-size: 1.75rem; letter-spacing: 0.03em; color: #fff; max-width: 9em; line-height: 1.1; }
.gdr-footer__about { max-width: 30em; }
.gdr-footer__h { font-family: var(--font-head); font-size: 1.75rem; letter-spacing: 0.04em; color: #fff; margin-bottom: 1rem; }
.gdr-footer__h--sub { margin-top: 1.5rem; font-size: 1.5rem; }
.gdr-footer__list,
.gdr-footer__contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.gdr-footer__list a { display: inline-block; padding-block: 0.15rem; }
.gdr-footer__contact li { display: flex; gap: 0.7rem; align-items: flex-start; }
.gdr-footer__contact .bi { color: var(--gdr-blue); margin-top: 0.3rem; }
.gdr-hours { margin: 0; display: grid; gap: 0.35rem; }
.gdr-hours div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed rgba(255, 255, 255, 0.18); padding-bottom: 0.35rem; }
.gdr-hours dt { font-weight: 600; color: #fff; }
.gdr-hours dd { margin: 0; text-align: right; }
.gdr-social { list-style: none; display: flex; gap: 0.6rem; margin: 1.25rem 0 0; padding: 0; }
.gdr-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	font-size: 1.2rem;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	transition: background-color 0.18s, transform 0.18s;
}
.gdr-social a:hover { background: var(--gdr-blue); color: #fff; transform: translateY(-3px); text-decoration: none; }
.gdr-footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.9375rem; }
.gdr-footer__bottom-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 1.5rem; padding-block: 1.25rem; }
.gdr-footer__bottom p { margin: 0; }
.gdr-footer__bottom ul { display: flex; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }

/* ---------- Back to top ---------- */
.gdr-totop {
	position: fixed;
	right: max(1rem, env(safe-area-inset-right));
	bottom: 1.25rem;
	z-index: 1020;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	font-size: 1.25rem;
	color: #fff;
	background: var(--gdr-navy);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	box-shadow: var(--shadow-md);
	cursor: pointer;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.25s, transform 0.25s;
}
.gdr-totop.is-on { opacity: 1; transform: none; }
.gdr-totop[hidden] { display: none; }
html[data-theme="dark"] .gdr-totop { background: #1f3a5f; }

/* ---------- Mobile: native-app feel ---------- */
@media (max-width: 991.98px) {
	:root { --header-h: 64px; }
	body.gdr-body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
	.gdr-logo--header { width: 50px; border-radius: 14px; }
	.gdr-header.is-stuck .gdr-logo--header { width: 46px; }
	.gdr-brand__text small { display: none; }
	.gdr-brand { flex: 1 1 auto; gap: 0.6rem; }
	.gdr-brand__text strong { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.gdr-navbar__actions { flex: 0 0 auto; gap: 0.4rem; }

	.gdr-tabbar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1035;
		display: grid;
		grid-template-columns: 1fr 1fr 1.15fr 1fr 1fr;
		align-items: end;
		height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
		padding: 0.35rem 0.5rem env(safe-area-inset-bottom);
		background: color-mix(in srgb, var(--surface) 94%, transparent);
		-webkit-backdrop-filter: saturate(1.5) blur(18px);
		backdrop-filter: saturate(1.5) blur(18px);
		border-top: 1px solid var(--line);
		border-radius: 22px 22px 0 0;
		box-shadow: 0 -10px 30px -14px rgba(16, 24, 40, 0.3);
	}
	.gdr-tabbar__item {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 2px;
		min-height: 56px;
		font-size: 0.75rem;
		font-weight: 700;
		letter-spacing: 0.02em;
		color: var(--muted);
		text-decoration: none;
		border-radius: 14px;
		transition: color 0.18s, transform 0.18s;
		touch-action: manipulation;
	}
	.gdr-tabbar__item .bi { font-size: 1.4rem; line-height: 1; }
	.gdr-tabbar__item:active { transform: scale(0.9); }
	.gdr-tabbar__item.is-active { color: var(--accent-ink); }
	.gdr-tabbar__item--call {
		position: relative;
		color: #fff;
		justify-self: center;
		width: 64px;
		min-height: 64px;
		margin-top: -26px;
		margin-bottom: 4px;
		background: var(--gdr-green);
		border: 4px solid var(--bg);
		border-radius: 50%;
		box-shadow: 0 10px 22px -6px rgba(21, 128, 61, 0.7);
	}
	.gdr-tabbar__item--call span { font-size: 0.6875rem; }
	.gdr-tabbar__item--call .bi { font-size: 1.35rem; }
	.gdr-totop { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px); }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
	.gdr-navbar__actions .gdr-btn--call { display: none !important; }
	.gdr-nav .nav-link { padding-inline: 0.6rem; }
}
