/*
 * Glacier Clarity — Global Skeleton Loading System
 * File: glacier-skeleton.css
 *
 * Scope:
 * - Global reusable skeleton primitives
 * - No page-specific selectors
 * - No external dependencies
 */

.glacier-skeleton {
	box-sizing: border-box;
	position: relative;
	overflow: hidden;
	background: #e9eef3;
	border-radius: 8px;
	color: transparent !important;
	pointer-events: none;
	user-select: none;
}

.glacier-skeleton::after {
	content: "";
	position: absolute;
	inset: 0;
	transform: translateX(-100%);
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255, 255, 255, 0.55) 50%,
		transparent 100%
	);
	animation: glacier-skeleton-shimmer 1.35s ease-in-out infinite;
}

@keyframes glacier-skeleton-shimmer {
	100% {
		transform: translateX(100%);
	}
}

/* Text primitives */
.glacier-skeleton-text {
	height: 14px;
	width: 100%;
	margin: 0 0 10px;
	border-radius: 5px;
}

.glacier-skeleton-text--xs {
	width: 25%;
	height: 10px;
}

.glacier-skeleton-text--sm {
	width: 45%;
}

.glacier-skeleton-text--md {
	width: 68%;
}

.glacier-skeleton-text--lg {
	width: 88%;
	height: 18px;
}

.glacier-skeleton-text--title {
	width: min(78%, 620px);
	height: clamp(38px, 5vw, 64px);
	margin-bottom: 18px;
	border-radius: 8px;
}

/* Header */
.glacier-skeleton-header {
	width: 100%;
	height: 76px;
	border-radius: 0;
	background: #ffffff;
	border-bottom: 1px solid #e7edf3;
}

.glacier-skeleton-header-inner {
	width: min(1180px, calc(100% - 48px));
	height: 100%;
	margin-inline: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
}

.glacier-skeleton-logo {
	width: 145px;
	height: 34px;
	border-radius: 7px;
}

.glacier-skeleton-nav {
	display: flex;
	align-items: center;
	gap: 22px;
	flex: 1;
	justify-content: center;
}

.glacier-skeleton-nav span {
	display: block;
	width: 58px;
	height: 12px;
	border-radius: 5px;
}

.glacier-skeleton-nav span:nth-child(2) {
	width: 72px;
}

.glacier-skeleton-nav span:nth-child(3) {
	width: 68px;
}

.glacier-skeleton-nav span:nth-child(4) {
	width: 62px;
}

.glacier-skeleton-button {
	width: 132px;
	height: 42px;
	border-radius: 8px;
}

/* Generic containers */
.glacier-skeleton-container {
	width: min(1180px, calc(100% - 48px));
	margin-inline: auto;
}

.glacier-skeleton-section {
	padding: 78px 0;
}

.glacier-skeleton-section-heading {
	max-width: 720px;
	margin-bottom: 40px;
}

.glacier-skeleton-eyebrow {
	width: 130px;
	height: 11px;
	margin-bottom: 16px;
	border-radius: 4px;
}

.glacier-skeleton-heading {
	width: min(72%, 560px);
	height: 42px;
	margin-bottom: 16px;
	border-radius: 7px;
}

.glacier-skeleton-lead {
	width: min(90%, 680px);
	height: 15px;
	margin-bottom: 10px;
	border-radius: 5px;
}

/* Hero */
.glacier-skeleton-hero {
	padding: 86px 0 92px;
}

.glacier-skeleton-hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(340px, 0.78fr);
	gap: 68px;
	align-items: center;
}

.glacier-skeleton-hero-copy {
	min-width: 0;
}

.glacier-skeleton-hero-title {
	width: min(92%, 650px);
	height: clamp(82px, 9vw, 150px);
	margin-bottom: 22px;
	border-radius: 10px;
}

.glacier-skeleton-hero-description {
	width: min(90%, 650px);
}

.glacier-skeleton-hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 28px;
}

.glacier-skeleton-hero-actions .glacier-skeleton-button {
	width: 148px;
}

.glacier-skeleton-hero-visual {
	min-height: 390px;
	border-radius: 20px;
}

