/**
 * WGL ZIP Code Selector Styles
 * Amazon-style location selector
 */

/* Widget Container */
.wgl-zip-selector-widget,
#wgl-zip-selector-auto,
.wgl-zip-inline-widget {
	display: inline-block !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: relative !important;
	z-index: 100;
	vertical-align: middle !important;
	line-height: normal !important;
	margin: 0 !important;
	padding: 0 !important;
	top: 0 !important;
	transform: none !important;
	align-self: center !important; /* For flex parent */
}

@media (max-width: 768px) {
	.wgl-zip-selector-widget,
	#wgl-zip-selector-auto,
	.wgl-zip-inline-widget {
		display: block !important;
		width: 100%;
		margin: 10px 0;
	}
}

/* Nav Link Trigger - inherits theme styles */
.wgl-zip-trigger.woodmart-nav-link {
	text-decoration: none !important;
}

.wgl-zip-trigger.woodmart-nav-link .nav-link-text {
	font-size: 13px !important;
	font-weight: 400 !important;
}

.wgl-zip-trigger.woodmart-nav-link .wd-nav-img {
	width: 14px !important;
	height: 14px !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
	.wgl-zip-trigger.woodmart-nav-link {
		display: flex !important;
		width: 100%;
		justify-content: center;
	}
}

/* ============================================
   SOFT SPOTLIGHT ONBOARDING
   Premium first-time user experience
   ============================================ */

/* Backdrop - Elegant blur & darken */
.wgl-spotlight-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 999998;
	opacity: 0;
	transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

.wgl-spotlight-backdrop.active {
	opacity: 1;
	pointer-events: all;
}

/* Spotlight Container - Floating above backdrop */
.wgl-spotlight-container {
	position: fixed;
	z-index: 999999;
	pointer-events: none;
	transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Widget Highlight - Premium glow effect */
.wgl-zip-selector-widget.wgl-spotlight-active {
	position: relative;
	z-index: 1000000;
	animation: premiumPulse 2s ease-in-out infinite;
}

.wgl-zip-selector-widget.wgl-spotlight-active::before {
	content: '';
	position: absolute;
	top: -8px;
	left: -8px;
	right: -8px;
	bottom: -8px;
	background: linear-gradient(135deg, rgba(0, 113, 220, 0.15), rgba(99, 102, 241, 0.15));
	border-radius: 12px;
	z-index: -1;
	animation: glowPulse 2s ease-in-out infinite;
}

.wgl-zip-selector-widget.wgl-spotlight-active::after {
	content: '';
	position: absolute;
	top: -4px;
	left: -4px;
	right: -4px;
	bottom: -4px;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 10px;
	box-shadow: 
		0 0 0 1px rgba(0, 113, 220, 0.2),
		0 8px 32px rgba(0, 113, 220, 0.3),
		0 16px 64px rgba(0, 113, 220, 0.2);
	z-index: -1;
}

/* Tooltip - Modern card design */
.wgl-spotlight-tooltip {
	position: fixed;
	transform: translateX(-50%) translateY(10px);
	background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
	border: 1px solid rgba(0, 113, 220, 0.1);
	border-radius: 16px;
	padding: 24px 28px;
	min-width: 320px;
	max-width: 400px;
	box-shadow: 
		0 0 0 1px rgba(0, 0, 0, 0.05),
		0 20px 40px rgba(0, 0, 0, 0.12),
		0 8px 16px rgba(0, 113, 220, 0.08);
	opacity: 0;
	pointer-events: none;
	transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 1000001;
}

.wgl-spotlight-tooltip.active {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
	pointer-events: all;
}

/* Tooltip arrow - Elegant pointer */
.wgl-spotlight-tooltip::before {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 12px solid transparent;
	border-right: 12px solid transparent;
	border-bottom: 12px solid rgba(0, 113, 220, 0.1);
}

.wgl-spotlight-tooltip::after {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 11px solid transparent;
	border-right: 11px solid transparent;
	border-bottom: 11px solid #ffffff;
	margin-bottom: -1px;
}

/* Tooltip content */
.wgl-spotlight-tooltip-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	padding-right: 48px; /* Space for close button */
	position: relative;
	z-index: 1;
}

