/* =====================================================
 *  HS WhatsApp Popup — Styles
 *  Namespace: .hswp-  (isolated from theme/plugins)
 * ===================================================== */

/* Alexandria Font Definitions */
@font-face {
	font-family: 'Alexandria';
	src: url('../../alexandria/Alexandria-Thin.ttf') format('truetype');
	font-weight: 100;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Alexandria';
	src: url('../../alexandria/Alexandria-ExtraLight.ttf') format('truetype');
	font-weight: 200;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Alexandria';
	src: url('../../alexandria/Alexandria-Light.ttf') format('truetype');
	font-weight: 300;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Alexandria';
	src: url('../../alexandria/Alexandria-Regular.ttf') format('truetype');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Alexandria';
	src: url('../../alexandria/Alexandria-Medium.ttf') format('truetype');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Alexandria';
	src: url('../../alexandria/Alexandria-SemiBold.ttf') format('truetype');
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Alexandria';
	src: url('../../alexandria/Alexandria-Bold.ttf') format('truetype');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Alexandria';
	src: url('../../alexandria/Alexandria-ExtraBold.ttf') format('truetype');
	font-weight: 800;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Alexandria';
	src: url('../../alexandria/Alexandria-Black.ttf') format('truetype');
	font-weight: 900;
	font-style: normal;
	font-display: swap;
}

/* Overlay */
.hswp-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
	padding: 16px;
}

.hswp-overlay.hswp-active {
	opacity: 1;
	visibility: visible;
}

/* Popup Card - Golden Ticket Style */
.hswp-popup {
	position: relative;
	/* Removed background/border/shadow from here to allow overflow */
	padding: 36px 32px 28px;
	max-width: 400px;
	width: 100%;
	text-align: center;
	direction: rtl;
	font-family: 'Alexandria', sans-serif;
	transform: scale(0.85) translateY(30px);
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
	/* overflow: visible is default, but explicit clarifying intent */
	overflow: visible;
}

/* Background & Aesthetic Container */
.hswp-popup-bg {
	position: absolute;
	inset: 0;
	z-index: -1;
	/* Golden Gradient Background */
	background: linear-gradient(135deg, #fffbf0 0%, #f5e1a4 35%, #e8cf82 70%, #dcc170 100%);
	border-radius: 8px;
	/* Gold Border */
	border: 2px solid #c9a227;
	/* Premium Shadow */
	box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(201, 148, 26, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.6);
	overflow: hidden;
	/* For shimmer effect clipping */
}

/* Shimmer Animation applied to the background container */
.hswp-popup-bg::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
	animation: hswp-shimmer 3s infinite;
	pointer-events: none;
	z-index: 0;
}

@keyframes hswp-shimmer {
	0% {
		left: -100%;
	}

	50%,
	100% {
		left: 100%;
	}

	/* Slight pause implies ease */
}

.hswp-overlay.hswp-active .hswp-popup {
	transform: scale(1) translateY(0);
}

/* Global Font Override for Plugin Area */
.hswp-popup * {
	font-family: 'Alexandria', sans-serif !important;
}

/* Close Button */
.hswp-close {
	position: absolute;
	top: 12px;
	left: 14px;
	background: none;
	border: none;
	font-size: 28px;
	color: #7a5c1f;
	/* Dark gold */
	cursor: pointer;
	line-height: 1;
	padding: 4px 8px;
	border-radius: 50%;
	transition: all 0.2s ease;
	z-index: 2;
}

.hswp-close:hover {
	color: #333;
	background: rgba(255, 255, 255, 0.5);
}

/* Icon */
.hswp-icon {
	margin-bottom: 20px;
	display: flex;
	justify-content: center;
}

.hswp-icon img {
	width: 70px;
	height: auto;
	max-width: 100%;

}

@keyframes hswp-float {
	0% {
		transform: translateY(0);
	}

	50% {
		transform: translateY(-6px);
	}

	100% {
		transform: translateY(0);
	}
}

/* Title */
.hswp-title {
	font-size: 22px;
	font-weight: 700;
	color: #504110 !important;
	margin: 0 0 8px;
	line-height: 1.4;
}

/* Message */
.hswp-message {
	font-size: 15px;
	color: #7a6318;
	font-weight: 500;
	margin: 0 0 20px;
	line-height: 1.6;
}

/* Form */
.hswp-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* Phone Input Wrapper - MUST be LTR */
.hswp-input-wrap {
	width: 100%;
	direction: ltr !important;
	text-align: left !important;
}

.hswp-input-wrap .iti {
	width: 100%;
}

/* Force LTR layout for intl-tel-input v25 internals */
.hswp-input-wrap .iti__country-container {
	left: 0 !important;
	right: auto !important;
	border-right: 1px solid #c9a227;
	/* Gold border */
	background: #fffbf0;
	/* Light gold tint */
	border-radius: 8px 0 0 8px;
}

.hswp-input-wrap .iti__selected-country {
	direction: ltr !important;
	padding: 0 8px !important;
	height: 100%;
	display: flex;
	align-items: center;
	gap: 2px;
	background: transparent;
	border: none;
	border-radius: 8px 0 0 8px;
}

.hswp-input-wrap .iti__selected-country-primary {
	padding-right: 0 !important;
	padding-left: 0 !important;
	display: flex;
	align-items: center;
}

