/* Drive7 Gift Card — frontend styles. Ported from index(giftclaude).html. */

/* Full-bleed form uses 100vw width; clip the scrollbar-width overflow so no
   horizontal scrollbar / bottom white gutter appears. clip (not hidden) keeps
   vertical position:sticky working. Loaded only on pages with the gift widget. */
html { overflow-x: clip; }

/* Kill Elementor's column padding around the gift widget so the full-bleed gray
   bg has no white gutter (esp. the bottom strip). Scoped to our widget only. */
.elementor-element-populated:has(.elementor-widget-d7-gift-form) { padding: 0 !important; }

.d7-gift-form,
.d7-gift-hero,
.d7-gift-header {
	--d7-primary:       #8A1538;
	--d7-primary-dark:  #6b1029;
	--d7-primary-light: #a51a44;
	--d7-primary-muted: #f9f0f3;
	--d7-bg:            #f8f8f8;
	--d7-card:          #ffffff;
	--d7-border:        #e5e7eb;
	--d7-text:          #1f2937;
	--d7-muted:         #6b7280;
	font-family: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;
	box-sizing: border-box;
}
.d7-gift-form *,
.d7-gift-form *::before,
.d7-gift-form *::after,
.d7-gift-hero *,
.d7-gift-header * { box-sizing: border-box; }

/* Honor [hidden] attribute even when element default is flex/grid. */
.d7-gift-form [hidden],
.d7-gift-form[hidden],
.d7-gift-hero [hidden],
.d7-gift-header [hidden] { display: none !important; }