.wgl-spotlight-tooltip-icon {
	width: 44px;
	height: 44px;
	background: linear-gradient(135deg, #0071dc 0%, #0056b3 100%);
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: 0 4px 12px rgba(0, 113, 220, 0.3);
	position: relative;
	z-index: 1;
}

.wgl-spotlight-tooltip-icon svg {
	width: 24px;
	height: 24px;
	color: #fff !important;
	stroke: #fff !important;
	fill: none !important;
	display: block !important;
}

.wgl-spotlight-tooltip-title {
	font-size: 20px;
	font-weight: 700;
	color: #1e293b;
	margin: 0;
	line-height: 1.2;
	flex: 1;
	position: relative;
	z-index: 1;
}

.wgl-spotlight-tooltip-text {
	font-size: 14px;
	line-height: 1.6;
	color: #64748b;
	margin: 0 0 20px 0;
}

.wgl-spotlight-tooltip-actions {
	display: flex;
	gap: 12px;
}

.wgl-spotlight-tooltip-btn {
	flex: 1;
	padding: 12px 20px;
	border: none;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	font-family: inherit;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.wgl-spotlight-tooltip-btn-primary {
	background: linear-gradient(135deg, #0071dc 0%, #0056b3 100%);
	color: #ffffff !important;
	box-shadow: 0 4px 12px rgba(0, 113, 220, 0.3);
}

.wgl-spotlight-tooltip-btn-primary svg {
	color: #ffffff !important;
	stroke: #ffffff !important;
}

.wgl-spotlight-tooltip-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0, 113, 220, 0.4);
}

.wgl-spotlight-tooltip-btn-secondary {
	background: rgba(0, 113, 220, 0.08);
	color: #0071dc !important;
}

.wgl-spotlight-tooltip-btn-secondary:hover {
	background: rgba(0, 113, 220, 0.15);
}

/* Close button - Elegant X */
.wgl-spotlight-close {
	position: absolute !important;
	top: 16px !important;
	right: 16px !important;
	width: 32px !important;
	height: 32px !important;
	border: none !important;
	background: rgba(0, 0, 0, 0.08) !important;
	border-radius: 8px !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
	color: #64748b !important;
	z-index: 100 !important;
	padding: 0 !important;
	margin: 0 !important;
	min-width: 32px !important;
	min-height: 32px !important;
	flex-shrink: 0 !important;
}

.wgl-spotlight-close:hover {
	background: rgba(0, 0, 0, 0.15) !important;
	transform: rotate(90deg) !important;
	color: #1e293b !important;
}

.wgl-spotlight-close svg {
	width: 18px !important;
	height: 18px !important;
	stroke-width: 2.5 !important;
	display: block !important;
	stroke: currentColor !important;
	fill: none !important;
}

/* Animations */
@keyframes premiumPulse {
	0%, 100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.02);
	}
}

@keyframes glowPulse {
	0%, 100% {
		opacity: 0.6;
		filter: blur(8px);
	}
	50% {
		opacity: 1;
		filter: blur(12px);
	}
}

@keyframes shimmer {
	0% {
		background-position: -200% center;
	}
	100% {
		background-position: 200% center;
	}
}

/* Tablet responsive */
@media (min-width: 769px) and (max-width: 1024px) {
	.wgl-spotlight-tooltip {
		min-width: 320px !important;
		max-width: calc(100vw - 80px) !important;
		width: 80% !important;
		padding: 22px 26px !important;
		border-radius: 14px !important;
		left: 50% !important;
		transform: translateX(-50%) translateY(10px) !important;
		margin: 0 auto !important;
	}
	
	.wgl-spotlight-tooltip.active {
		transform: translateX(-50%) translateY(0) !important;
	}
	
	/* Hide arrow on tablet (tooltip is centered) */
	.wgl-spotlight-tooltip::before,
	.wgl-spotlight-tooltip::after {
		display: none !important;
	}
	
	.wgl-spotlight-tooltip-header {
		padding-right: 44px !important;
	}
	
	.wgl-spotlight-tooltip-icon {
		width: 40px !important;
		height: 40px !important;
	}
	
	.wgl-spotlight-tooltip-icon svg {
		width: 22px !important;
		height: 22px !important;
	}
	
	.wgl-spotlight-tooltip-title {
		font-size: 18px !important;
	}
	
	.wgl-spotlight-tooltip-text {
		font-size: 14px !important;
		margin-bottom: 18px !important;
	}
	
	.wgl-spotlight-tooltip-actions {
		gap: 12px !important;
	}
	
	.wgl-spotlight-tooltip-btn {
		padding: 12px 18px !important;
	}
	
	.wgl-spotlight-close {
		top: 14px !important;
		right: 14px !important;
		width: 30px !important;
		height: 30px !important;
		min-width: 30px !important;
		min-height: 30px !important;
	}
	
	.wgl-spotlight-close svg {
		width: 17px !important;
		height: 17px !important;
	}
	
	/* Tablet widget spotlight */
	.wgl-zip-selector-widget.wgl-spotlight-active {
		animation: premiumPulseTablet 2s ease-in-out infinite !important;
	}
	
	@keyframes premiumPulseTablet {
		0%, 100% {
			transform: scale(1);
		}
		50% {
			transform: scale(1.03);
		}
	}
}

