/* =========================================================================
   Catalogue download popup
   Scoped under .cat-popup; resets are deliberately specific to override the
   theme's Foundation input/button styling.
   ========================================================================= */

.cat-popup *,
.cat-popup *::before,
.cat-popup *::after { box-sizing: border-box; }

.cat-popup[hidden] { display: none !important; }

.cat-popup {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	transition: opacity .28s ease;
	font-family: "Sang-Sunrise", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.cat-popup.is-open { opacity: 1; }

.cat-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(143, 131, 117, .8); /* #8F8375 at 80% */
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}

.cat-popup__dialog {
	position: relative;
	display: flex;
	width: 100%;
	max-width: 1600px;
	height: calc(100vh - 32px);
	max-height: 800px;
	background: #fff6ee;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
	transform: translateY(14px) scale(.985);
	transition: transform .32s cubic-bezier(.2, .7, .2, 1);
}

.cat-popup.is-open .cat-popup__dialog { transform: none; }

/* ---- Left visual ------------------------------------------------------- */
.cat-popup__visual {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	background-size: cover;
	background-position: center;
	display: none; /* shown on desktop */
}

.cat-popup__visual::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(0, 0, 0, .12) 0%, rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, .42) 100%);
}

.cat-popup__eyebrow {
	position: absolute;
	top: 28px;
	left: 32px;
	z-index: 2;
	color: #fff;
	font-size: 12px;
	letter-spacing: .18em;
	text-transform: uppercase;
}

.cat-popup__visual-text {
	position: absolute;
	left: 32px;
	right: 32px;
	bottom: 36px;
	z-index: 2;
	color: #fff;
}

.cat-popup__visual-heading {
	margin: 0;
	padding: 0;
	font-family: "Sang-Kingdom", Georgia, serif;
	font-weight: 400;
	font-size: 44px;
	line-height: 1.04;
	color: #fff;
}

.cat-popup__visual-rule {
	display: block;
	width: 60px;
	height: 1px;
	margin: 24px 0;
	background: #fff;
	border: 0;
}

.cat-popup__visual-text p {
	margin: 0;
	max-width: 280px;
	font-size: 14px;
	line-height: 1.5;
	color: rgba(255, 255, 255, .92);
}

/* ---- Right panel ------------------------------------------------------- */
.cat-popup__panel {
	position: relative;
	flex: 0 0 auto;
	width: clamp(360px, 44%, 624px);
	min-width: 0;
	background: #fff6ee;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 56px clamp(28px, 4.4vw, 64px);
}

.cat-popup__screen { margin: auto 0; width: 100%; }
.cat-popup__screen[hidden] { display: none; }

.cat-popup__head { margin-bottom: 28px; }

.cat-popup__title {
	margin: 0;
	padding: 0;
	font-family: "Sang-Kingdom", Georgia, serif;
	font-weight: 400;
	font-size: 28px;
	line-height: 1.1;
	color: #0a0a0a;
	text-transform: none;
	letter-spacing: 0;
}

.cat-popup__title--center { text-align: center; }

.cat-popup__subtitle {
	margin: 8px 0 0;
	font-style: italic;
	font-size: 16px;
	color: #0a0a0a;
}

/* ---- Fields ------------------------------------------------------------ */
.cat-popup__fields { display: flex; flex-direction: column; gap: 22px; }

.cat-popup__row { display: flex; gap: 16px; }
.cat-popup__row--2 > .cat-field { flex: 1 1 0; min-width: 0; }
.cat-popup__row--phone .cat-field--code { flex: 0 0 46%; }
.cat-popup__row--phone .cat-field { flex: 1 1 0; min-width: 0; }
.cat-popup__row--phone .cat-field--code select { text-overflow: ellipsis; }

.cat-field { margin: 0 !important; padding: 0; position: relative; }

/* Reset & restyle inputs/selects over Foundation */
.cat-popup input[type="text"],
.cat-popup input[type="email"],
.cat-popup input[type="tel"],
.cat-popup select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	padding: 4px 0 6px;
	border: 0;
	border-bottom: 1px solid rgba(10, 10, 10, .28);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	font-family: "Sang-Sunrise", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	color: #0a0a0a;
	transition: border-color .2s ease;
}

.cat-popup input:focus,
.cat-popup select:focus {
	outline: none;
	border-bottom-color: #938075;
	box-shadow: none;
}

/* Placeholders: required at 100%, optional at 50%. The theme forces
   `opacity:.5 !important` on every placeholder (css/styles.css), so these need
   !important to win. Separate rule per vendor prefix — grouping them would void
   the whole rule in any browser that doesn't recognise one of the prefixes. */