.hswp-input-wrap .iti__arrow {
	margin-left: 6px;
	margin-right: 2px;
	border-top-color: #7a5c1f;
}

.hswp-input-wrap .iti__selected-country-primary:hover {
	background: rgba(201, 162, 39, 0.1);
}

.hswp-input-wrap .iti__selected-country:hover {
	background: rgba(201, 162, 39, 0.1);
}

/* The phone input field */
.hswp-input-wrap .iti__tel-input,
.hswp-phone-input {
	width: 100%;
	padding: 14px 14px 14px 100px !important;
	font-size: 15px;
	border: 1px solid #c9a227;
	/* Gold Border */
	border-radius: 4px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	background: #fff;
	box-sizing: border-box;
	direction: ltr !important;
	text-align: left !important;
	color: #333;
	letter-spacing: 0.3px;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.hswp-input-wrap .iti__tel-input::placeholder {
	color: #aaa;
	font-weight: 400;
}

.hswp-input-wrap .iti__tel-input:focus,
.hswp-phone-input:focus {
	border-color: #A87D4F;
	box-shadow: 0 0 0 3px rgba(168, 125, 79, 0.2);
	background: #fff;
}

/* Dropdown list styling */
.iti--container {
	z-index: 1000001 !important;
}

.iti__dropdown-content {
	direction: ltr !important;
	text-align: left !important;
	border-radius: 8px !important;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
	border: 1px solid #c9a227 !important;
	background: #fff;
}

/* Error Message */
.hswp-error {
	color: #e74c3c;
	background: rgba(255, 255, 255, 0.8);
	border-radius: 4px;
	font-size: 13px;
	text-align: right;
	margin-top: -6px;
	padding: 2px 6px;
	font-weight: 600;
}

/* Submit Button - Premium Gold */
.hswp-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 24px;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	/* Gold Gradient */
	background: linear-gradient(135deg, #A87D4F 0%, #8B653E 100%);
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s ease;
	width: 100%;
}

.hswp-submit:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(168, 125, 79, 0.5);
	background: linear-gradient(135deg, #b5895a 0%, #9c7348 100%);
}

.hswp-submit:active {
	transform: translateY(0);
}

.hswp-submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

/* Spinner */
.hswp-spinner {
	display: inline-flex;
	align-items: center;
}

/* =====================================================
 *  Success State
 * ===================================================== */

.hswp-success-icon {
	font-size: 42px;
	margin-bottom: 8px;
	animation: hswp-bounce 0.8s ease-out;
}

@keyframes hswp-bounce {
	0% {
		transform: scale(0);
		opacity: 0;
	}

	50% {
		transform: scale(1.2);
	}

	70% {
		transform: scale(0.9);
	}

	100% {
		transform: scale(1);
		opacity: 1;
	}
}

/* Coupon Box */
.hswp-coupon-box {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	/* Light background to contrast with main popup */
	background: rgba(255, 255, 255, 0.6);
	border: 2px dashed #7a5c1f;
	/* Dark gold dashed border */
	border-radius: 14px;
	padding: 16px 20px;
	margin: 16px 0;
	direction: ltr;
}

.hswp-coupon-code {
	font-size: 22px;
	font-weight: 700;
	color: #A87D4F;
	/* Dark text for contrast */
	letter-spacing: 2.5px;
	user-select: all;
	text-transform: uppercase;
}

/* Copy Button */
.hswp-copy-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 8px 12px;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: #A87D4F;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.hswp-copy-btn:hover {
	background: #8B653E;
	transform: translateY(-1px);
}

.hswp-copy-btn:hover svg {
	stroke: #fff;
}

.hswp-copy-btn.hswp-copied {
	background: #25D366;
	/* Green for success */
	color: #fff;
}

.hswp-copy-btn.hswp-copied svg {
	stroke: #fff;
}

/* WhatsApp Status */
.hswp-wa-status {
	font-size: 13px;
	color: #7a6318;
	font-weight: 600;
	margin: 8px 0 16px;
}

/* Shop Now Button */
.hswp-shop-btn {
	background: linear-gradient(135deg, #A87D4F 0%, #8B653E 100%);
	color: #fff;
}

.hswp-shop-btn:hover {
	background: linear-gradient(135deg, #b5895a 0%, #9c7348 100%);
}

/* =====================================================
 *  Responsive
 * ===================================================== */

@media (max-width: 480px) {
	.hswp-popup {
		padding: 28px 20px 22px;
		margin: 8px;
		max-width: 90vw;
	}

	.hswp-popup-bg {
		border-radius: 8px !important;
	}

	.hswp-title {
		font-size: 19px;
	}

	.hswp-message {
		font-size: 14px;
	}

	.hswp-coupon-code {
		font-size: 18px;
	}

	.hswp-coupon-box {
		flex-direction: column;
		gap: 8px;
	}

	/* Fix Mobile Search Input Issues */
	.iti__search-input {
		font-family: inherit !important;
		padding: 12px 14px !important;
		margin-bottom: 8px !important;
		border: 1px solid #c9a227 !important;
		border-radius: 6px !important;
		font-size: 15px !important;
		height: auto !important;
		line-height: normal !important;
		box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
	}
}

#hswp-success-state>h2 {
	font-size: 16px;
}