/*
 * GiftPopup styles.
 *
 * This file is NOT compiled from SCSS: app/Fe has no gulp pipeline in this
 * repository (only app/Be does), and www/Fe/css/style_*.css is a build artefact
 * produced elsewhere. Colours and fonts are therefore hardcoded; each one notes
 * where its canonical definition lives in app/Fe/themes/default/style/variables.scss.
 */

:root {
	--gp-blue: #3098b7;              /* variables.scss $colors.blue */
	--gp-blue-hover: rgba(48, 152, 183, .5);
	--gp-ink: #161b1e;
	--gp-grey: #69727a;
	--gp-line: #d7dde1;
	--gp-white: #fff;
}

.o-gift-popup {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.o-gift-popup__overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(17, 24, 39, .6);
	cursor: pointer;
}

.o-gift-popup__modal {
	position: relative;
	background: var(--gp-white);
	width: 1040px;
	max-width: 100%;
	max-height: 90vh;
	overflow: hidden;
	z-index: 1;
	box-shadow: 0 30px 70px rgba(20, 30, 40, .16);
	border-radius: 22px;
	display: flex;
	flex-direction: column;
}

.o-gift-popup__modal > [id^="snippet-"] {
	display: flex;
	flex-direction: column;
	flex: 1;
	width: 100%;
}

@media (min-width: 861px) {
	.o-gift-popup__modal > [id^="snippet-"] {
		flex-direction: row;
	}
}

.o-gift-popup__close {
	position: absolute;
	top: 24px;
	right: 26px;
	z-index: 10;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	border-radius: 50%;
	cursor: pointer;
	transition: background .15s ease;
}

.o-gift-popup__close:hover {
	background: #f2f4f6;
}

.o-gift-popup__close svg {
	width: 18px;
	height: 18px;
	stroke: #aeb7bd;
	transition: stroke .15s ease;
}

.o-gift-popup__close:hover svg {
	stroke: var(--gp-ink);
}

/* Photo: 430px column on desktop, stacked on top below 860px. */
.o-gift-popup__image {
	position: relative;
	width: 100%;
	height: clamp(180px, 42vw, 250px);
	flex-shrink: 0;
	overflow: hidden;
}

.o-gift-popup__image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

@media (min-width: 861px) {
	.o-gift-popup__image {
		width: 430px;
		height: auto;
	}
}

.o-gift-popup__content {
	flex: 1;
	position: relative;
	display: flex;
	flex-direction: column;
	/* "safe" keeps vertical centering when the content fits, but falls back to
	   top-aligned when it is taller than the modal so nothing gets clipped */
	justify-content: safe center;
	box-sizing: border-box;
	padding: clamp(40px, 5vw, 54px) clamp(28px, 5vw, 56px) clamp(34px, 4vw, 42px);
}

/* If the whole modal would exceed the viewport, let it scroll as a last resort. */
.o-gift-popup__modal {
	overflow-y: auto;
}

.o-gift-popup__logo {
	height: 34px;
	width: auto;
	display: block;
	margin-bottom: 26px;
}

/*
 * variables.scss $font-families.third — Yantramanav, used for all headings.
 * Uppercase matches the site, where every h1–h4 is uppercased. Declared here
 * rather than inherited from the global h2 rule so it does not silently change.
 */
.o-gift-popup__title {
	font-family: Yantramanav, Arial, sans-serif;
	font-weight: 700;
	font-size: clamp(22px, 4.2vw, 30px);
	line-height: 1.15;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--gp-ink);
	margin: 0 0 8px;
}

.o-gift-popup__title-highlight {
	display: block;
	color: var(--gp-blue);
}

/* variables.scss $font-families.first — EB Garamond, used for body copy */
.o-gift-popup__description {
	font-family: 'EB Garamond', Arial, sans-serif;
	margin: 16px 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: var(--gp-grey);
	max-width: 420px;
}

.o-gift-popup__form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 26px;
}