/* Mobile responsive */
@media (max-width: 768px) {
	.wgl-spotlight-tooltip {
		min-width: 280px !important;
		max-width: calc(100vw - 40px) !important;
		width: 90% !important;
		padding: 20px 24px !important;
		border-radius: 12px !important;
		left: 50% !important;
		transform: translateX(-50%) translateY(10px) !important;
		margin: 0 auto !important;
	}
	
	.wgl-spotlight-tooltip.active {
		transform: translateX(-50%) translateY(0) !important;
	}
	
	.wgl-spotlight-tooltip-header {
		padding-right: 40px !important;
	}
	
	.wgl-spotlight-tooltip-icon {
		width: 36px !important;
		height: 36px !important;
	}
	
	.wgl-spotlight-tooltip-icon svg {
		width: 20px !important;
		height: 20px !important;
	}
	
	.wgl-spotlight-tooltip-title {
		font-size: 16px !important;
	}
	
	.wgl-spotlight-tooltip-text {
		font-size: 13px !important;
		margin-bottom: 16px !important;
	}
	
	.wgl-spotlight-tooltip-actions {
		flex-direction: column !important;
		gap: 10px !important;
	}
	
	.wgl-spotlight-tooltip-btn {
		width: 100% !important;
		padding: 12px 16px !important;
	}
	
	.wgl-spotlight-close {
		top: 12px !important;
		right: 12px !important;
		width: 28px !important;
		height: 28px !important;
		min-width: 28px !important;
		min-height: 28px !important;
	}
	
	.wgl-spotlight-close svg {
		width: 16px !important;
		height: 16px !important;
	}
	
	/* Hide arrow on mobile (tooltip is centered) */
	.wgl-spotlight-tooltip::before,
	.wgl-spotlight-tooltip::after {
		display: none !important;
	}
	
	/* Mobile widget spotlight - bigger pulse */
	.wgl-zip-selector-widget.wgl-spotlight-active {
		animation: premiumPulseMobile 2s ease-in-out infinite !important;
	}
	
	@keyframes premiumPulseMobile {
		0%, 100% {
			transform: scale(1);
		}
		50% {
			transform: scale(1.05);
		}
	}
}

/* Modal */
.wgl-zip-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wgl-zip-modal__overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
}

.wgl-zip-modal__content {
	position: relative;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	width: 90%;
	max-width: 450px;
	max-height: 90vh;
	overflow-y: auto;
	z-index: 1;
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
	.wgl-zip-modal__content {
		width: 95%;
		max-width: 100%;
		max-height: 95vh;
		border-radius: 12px;
	}
	
	.wgl-zip-modal__header {
		padding: 16px 20px;
	}
	
	.wgl-zip-modal__body {
		padding: 16px 20px;
	}
}

.wgl-zip-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #eee;
}

.wgl-zip-modal__header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #111;
}

.wgl-zip-modal__close {
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: all 0.2s;
}

.wgl-zip-modal__close:hover {
	background: #f0f0f0;
	color: #111;
}

.wgl-zip-modal__body {
	padding: 24px;
}

/* Input Group */
.wgl-zip-input-group {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}

.wgl-zip-input {
	flex: 1;
	padding: 12px 16px;
	border: 2px solid #ddd;
	border-radius: 6px;
	font-size: 16px;
	font-family: inherit;
	transition: border-color 0.2s;
}

.wgl-zip-input:focus {
	outline: none;
	border-color: #0071dc;
}

.wgl-zip-submit {
	padding: 12px 24px;
	background: #0071dc;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	white-space: nowrap;
	font-family: inherit;
}

.wgl-zip-submit:hover {
	background: #005bb5;
}

.wgl-zip-submit:disabled {
	background: #ccc;
	cursor: not-allowed;
}

/* Address Toggle Button */
.wgl-address-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	padding: 10px 16px;
	background: #f7f7f7;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 13px;
	color: #0071dc;
	cursor: pointer;
	transition: all 0.2s;
	margin: 12px 0;
	font-family: inherit;
}