/* ── Header ─────────────────────────────────────────────── */
.d7-gift-header {
	position: relative;
	height: 56px;
	background: rgba(255,255,255,0.12);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	border-bottom: 1px solid rgba(255,255,255,0.18);
	color: #fff;
	z-index: 50;
}
.d7-gift-header--fixed { position: fixed; top: 0; left: 0; right: 0; }
.d7-gift-header__inner {
	max-width: 80rem;
	height: 100%;
	margin: 0 auto;
	padding: 0 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.d7-gift-header__brand { display: flex; align-items: center; gap: 0.625rem; }
.d7-gift-header__name { font-weight: 700; font-size: 1rem; letter-spacing: 0.05em; }
.d7-gift-header__tagline { font-size: 0.75rem; font-weight: 300; color: rgba(255,255,255,0.6); }
@media (max-width: 640px) { .d7-gift-header__tagline { display: none; } }

/* ── Hero ───────────────────────────────────────────────── */
.d7-gift-hero {
	position: relative;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	text-align: center;
	padding: 0 1.5rem;
}
.d7-gift-hero__bg {
	position: absolute; inset: 0;
	width: 100%; height: 100% !important;
	object-fit: cover;
	z-index: 0;
}
.d7-gift-hero__overlay {
	position: absolute; inset: 0;
	background: linear-gradient(to bottom, var(--ovt, rgba(0,0,0,0.55)) 0%, rgba(0,0,0,0.35) 50%, var(--ovb, rgba(0,0,0,0.70)) 100%);
	z-index: 1;
}
.d7-gift-hero__content { position: relative; z-index: 2; max-width: 56rem; margin: 0 auto; }
.d7-gift-hero__eyebrow {
	color: rgba(255,255,255,0.70);
	font-size: 0.75rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	font-weight: 500;
	margin-bottom: 1.5rem;
}
.d7-gift-hero__headline {
	color: #fff;
	font-weight: 700;
	line-height: 1.3;
	font-size: clamp(2rem, 5vw, 3.5rem);
	margin: 0 0 2rem;
	text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.d7-gift-hero__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	padding: 1rem 2rem;
	border-radius: 1rem;
	font-weight: 600;
	font-size: 1rem;
	color: #fff;
	background: var(--d7-primary, #8A1538);
	box-shadow: 0 8px 32px rgba(138,21,56,0.4);
	text-decoration: none;
	transition: transform 0.2s, box-shadow 0.2s;
}
.d7-gift-hero__cta:hover { transform: scale(1.05); box-shadow: 0 12px 40px rgba(138,21,56,0.5); }
.d7-gift-hero__cta:active { transform: scale(0.95); }
.d7-gift-hero__scroll {
	position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
	color: rgba(255,255,255,0.4);
	z-index: 2;
	animation: d7-bounce 2s infinite;
}
@keyframes d7-bounce { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ── Form container ────────────────────────────────────── */
.d7-gift-form {
	padding: 4rem 1rem;
	background: #f8f8f8;
	color: var(--d7-text);
	/* Full-bleed: gray bg spans full viewport like source body, no white gutters. */
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}
.d7-gift-form__inner {
	max-width: 48rem;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

/* ── Card ──────────────────────────────────────────────── */
.d7-gift-card {
	background: var(--d7-card);
	border-radius: 20px;
	border: 1px solid #f0f0f0;
	box-shadow: 0 2px 20px rgba(0,0,0,0.05);
	padding: 1.5rem;
}
@media (min-width: 640px) { .d7-gift-card { padding: 2rem; } }

.d7-gift-label {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--d7-primary);
	margin: 0 0 0.4rem;
}
.d7-gift-heading { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.25rem; }
.d7-gift-sub { color: #9ca3af; font-size: 0.875rem; margin: 0 0 1.5rem; }
.d7-gift-mini-label { font-size: 0.875rem; font-weight: 600; color: #374151; margin: 0 0 0.75rem; }

/* ── Amount grid ───────────────────────────────────────── */
.d7-gift-amount-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}
.d7-gift-amount {
	background: #fff;
	border: 1.5px solid var(--d7-border);
	border-radius: 1rem;
	padding: 1.25rem 1rem;
	cursor: pointer;
	transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
	text-align: center;
	font-family: inherit;
}
.d7-gift-amount:hover {
	border-color: var(--d7-primary);
	background: #fdf5f7;
	transform: translateY(-1px);
	box-shadow: 0 4px 18px rgba(138,21,56,0.10);
}
.d7-gift-amount.is-selected {
	border-color: var(--d7-primary);
	background: #fff8fa;
	box-shadow: 0 0 0 3px rgba(138,21,56,0.12);
}
.d7-gift-amount__value { display: block; font-size: 1.5rem; font-weight: 700; color: #111827; }
.d7-gift-amount__value-sm { display: block; font-size: 1.125rem; font-weight: 700; color: #374151; }
.d7-gift-amount__currency { display: block; font-size: 0.875rem; color: #9ca3af; margin-top: 0.125rem; }

.d7-gift-custom-amount { margin-top: 1rem; }
.d7-gift-custom-amount > label { display: block; font-size: 0.875rem; font-weight: 500; color: #4b5563; margin-bottom: 0.5rem; }
.d7-gift-custom-amount__wrap { position: relative; }
.d7-gift-custom-amount__currency {
	position: absolute; top: 50%; transform: translateY(-50%);
	inset-inline-start: 1rem;
	color: var(--d7-primary); font-weight: 700; font-size: 1.125rem;
	pointer-events: none;
}
.d7-gift-input--amount { padding-inline-start: 3rem !important; font-weight: 600; font-size: 1.125rem; }

/* ── Fields ────────────────────────────────────────────── */
.d7-gift-fields { display: flex; flex-direction: column; gap: 1rem; }
.d7-gift-field label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: #4b5563;
	margin-bottom: 0.5rem;
}
.d7-gift-optional { color: #d1d5db; font-weight: 400; margin-inline-start: 0.25rem; }
.d7-gift-input {
	width: 100%;
	padding: 0.875rem 1rem;
	border: 1.5px solid var(--d7-border);
	border-radius: 0.75rem;
	background: #fff;
	font-family: inherit;
	font-size: 1rem;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.d7-gift-input:focus {
	border-color: var(--d7-primary);
	box-shadow: 0 0 0 3px rgba(138,21,56,0.10);
}
.d7-gift-input::placeholder { color: #b0b0b0; }
.d7-gift-input--textarea { min-height: 80px; resize: vertical; }

.d7-gift-input[type="number"]::-webkit-inner-spin-button,
.d7-gift-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.d7-gift-input[type="number"] { -moz-appearance: textfield; }

/* ── Phone ─────────────────────────────────────────────── */
.d7-gift-phone {
	direction: ltr;
	display: flex;
	align-items: stretch;
	border: 1.5px solid var(--d7-border);
	border-radius: 0.75rem;
	overflow: hidden;
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.d7-gift-phone:focus-within {
	border-color: var(--d7-primary);
	box-shadow: 0 0 0 3px rgba(138,21,56,0.10);
}
.d7-gift-phone__cc {
	padding: 0.875rem 1rem;
	background: #f9fafb;
	color: var(--d7-muted);
	font-size: 0.875rem;
	font-weight: 500;
	border-inline-end: 1px solid var(--d7-border);
	flex-shrink: 0;
	user-select: none;
}
.d7-gift-phone__num {
	flex: 1;
	border: none;
	padding: 0.875rem 0.75rem;
	font-size: 1rem;
	background: transparent;
	direction: ltr;
	text-align: left;
	outline: none;
	font-family: inherit;
}

/* ── Wala card ─────────────────────────────────────────── */
.d7-gift-wala { margin-bottom: 1.5rem; }
.d7-gift-wala img {
	width: 100%;
	border-radius: 16px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.12);
	display: block;
}

/* ── Pills (delivery + schedule) ───────────────────────── */
.d7-gift-pillgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.5rem; }
.d7-gift-pill {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding: 1rem;
	background: #fff;
	border: 1.5px solid var(--d7-border);
	border-radius: 1rem;
	cursor: pointer;
	transition: all 0.22s;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	color: #1f2937;
}
.d7-gift-pill span { color: inherit; }
.d7-gift-pill:hover,
.d7-gift-pill:focus,
.d7-gift-pill.is-selected { color: #1f2937; }
.d7-gift-pill:hover span,
.d7-gift-pill:focus span,
.d7-gift-pill.is-selected span { color: #1f2937; }
.d7-gift-pill:hover { border-color: var(--d7-primary); background: #fdf5f7; }
.d7-gift-pill.is-selected { border-color: var(--d7-primary); background: #fff8fa; box-shadow: 0 0 0 3px rgba(138,21,56,0.12); }

.d7-gift-divider { height: 1px; background: linear-gradient(to right, transparent, var(--d7-border), transparent); margin: 1.5rem 0; }

.d7-gift-schedule-pickers { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }

/* ── Payment ───────────────────────────────────────────── */
.d7-gift-pay-btn {
	display: flex;
	width: 100%;
	padding: 1rem 1.5rem;
	border: none;
	border-radius: 1rem;
	background: var(--d7-primary);
	color: #fff;
	font-family: inherit;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
}
.d7-gift-pay-btn:hover { background: var(--d7-primary-dark); transform: translateY(-1px); box-shadow: 0 8px 28px rgba(138,21,56,0.30); }
.d7-gift-pay-btn:active { transform: translateY(0); }

/* ── Payment gateways (dynamic WooCommerce list) ───────── */
.d7-gift-gateways { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
.d7-gift-gateway {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
	padding: 1rem 1.25rem;
	background: #fff;
	border: 1.5px solid var(--d7-border);
	border-radius: 1rem;
	cursor: pointer;
	transition: all 0.2s;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	color: #1a1a1a;
	text-align: start;
}
.d7-gift-gateway:hover {
	border-color: var(--d7-primary);
	background: #fdf5f7;
	transform: translateY(-1px);
	box-shadow: 0 8px 28px rgba(138,21,56,0.10);
}
.d7-gift-gateway.is-selected {
	border-color: var(--d7-primary);
	background: #fff8fa;
	box-shadow: 0 0 0 3px rgba(138,21,56,0.12);
}
.d7-gift-gateway__radio {
	flex-shrink: 0;
	width: 18px; height: 18px;
	border-radius: 50%;
	border: 2px solid var(--d7-border);
	transition: border-color 0.2s, box-shadow 0.2s;
}
.d7-gift-gateway.is-selected .d7-gift-gateway__radio {
	border-color: var(--d7-primary);
	box-shadow: inset 0 0 0 4px var(--d7-primary);
}
/* Keep title readable on hover/selected (theme button:hover can null the color). */
.d7-gift-gateway,
.d7-gift-gateway:hover,
.d7-gift-gateway:focus,
.d7-gift-gateway.is-selected { color: #1a1a1a; }
.d7-gift-gateway__title,
.d7-gift-gateway:hover .d7-gift-gateway__title,
.d7-gift-gateway.is-selected .d7-gift-gateway__title { flex: 1 1 auto; color: #1a1a1a; }
.d7-gift-gateway__icon { flex-shrink: 0; display: inline-flex; align-items: center; }
.d7-gift-gateway__icon img { max-height: 28px; width: auto; display: inline-block; margin: 0; vertical-align: middle; }
.d7-gift-no-gateways {
	margin: 0 0 1rem;
	padding: 0.875rem 1rem;
	border-radius: 0.75rem;
	background: var(--d7-primary-muted);
	color: var(--d7-primary);
	font-size: 0.875rem;
	text-align: center;
}
.d7-gift-pay-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.d7-gift-pay-btn[disabled]:hover { background: var(--d7-primary); transform: none; box-shadow: none; }

.d7-gift-security {
	text-align: center;
	font-size: 0.75rem;
	color: #d1d5db;
	margin-top: 1.25rem;
}

/* ── Support ───────────────────────────────────────────── */
.d7-gift-support {
	background: #f9fafb;
	border: 1px solid #f3f4f6;
	border-radius: 1rem;
	padding: 1.25rem;
	text-align: center;
	color: #6b7280;
	font-size: 0.875rem;
}
.d7-gift-support p { margin: 0; line-height: 1.625; }
.d7-gift-support strong { color: var(--d7-primary); font-weight: 600; }
.d7-gift-support__break { display: none; }
@media (min-width: 640px) { .d7-gift-support__break { display: inline; } }
.d7-gift-support a {
	color: var(--d7-primary);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-style: dotted;
	direction: ltr;
	display: inline-block;
}

/* ── Processing overlay ────────────────────────────────── */
.d7-gift-processing {
	position: fixed;
	inset: 0;
	background: rgba(255,255,255,0.92);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}
.d7-gift-spinner {
	width: 48px; height: 48px;
	border: 3px solid #f3e8ec;
	border-top-color: var(--d7-primary);
	border-radius: 50%;
	animation: d7-spin 0.8s linear infinite;
	margin-bottom: 1.25rem;
}
@keyframes d7-spin { to { transform: rotate(360deg); } }

/* ── Thank-you (order-received) wrapper ────────────────── */
.d7-gift-thankyou {
	--d7-primary:       #8A1538;
	--d7-primary-dark:  #6b1029;
	--d7-primary-light: #a51a44;
	--d7-primary-muted: #f9f0f3;
	--d7-border:        #e5e7eb;
	--d7-text:          #1f2937;
	--d7-muted:         #6b7280;
	max-width: 48rem;
	margin: 1.5rem auto 2.5rem;
	font-family: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;
}
.d7-gift-thankyou * { box-sizing: border-box; }

/* ── Success screen (inline) ───────────────────────────── */
.d7-gift-success {
	background: #fff;
	border-radius: 20px;
	border: 1px solid #f0f0f0;
	box-shadow: 0 2px 20px rgba(0,0,0,0.05);
	padding: 2.5rem 1.5rem;
	text-align: center;
	animation: d7-pop 0.4s cubic-bezier(0.175,0.885,0.32,1.275) both;
}
@media (min-width: 640px) { .d7-gift-success { padding: 3rem 2rem; } }
.d7-gift-success__check {
	width: 80px; height: 80px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--d7-primary), var(--d7-primary-light));
	display: flex; align-items: center; justify-content: center;
	margin: 0 auto 1.5rem;
	box-shadow: 0 12px 40px rgba(138,21,56,0.25);
}
@keyframes d7-pop { 0% { transform: scale(0.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.d7-gift-success h2 { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.5rem; color: #111827; }
.d7-gift-success p  { color: #6b7280; margin: 0 0 1.5rem; font-size: 0.875rem; }

.d7-gift-success__summary {
	background: var(--d7-primary-muted);
	border-radius: 14px;
	padding: 1.25rem 1.5rem;
	margin: 0 auto 1.5rem;
	max-width: 28rem;
	text-align: start;
}
.d7-gift-success__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.5rem 0;
	border-bottom: 1px solid rgba(138,21,56,0.10);
	font-size: 0.875rem;
	gap: 1rem;
}
.d7-gift-success__row:last-child { border-bottom: none; }
.d7-gift-success__row span { color: #6b7280; font-weight: 500; flex-shrink: 0; }
.d7-gift-success__row strong { color: #111827; font-weight: 600; text-align: end; word-break: break-word; }
.d7-gift-success__row strong[data-d7-out="gift_code"] {
	color: var(--d7-primary);
	font-family: ui-monospace, SFMono-Regular, monospace;
	font-size: 1rem;
	letter-spacing: 0.05em;
}

.d7-gift-success__voucher {
	display: inline-block;
	padding: 0.875rem 1.5rem;
	margin: 0 auto 0.75rem;
	border: 1.5px solid var(--d7-primary);
	color: var(--d7-primary);
	border-radius: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s;
}
.d7-gift-success__voucher:hover { background: var(--d7-primary-muted); }

.d7-gift-success button { max-width: 24rem; margin: 0 auto; }

/* ── Gift checkout: hide the now-empty billing/additional block ── */
body.d7-gift-checkout #customer_details,
body.d7-gift-checkout .woocommerce-billing-fields,
body.d7-gift-checkout .woocommerce-additional-fields { display: none !important; }

/* ── Gift order-received: our card replaces the default WC summary tables ── */
body.d7-gift-order-received .woocommerce-order-overview,
body.d7-gift-order-received .woocommerce-order-details,
body.d7-gift-order-received .woocommerce-customer-details,
body.d7-gift-order-received .woocommerce-column--billing-address,
body.d7-gift-order-received .woocommerce-column--shipping-address,
body.d7-gift-order-received .woocommerce-bacs-bank-details,
body.d7-gift-order-received table.woocommerce-table--order-details { display: none !important; }

/* Hide the "Order received" page title + any stray "Thank you…" notice that
   doesn't contain our card (our card lives inside one such notice). */
body.d7-gift-order-received .entry-title,
body.d7-gift-order-received .page-title,
body.d7-gift-order-received .elementor-widget-theme-page-title,
body.d7-gift-order-received .elementor-page-title,
body.d7-gift-order-received .woocommerce-thankyou-order-received:not(:has(.d7-gift-thankyou)),
body.d7-gift-order-received .woocommerce-order > h2 { display: none !important; }

/* ── Auto direction helper ─────────────────────────────── */
.d7-auto-dir { unicode-bidi: plaintext; }
