/**
 * Gift checkout styles. Shared donor-field classes are reused by later shortcodes.
 */

.portal-gift-checkout {
	max-width: 1100px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #1d2327;
}

.portal-gift-checkout h2 {
	margin: 0 0 8px;
	font-size: 1.6rem;
}

.portal-gift-lead,
.portal-gift-empty,
.portal-gift-unavailable p {
	margin: 0 0 20px;
	color: #50575e;
}

.portal-gift-step[hidden] {
	display: none !important;
}

.portal-gift-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.portal-gift-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	display: flex;
	flex-direction: column;
}

.portal-gift-card.is-selected {
	border-color: #0073aa;
	box-shadow: 0 0 0 1px #0073aa;
}

.portal-gift-thumb {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.portal-gift-thumb:focus-visible {
	outline: 2px solid #0073aa;
	outline-offset: -2px;
}

.portal-gift-image {
	width: 100%;
	height: 150px;
	object-fit: cover;
	background: #f0f0f1;
	display: block;
}

.portal-gift-image-placeholder {
	height: 150px;
}

.portal-gift-card-body {
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.portal-gift-card-body h3 {
	margin: 0;
	font-size: 1.05rem;
}

.portal-gift-price {
	margin: 0;
	font-weight: 600;
	color: #0073aa;
}

.portal-gift-select,
.portal-gift-qty {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.95rem;
}

.portal-gift-qty input {
	width: 4.5rem;
	padding: 6px 4px 6px 8px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 1rem;
}

.portal-gift-qty input::-webkit-inner-spin-button,
.portal-gift-qty input::-webkit-outer-spin-button {
	opacity: 1;
}

.portal-gift-yearly {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 12px 0 18px;
	font-size: 1.2rem;
	font-weight: 600;
}

.portal-gift-yearly input {
	width: 1.15rem;
	height: 1.15rem;
	margin: 0;
}

.portal-gift-summary {
	flex: 1;
	min-width: 220px;
}

.portal-gift-breakdown {
	list-style: none;
	margin: 0 0 10px;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
}

.portal-gift-breakdown li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 0;
}

.portal-gift-breakdown[hidden] {
	display: none;
}

.portal-gift-total-bar,
.portal-gift-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.portal-gift-total {
	margin: 0;
	font-size: 1.15rem;
}

.portal-gift-button {
	background: #0073aa;
	color: #fff;
	border: 0;
	border-radius: 4px;
	padding: 10px 18px;
	font-size: 1rem;
	cursor: pointer;
}

.portal-gift-button:hover,
.portal-gift-button:focus {
	background: #005d8c;
}

.portal-gift-button:disabled {
	background: #a7aaad;
	cursor: not-allowed;
}

.portal-gift-button-secondary {
	background: #f6f7f7;
	color: #1d2327;
	border: 1px solid #c3c4c7;
}

.portal-gift-button-secondary:hover,
.portal-gift-button-secondary:focus {
	background: #f0f0f1;
}

.portal-gift-fields,
.portal-gift-pay-box {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 16px;
}

.portal-gift-field {
	margin-bottom: 12px;
	flex: 1;
	min-width: 180px;
}

.portal-gift-field label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
}

.portal-gift-required {
	color: #b32d2e;
}

.portal-gift-field input,
.portal-gift-field select,
.portal-gift-field textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 16px;
	box-sizing: border-box;
}

.portal-gift-field-row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.portal-gift-card-element {
	padding: 12px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #fff;
	min-height: 44px;
}

.portal-gift-card-errors,
.portal-gift-form-errors,
.portal-gift-subscription-warning {
	color: #b32d2e;
	margin: 8px 0 0;
}

.portal-gift-modal {
	display: none;
}

.portal-gift-modal.is-open {
	display: flex;
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.7);
	padding: 20px;
	box-sizing: border-box;
}

.portal-gift-modal-dialog {
	background: #fff;
	border-radius: 12px;
	padding: 40px 30px;
	max-width: 500px;
	width: 100%;
	text-align: center;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
	position: relative;
	animation: portalGiftPopupFadeIn 0.3s ease-out;
	box-sizing: border-box;
}

@keyframes portalGiftPopupFadeIn {
	from {
		opacity: 0;
		transform: scale(0.9) translateY(-20px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.portal-gift-success-icon {
	width: 60px;
	height: 60px;
	background: #10b981;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
	color: #fff;
	font-size: 24px;
	font-weight: bold;
	animation: portalGiftIconBounce 0.6s ease-out 0.2s both;
}

@keyframes portalGiftIconBounce {
	from {
		transform: scale(0);
	}
	to {
		transform: scale(1);
	}
}

.portal-gift-thanks {
	font-size: 18px;
	line-height: 1.6;
	color: #374151;
	margin: 0;
}

.portal-gift-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #e5e7eb;
	box-shadow: none;
	color: #111827;
	font-size: 28px;
	font-weight: 600;
	line-height: 1;
	min-width: 36px;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.portal-gift-modal-close:hover,
.portal-gift-modal-close:focus {
	background: #d1d5db;
	color: #111827;
}

@media (max-width: 768px) {
	.portal-gift-modal-dialog {
		padding: 30px 20px;
		margin: 10px;
	}
}

body.portal-gift-modal-open {
	overflow: hidden;
}

@media (max-width: 640px) {
	.portal-gift-field-row {
		flex-direction: column;
		gap: 0;
	}

	.portal-gift-actions,
	.portal-gift-total-bar {
		align-items: stretch;
	}

	.portal-gift-button {
		width: 100%;
	}
}