/* Cards */
.glacier-skeleton-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
}

.glacier-skeleton-card {
	min-width: 0;
	padding: 22px;
	border: 1px solid #e3eaf0;
	border-radius: 16px;
	background: #fff;
}

.glacier-skeleton-card-image {
	width: 100%;
	aspect-ratio: 16 / 10;
	margin-bottom: 20px;
	border-radius: 11px;
}

.glacier-skeleton-card-title {
	width: 72%;
	height: 20px;
	margin-bottom: 14px;
	border-radius: 5px;
}

.glacier-skeleton-card-copy {
	width: 100%;
}

.glacier-skeleton-card-copy:last-child {
	width: 62%;
}

/* Product */
.glacier-skeleton-product {
	display: grid;
	grid-template-columns: 180px minmax(0, 1fr) auto;
	gap: 24px;
	align-items: center;
	padding: 18px;
	border: 1px solid #e3eaf0;
	border-radius: 14px;
	background: #fff;
}

.glacier-skeleton-product-image {
	width: 180px;
	height: 120px;
	border-radius: 10px;
}

.glacier-skeleton-product-title {
	width: min(70%, 300px);
	height: 22px;
	margin-bottom: 13px;
	border-radius: 5px;
}

.glacier-skeleton-product-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
}

.glacier-skeleton-product-meta span {
	width: 82px;
	height: 11px;
	border-radius: 4px;
}

.glacier-skeleton-product-action {
	width: 110px;
	height: 40px;
	border-radius: 8px;
}

/* Specs */
.glacier-skeleton-specs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	border: 1px solid #e3eaf0;
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
}

.glacier-skeleton-spec {
	min-height: 66px;
	padding: 14px 18px;
	border-bottom: 1px solid #e8edf2;
}

.glacier-skeleton-spec:nth-child(odd) {
	border-right: 1px solid #e8edf2;
}

.glacier-skeleton-spec-label {
	width: 35%;
	height: 9px;
	margin-bottom: 9px;
	border-radius: 3px;
}

.glacier-skeleton-spec-value {
	width: 65%;
	height: 13px;
	border-radius: 4px;
}

/* Lists */
.glacier-skeleton-list {
	display: grid;
	gap: 10px;
}

.glacier-skeleton-list-item {
	min-height: 64px;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 16px;
	border: 1px solid #e3eaf0;
	border-radius: 10px;
	background: #fff;
}

.glacier-skeleton-list-icon {
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	border-radius: 8px;
}

.glacier-skeleton-list-copy {
	flex: 1;
	min-width: 0;
}

/* Forms */
.glacier-skeleton-form {
	padding: 26px;
	border: 1px solid #e0e8ef;
	border-radius: 16px;
	background: #fff;
}

.glacier-skeleton-form-row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin-bottom: 18px;
}

.glacier-skeleton-field {
	height: 48px;
	border-radius: 8px;
}

.glacier-skeleton-field--textarea {
	height: 120px;
}

.glacier-skeleton-submit {
	width: 150px;
	height: 48px;
	margin-top: 6px;
	border-radius: 8px;
}

/* CTA */
.glacier-skeleton-cta {
	padding: 62px 0;
	background: #102a43;
}

.glacier-skeleton-cta-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
}

.glacier-skeleton-cta-copy {
	flex: 1;
}

.glacier-skeleton-cta-title {
	width: min(75%, 540px);
	height: 42px;
	margin-bottom: 15px;
	border-radius: 7px;
}

.glacier-skeleton-cta-description {
	width: min(80%, 620px);
}

.glacier-skeleton-cta-actions {
	display: flex;
	gap: 10px;
}

.glacier-skeleton-cta-actions .glacier-skeleton-button {
	background: #dfe7ee;
}

/* Footer */
.glacier-skeleton-footer {
	padding: 60px 0 30px;
	background: #f5f7f9;
	border-top: 1px solid #e2e8ed;
}

.glacier-skeleton-footer-grid {
	display: grid;
	grid-template-columns: 1.4fr repeat(3, 1fr);
	gap: 40px;
}

.glacier-skeleton-footer-column {
	min-width: 0;
}

