/**
 * Hero components shared by the product and mattress range pages: the
 * breadcrumb, eyebrow, short description, the Comfort Feel / Mattress Height /
 * Size Guide row and the Size Guide modal. Markup comes from inc/pdp-hero.php.
 *
 * ShopWP-only rules live in shopwp-pdp-hero.css; range-only rules live in the
 * theme SCSS (assets/scss/components/_products.scss).
 */

:root {
	--sealy-hero-accent: #155061;
	--sealy-hero-primary: #1592cb;
	--sealy-hero-muted: #666666;
	--sealy-hero-border: #d7dde2;
}

/* --- Breadcrumb ------------------------------------------------------- */

.sealy-breadcrumb {
	margin: 0 0 18px;
	color: var(--sealy-hero-muted);
	font-size: 13px;
	line-height: 1.4;
}

.sealy-breadcrumb a {
	color: var(--sealy-hero-primary);
	text-decoration: none;
}

.sealy-breadcrumb a:hover,
.sealy-breadcrumb a:focus-visible {
	text-decoration: underline;
}

.sealy-breadcrumb__sep {
	margin: 0 6px;
}

/* In the Elementor product template the hero's container padding already
   provides this gap, so the margin would double it. */
.e-con .sealy-breadcrumb {
	margin-bottom: 0;
}

/* Yoast marks the current page up in bold. */
.sealy-breadcrumb .breadcrumb_last {
	color: var(--sealy-hero-accent);
	font-weight: 600;
}

/* --- Eyebrow ---------------------------------------------------------- */

/* Element-qualified so theme paragraph margins cannot override it. */
p.sealy-eyebrow {
	margin: 0 0 6px;
	color: var(--sealy-hero-accent);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

/* --- Product description ---------------------------------------------- */

.sealy-pdp-description {
	margin: 0 0 20px;
	color: var(--sealy-hero-muted);
	font-size: 16px;
	line-height: 1.6;
}

.sealy-pdp-description p {
	margin: 0 0 10px;
}

.sealy-pdp-description p:last-child {
	margin-bottom: 0;
}

.sealy-pdp-description a {
	color: var(--sealy-hero-primary);
	text-decoration: underline;
}

/* --- Spec pills ------------------------------------------------------- */

.sealy-specs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	/* The three items share the row evenly rather than bunching to one side. */
	justify-content: space-between;
	gap: 12px 24px;
	margin: 0 0 22px;
	padding: 0 0 18px;
	border-bottom: 1px solid var(--sealy-hero-border);
}

.sealy-spec {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--sealy-hero-accent);
	font-size: 15px;
	line-height: 1.35;
}

.sealy-spec__icon {
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	color: var(--sealy-hero-primary);
}

.sealy-spec__text {
	display: inline-block;
	max-width: 11em;
}

.sealy-spec__value {
	font-weight: 500;
}

.sealy-spec__suffix {
	color: var(--sealy-hero-muted);
}

.sealy-spec__guide {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0 0 0 24px;
	border: 0;
	border-left: 1px solid var(--sealy-hero-border);
	/* Astra styles bare <button> elements, so these have to be forced. */
	background: none !important;
	color: var(--sealy-hero-primary) !important;
	box-shadow: none !important;
	font-size: 15px;
	font-weight: 500;
	/* The theme uppercases buttons globally; the design uses sentence case. */
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

.sealy-spec__guide:hover,
.sealy-spec__guide:focus-visible {
	color: var(--sealy-hero-accent);
	text-decoration: underline;
}

.sealy-spec__guide .sealy-spec__icon {
	width: 17px;
	height: 17px;
	flex-basis: 17px;
	color: inherit;
}

/* --- Size guide modal ------------------------------------------------- */

.sealy-modal[hidden] {
	display: none !important;
}

.sealy-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.sealy-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 30, 40, 0.55);
}

.sealy-modal__dialog {
	position: relative;
	width: min(760px, 100%);
	max-height: 85vh;
	overflow-y: auto;
	padding: 32px;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.sealy-modal__title {
	margin: 0 0 18px;
	color: var(--sealy-hero-accent);
	font-size: 26px;
}

.sealy-modal__close {
	position: absolute;
	/* Above the modal content: an Elementor template's full-width heading comes
	   later in the markup and would otherwise sit on top and swallow the tap. */
	z-index: 2;
	top: 12px;
	right: 14px;
	padding: 4px 10px;
	border: 0;
	/* Astra styles bare <button> elements, so these have to be forced. */
	background: none !important;
	color: var(--sealy-hero-muted) !important;
	box-shadow: none !important;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.sealy-modal__close:hover {
	color: var(--sealy-hero-accent) !important;
}

.sealy-modal__content table {
	width: 100%;
	border-collapse: collapse;
}

.sealy-modal__content :is(th, td) {
	padding: 10px 12px;
	border: 1px solid var(--sealy-hero-border);
	text-align: left;
}

/* Template-driven guide (Theme Settings > Size Guide Template): wider, as the
   design lays the four sizes out side by side. */
.sealy-modal__dialog--template {
	width: min(1240px, 100%);
	max-height: 92vh;
	padding: 36px 44px 28px;
	border-radius: 14px;
}

/* Pinned to the top of the dialog while a long guide scrolls, so it cannot
   scroll out of reach on shorter screens. In the flow rather than absolute, so
   the negative margins place it level with the title - 22px from the top and
   26px from the right - without pushing the content down. */
.sealy-modal__dialog--template .sealy-modal__close {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -14px -18px -30px auto;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92) !important;
	font-size: 36px;
}

body.sealy-modal-open {
	overflow: hidden;
}

@media (max-width: 1024px) {
	/* The spec row wraps by this width, and the divider only reads correctly
	   beside a pill, not at the start of a wrapped row. */
	.sealy-spec__guide {
		padding-left: 0;
		border-left: 0;
	}
}

@media (max-width: 767px) {
	.sealy-specs {
		gap: 12px 18px;
	}

	.sealy-modal {
		padding: 10px;
	}

	.sealy-modal__dialog,
	.sealy-modal__dialog--template {
		padding: 24px 18px;
	}

	.sealy-modal__dialog--template {
		max-height: 94vh;
	}

	/* Less dialog padding here, so less to pull back. */
	.sealy-modal__dialog--template .sealy-modal__close {
		margin: -14px -8px -30px auto;
		font-size: 30px;
	}
}