.o-gift-popup__input {
	width: 100%;
	height: 56px;
	padding: 0 18px;
	box-sizing: border-box;
	font-family: 'EB Garamond', Arial, sans-serif;
	font-size: 15px;
	color: var(--gp-ink);
	background: var(--gp-white);
	border: 1px solid var(--gp-line);
	border-radius: 12px;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.o-gift-popup__input::placeholder {
	color: #9aa3a9;
}

.o-gift-popup__input:focus {
	outline: none;
	border-color: var(--gp-blue);
	box-shadow: 0 0 0 3px rgba(48, 152, 183, .15);
}

/* Choice question */
.o-gift-popup__choice {
	border: 0;
	margin: 0;
	padding: 0;
}

/* The site's form reset sets `legend { display: none }` — override it. */
.o-gift-popup__choice-legend {
	display: block;
	float: none;
	font-family: Yantramanav, Arial, sans-serif;
	font-weight: 700;
	font-size: 15px;
	color: var(--gp-ink);
	padding: 0;
	margin-bottom: 12px;
}

.o-gift-popup__choice-item {
	position: relative;
	display: flex;
	align-items: center;
	margin-bottom: 10px;
}

/*
 * The native input stays in the DOM, focusable and reachable by keyboard; it is
 * only made invisible. The square is drawn on the label's ::before.
 */
.o-gift-popup__choice-item input {
	position: absolute;
	opacity: 0;
	width: 18px;
	height: 18px;
	margin: 0;
}

.o-gift-popup__choice-item label {
	font-family: 'EB Garamond', Arial, sans-serif;
	font-size: 15px;
	color: var(--gp-grey);
	cursor: pointer;
	display: flex;
	align-items: center;
}

.o-gift-popup__choice-item label::before {
	content: '';
	width: 18px;
	height: 18px;
	margin-right: 12px;
	flex-shrink: 0;
	border: 1px solid var(--gp-line);
	border-radius: 3px;
	background: var(--gp-white);
	transition: border-color .15s ease, background .15s ease;
}

.o-gift-popup__choice-item input:checked + label::before {
	border-color: var(--gp-blue);
	background: var(--gp-blue) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3.2 3.2L13 5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.o-gift-popup__choice-item input:focus + label::before {
	box-shadow: 0 0 0 3px rgba(48, 152, 183, .25);
}

/* variables.scss $colors.blue + atoms/_a-button.scss (square corners, like the homepage buttons) */
.o-gift-popup__button {
	height: 56px;
	border: 1px solid var(--gp-blue);
	border-radius: 0;
	background: var(--gp-blue);
	color: var(--gp-white);
	font-family: Yantramanav, Arial, sans-serif;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	cursor: pointer;
	width: 100%;
	box-shadow: 0 8px 20px rgba(48, 152, 183, .28);
	transition: background .15s ease;
}

.o-gift-popup__button:hover {
	background: var(--gp-blue-hover);
}

.o-gift-popup__error {
	display: block;
	color: #e00000; /* variables.scss $colors.red */
	font-size: 13px;
	margin-top: 4px;
}

/*
 * The site's live-form-validation error (.a-form-error) is position:absolute;
 * top:100%, so it anchors to the nearest positioned ancestor — here the whole
 * .o-gift-popup__content — and ends up as a red bar pinned to the modal bottom.
 * Inside the popup, render it in-flow right under its field instead.
 */
.o-gift-popup .a-form-error {
	position: static;
	display: block;
	max-width: 100%;
	margin-top: 4px;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 13px;
}

.o-gift-popup .a-form-error:after {
	display: none; /* the little pointer arrow assumes absolute positioning */
}

/* Step dots */
.o-gift-popup__step-indicator {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 24px;
}

.o-gift-popup__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--gp-line);
	transition: background .3s;
}

.o-gift-popup__dot--active {
	width: 22px;
	height: 7px;
	border-radius: 4px;
	background: var(--gp-blue);
}

.o-gift-popup__step--thanks .o-gift-popup__button {
	width: auto;
	align-self: flex-start;
	padding: 0 32px;
	margin-top: 26px;
}

/* Loading overlay shown while a step is submitted over AJAX */
.o-gift-popup__loader {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, .7);
}

.o-gift-popup__modal.is-loading .o-gift-popup__loader {
	display: flex;
}

.o-gift-popup__spinner {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 4px solid var(--gp-line);
	border-top-color: var(--gp-blue);
	animation: o-gift-popup-spin .7s linear infinite;
}

@keyframes o-gift-popup-spin {
	to { transform: rotate(360deg); }
}

body.gift-popup-open {
	overflow: hidden;
}

/* Small phones: edge-to-edge, no rounded corners. */
@media (max-width: 420px) {
	.o-gift-popup {
		padding: 0;
	}

	.o-gift-popup__modal {
		max-width: 100%;
		max-height: 100vh;
		min-height: 100vh;
		border-radius: 0;
	}

	.o-gift-popup__image {
		height: clamp(160px, 38vw, 210px);
	}
}