.cat-popup input:required::placeholder { color: #0a0a0a !important; opacity: 1 !important; }
.cat-popup input:required::-webkit-input-placeholder { color: #0a0a0a !important; opacity: 1 !important; }
.cat-popup input:required::-moz-placeholder { color: #0a0a0a !important; opacity: 1 !important; }
.cat-popup input:optional::placeholder { color: rgba(10, 10, 10, .5) !important; opacity: 1 !important; }
.cat-popup input:optional::-webkit-input-placeholder { color: rgba(10, 10, 10, .5) !important; opacity: 1 !important; }
.cat-popup input:optional::-moz-placeholder { color: rgba(10, 10, 10, .5) !important; opacity: 1 !important; }

/* Custom select chevron */
.cat-select { position: relative; display: block; }
.cat-select::after {
	content: "";
	position: absolute;
	right: 2px;
	top: 50%;
	width: 9px;
	height: 9px;
	margin-top: -6px;
	border-right: 1.5px solid rgba(10, 10, 10, .65);
	border-bottom: 1.5px solid rgba(10, 10, 10, .65);
	transform: rotate(45deg);
	pointer-events: none;
}
.cat-popup select { padding-right: 22px; cursor: pointer; }
/* Placeholder option appears muted */
.cat-popup select:optional { color: rgba(10, 10, 10, .5); }         /* optional select (phone code): 50% */
.cat-popup select:required:invalid { color: #0a0a0a; }              /* required select placeholder: 100% */
.cat-popup select option[value=""] { color: rgba(10, 10, 10, .5); }
.cat-popup select option { color: #0a0a0a; }                        /* open dropdown stays readable */

/* ---- Checkboxes (round) ------------------------------------------------ */
.cat-popup__legal { margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; }

.cat-check {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
	color: #0a0a0a;
	cursor: pointer;
}

.cat-check input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.cat-check__box {
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	margin-top: 2px;
	border: 1px solid rgba(10, 10, 10, .55);
	border-radius: 50%;
	position: relative;
	transition: background-color .15s ease, border-color .15s ease;
}

.cat-check input:checked + .cat-check__box {
	background: #938075;
	border-color: #938075;
}

.cat-check input:checked + .cat-check__box::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 2px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 1.5px 1.5px 0;
	transform: rotate(45deg);
}

.cat-check input:focus-visible + .cat-check__box {
	outline: 2px solid #938075;
	outline-offset: 2px;
}

.cat-check__label a { color: inherit; text-decoration: underline; }

/* ---- Error ------------------------------------------------------------- */
.cat-popup__error {
	margin: 16px 0 0;
	min-height: 0;
	font-size: 13px;
	color: #9a3b2f;
}
.cat-popup__error:empty { margin: 0; }

.cat-field.has-error input,
.cat-field.has-error select,
.cat-popup__row.has-error input { border-bottom-color: #9a3b2f; }

/* ---- Submit / download button ----------------------------------------- */
.cat-popup__submit,
.cat-popup__download {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 48px;
	margin: 26px 0 0;
	padding: 0 44px;
	border: 0;
	border-radius: 0;
	background: #938075;
	color: #fff;
	font-family: "Sang-Sunrise", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s ease, opacity .2s ease;
}

.cat-popup__submit:hover,
.cat-popup__download:hover { background: #82756a; }

/* The download CTA is an <a>, so the theme's link-state colours (a:hover/a:focus → #C8B8A5)
   and the browser's :visited purple (href="#" counts as the current, visited page) outrank
   the plain `color:#fff`. The JS focuses this link after submit, which surfaced it. Pin every state. */
.cat-popup__download:link,
.cat-popup__download:visited,
.cat-popup__download:hover,
.cat-popup__download:focus,
.cat-popup__download:active { color: #fff; }

.cat-popup__submit[disabled] { opacity: .6; cursor: default; }

.cat-popup__submit-icon {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	color: #fff;
}
.cat-popup__submit-icon svg { width: 22px; height: 22px; }

/* ---- Thank-you screen -------------------------------------------------- */
.cat-popup__thanks-inner { max-width: 480px; margin: 0 auto; text-align: center; }
.cat-popup__thanks-text {
	margin: 16px 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: #0a0a0a;
}
.cat-popup__screen--thanks .cat-popup__download { margin-top: 28px; }

/* ---- Close ------------------------------------------------------------- */
.cat-popup__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: #0a0a0a;
	cursor: pointer;
	line-height: 0;
}
.cat-popup__close:hover { opacity: .65; }

/* Honeypot — hidden from everyone */
.cat-popup__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
}

/* Screen-reader-only labels (in case theme lacks the class) */
.cat-popup .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	clip: rect(0 0 0 0); clip-path: inset(50%);
	overflow: hidden; white-space: nowrap;
}

/* Body scroll lock */
body.cat-popup-open { overflow: hidden; }

/* ---- Desktop ----------------------------------------------------------- */
@media (min-width: 769px) {
	.cat-popup__visual { display: block; }
}

/* ---- Mobile ------------------------------------------------------------ */
@media (max-width: 768px) {
	.cat-popup { padding: 0; }
	.cat-popup__dialog {
		flex-direction: column;
		max-width: 100%;
		width: 100%;
		height: 100%;
		max-height: none;
		box-shadow: none;
	}
	.cat-popup__panel { flex: 1 1 auto; width: auto; padding: 64px 22px 32px; }
	.cat-popup__title { font-size: 24px; }
}

/* ---- Homepage CTA trigger rendered as a <button> (gated mode) ----------- */
/* When the popup gate is on, the "NEW CATALOGUE" CTA is a real <button> (no PDF URL in
   the markup). These rules make it look identical to the <a> link it replaces. */
.content-cta button.js-catalogue-trigger {
	-webkit-appearance: none;
	appearance: none;
	background: none;
	border: 0;
	margin: 0;
	padding: 0;
	font: inherit;          /* heading button inherits .content-cta h1 (Sang-Kingdom, white) */
	color: inherit;
	letter-spacing: inherit;
	text-align: inherit;
	cursor: pointer;
}
/* Sub-title button sits outside the <h1>, so replicate the .content-cta a link + animated underline. */
.content-cta button.cat-cta-sub {
	position: relative;
	font-size: 14px;
	line-height: 22px;
	font-family: "Sang-Sunrise", sans-serif;
	color: #fff;
}
.content-cta button.cat-cta-sub::after {
	content: "";
	display: block;
	position: absolute;
	left: 50%;
	bottom: -2px;
	width: 0;
	height: 1px;
	background-color: #fff;
	transform: translateX(-50%);
	transition: all 0.6s ease-in-out;
}
.content-cta button.cat-cta-sub:hover::after { width: 100%; }