.glacier-skeleton-footer-heading {
	width: 100px;
	height: 14px;
	margin-bottom: 20px;
	border-radius: 4px;
}

.glacier-skeleton-footer-line {
	width: 80%;
	height: 10px;
	margin-bottom: 11px;
	border-radius: 4px;
}

.glacier-skeleton-footer-line:last-child {
	width: 60%;
}

/* Page-level loading state */
.glacier-skeleton-page {
	overflow: hidden;
}

.glacier-skeleton-page .glacier-skeleton-target {
	visibility: hidden;
}

.glacier-skeleton-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	background: #fff;
	opacity: 1;
	visibility: visible;
	transition: opacity .28s ease, visibility .28s ease;
}

.glacier-skeleton-overlay.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.glacier-skeleton-overlay-inner {
	width: 100%;
}

/* Prevent accidental horizontal overflow */
.glacier-skeleton,
.glacier-skeleton * {
	box-sizing: border-box;
}

/* Tablet */
@media (max-width: 1024px) {

	.glacier-skeleton-hero-grid {
		grid-template-columns: minmax(0, 1fr) minmax(300px, .78fr);
		gap: 40px;
	}

	.glacier-skeleton-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.glacier-skeleton-footer-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Mobile */
@media (max-width: 800px) {

	.glacier-skeleton-container,
	.glacier-skeleton-header-inner {
		width: min(100% - 32px, 680px);
	}

	.glacier-skeleton-section {
		padding: 62px 0;
	}

	.glacier-skeleton-hero {
		padding: 64px 0 70px;
	}

	.glacier-skeleton-hero-grid {
		grid-template-columns: 1fr;
		gap: 34px;
	}

	.glacier-skeleton-hero-visual {
		min-height: 300px;
	}

	.glacier-skeleton-grid {
		grid-template-columns: 1fr;
	}

	.glacier-skeleton-product {
		grid-template-columns: 110px minmax(0, 1fr);
	}

	.glacier-skeleton-product-image {
		width: 110px;
		height: 90px;
	}

	.glacier-skeleton-product-action {
		grid-column: 2;
	}

	.glacier-skeleton-cta-inner {
		align-items: flex-start;
		flex-direction: column;
	}

	.glacier-skeleton-footer-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Small mobile */
@media (max-width: 560px) {

	.glacier-skeleton-container,
	.glacier-skeleton-header-inner {
		width: min(100% - 28px, 560px);
	}

	.glacier-skeleton-header {
		height: 66px;
	}

	.glacier-skeleton-logo {
		width: 125px;
		height: 30px;
	}

	.glacier-skeleton-nav {
		display: none;
	}

	.glacier-skeleton-button {
		width: 105px;
		height: 38px;
	}

	.glacier-skeleton-hero-title {
		width: 100%;
		height: 105px;
	}

	.glacier-skeleton-hero-description,
	.glacier-skeleton-lead {
		width: 100%;
	}

	.glacier-skeleton-hero-actions {
		width: 100%;
	}

	.glacier-skeleton-hero-actions .glacier-skeleton-button {
		width: 100%;
	}

	.glacier-skeleton-hero-visual {
		min-height: 240px;
	}

	.glacier-skeleton-heading {
		width: 90%;
	}

	.glacier-skeleton-specs {
		grid-template-columns: 1fr;
	}

	.glacier-skeleton-spec:nth-child(odd) {
		border-right: 0;
	}

	.glacier-skeleton-form {
		padding: 20px;
	}

	.glacier-skeleton-form-row {
		grid-template-columns: 1fr;
	}

	.glacier-skeleton-submit {
		width: 100%;
	}

	.glacier-skeleton-cta-actions {
		width: 100%;
		flex-direction: column;
	}

	.glacier-skeleton-cta-actions .glacier-skeleton-button {
		width: 100%;
	}

	.glacier-skeleton-footer-grid {
		grid-template-columns: 1fr 1fr;
		gap: 28px 20px;
	}
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

	.glacier-skeleton::after {
		animation: none;
	}

	.glacier-skeleton-overlay {
		transition: none;
	}
}