.wgl-address-toggle:hover {
	background: #eee;
	border-color: #0071dc;
}

.wgl-address-toggle svg {
	transition: transform 0.2s;
}

/* Address Sections */
.wgl-address-basic {
	margin-bottom: 8px;
}

.wgl-address-extended {
	margin-top: 12px;
}

/* Autocomplete */
.wgl-zip-autocomplete {
	margin-bottom: 16px;
	border: 1px solid #ddd;
	border-radius: 6px;
	overflow: hidden;
	max-height: 200px;
	overflow-y: auto;
}

.wgl-zip-autocomplete-item {
	padding: 12px 16px;
	cursor: pointer;
	transition: background 0.15s;
	border-bottom: 1px solid #f0f0f0;
}

.wgl-zip-autocomplete-item:last-child {
	border-bottom: none;
}

.wgl-zip-autocomplete-item:hover {
	background: #f7f7f7;
}

/* Geolocation */
.wgl-zip-geolocation {
	margin-top: 16px;
	margin-bottom: 16px;
	text-align: center;
}

.wgl-zip-geolocation-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	background: #f7f7f7;
	border: 1px solid #ddd;
	border-radius: 6px;
	color: #0071dc;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.2s;
	font-family: inherit;
}

.wgl-zip-geolocation-btn:hover {
	background: #e8e8e8;
	border-color: #999;
}

.wgl-zip-geolocation-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Recent */
.wgl-zip-recent {
	padding-top: 16px;
	border-top: 1px solid #eee;
}

.wgl-zip-recent h4 {
	margin: 0 0 12px 0;
	font-size: 14px;
	font-weight: 600;
	color: #666;
}

.wgl-zip-recent-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wgl-zip-recent-item {
	padding: 8px 16px;
	background: #f7f7f7;
	border: 1px solid #ddd;
	border-radius: 20px;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s;
	font-family: inherit;
}

.wgl-zip-recent-item:hover {
	background: #e8e8e8;
	border-color: #999;
}

/* Notice */
.wgl-zip-notice {
	position: fixed;
	top: 20px;
	right: 20px;
	padding: 12px 20px;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	z-index: 1000000;
	font-size: 14px;
	max-width: 300px;
}

.wgl-zip-notice--success {
	border-left: 4px solid #00a650;
}

.wgl-zip-notice--error {
	border-left: 4px solid #c40000;
}

.wgl-zip-notice--info {
	border-left: 4px solid #0071dc;
}

/* Current Location Badge */
.wgl-current-location-badge {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: #f0f9ff;
	border: 1px solid #bae6fd;
	border-radius: 6px;
	margin-bottom: 16px;
	font-size: 14px;
	color: #0369a1;
}

.wgl-current-location-badge svg {
	flex-shrink: 0;
	color: #0284c7;
}

.wgl-current-location-badge span {
	flex: 1;
	font-weight: 500;
}

.wgl-clear-location {
	background: none;
	border: none;
	color: #64748b;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	transition: color 0.2s;
}

.wgl-clear-location:hover {
	color: #ef4444;
}

/* Mode Toggle */
.wgl-zip-mode-toggle {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
	border-bottom: 1px solid #e0e0e0;
	padding-bottom: 8px;
}

.wgl-zip-mode-btn {
	flex: 1;
	padding: 8px 16px;
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	cursor: pointer;
	font-size: 14px;
	color: #666;
	transition: all 0.2s;
}

.wgl-zip-mode-btn:hover {
	color: #0071dc;
}

.wgl-zip-mode-btn.active {
	color: #0071dc;
	border-bottom-color: #0071dc;
	font-weight: 600;
}

/* Address Form */
.wgl-address-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wgl-address-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.2s;
}

.wgl-address-input:focus {
	outline: none;
	border-color: #0071dc;
}

.wgl-address-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* Animations */
@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* Mobile responsive */
@media (max-width: 768px) {
	.wgl-zip-modal__content {
		width: 95%;
		margin: 20px;
	}

	.wgl-zip-trigger {
		font-size: 13px;
		padding: 6px 10px;
	}

	.wgl-zip-label {
		display: none;
	}

	.wgl-zip-input-group {
		flex-direction: column;
	}

	.wgl-zip-submit {
		width: 100%;
	}

	.wgl-zip-notice {
		right: 10px;
		left: 10px;
		max-width: none;
	}
}
