/* SEO-friendly: main content stays in DOM; popup is overlay only */
.zip-delivery-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}
.zip-delivery-popup-overlay.is-visible {
	opacity: 1;
	visibility: visible;
}
.zip-delivery-popup-overlay[hidden] {
	display: none !important;
}
.zip-delivery-popup-overlay:not([hidden]).is-visible {
	display: flex !important;
}
.zip-delivery-popup-box {
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
	padding: 24px;
	max-width: 400px;
	width: 90%;
}
.zip-delivery-popup-title {
	margin: 0 0 8px;
	font-size: 1.25rem;
}
.zip-delivery-popup-desc {
	margin: 0 0 16px;
	color: #555;
	font-size: 0.95rem;
}
.zip-delivery-popup-form {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
}
.zip-delivery-popup-form input[type="text"],
.zip-delivery-popup-form select {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 1rem;
	min-width: 0;
}
.zip-delivery-popup-form input[type="text"]:focus,
.zip-delivery-popup-form select:focus {
	border-color: var(--wp-admin-theme-color, #2271b1);
	outline: none;
}

/* Custom dropdown – styled to match site Select2 for consistency */
.zip-delivery-select-wrap {
	flex: 1;
	min-width: 0;
	position: relative;
	width: 100%;
}
.zip-delivery-select-wrap * {
	outline: none;
}
/* Hide native select – only custom trigger and list are visible */
.zip-delivery-select-wrap select {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
	clip: rect(0, 0, 0, 0);
}
/* Trigger – same look as .select2-selection (height 45px, border-radius 10px, etc.) */
.zip-delivery-custom-trigger {
	display: block;
	width: 100%;
	height: 45px;
	line-height: 44px;
	padding: 0 45px 0 15px;
	border: 1px solid #d1d1d1;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 400;
	background: var(--site-white, #fff);
	color: var(--site-text-color, #333);
	font-family: var(--site-font-family, inherit);
	text-align: left;
	cursor: pointer;
	position: relative;
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
}
.zip-delivery-custom-trigger:hover,
.zip-delivery-custom-trigger:focus {

	outline: none;
}
/* Arrow – right side, 45px area like Select2, flips when open */
.zip-delivery-custom-trigger::after {
    content: '';
    position: absolute;
    top: 0;
    right: 15px;
    bottom: 0;
    margin: auto 0;
    width: 0;
    height: 0;
    border-width: 5px 5px 0 5px;
    background: url(images/select-arrow.svg) no-repeat 0 0;
    transition: transform 0.2s ease;
    width: 20px;
    height: 20px;
    background-size: 16px;
    background-position: center;
}
.zip-delivery-select-wrap.is-open .zip-delivery-custom-trigger::after {
	transform: scaleY(-1);
	
}
.zip-delivery-select-wrap.is-open .zip-delivery-custom-trigger {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	border-color: var(--site-border2, #d1d1d1);
}
/* Dropdown list – same as .select2-dropdown */
.zip-delivery-custom-list {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--site-bg-gray, #e5e5e5);
	border-top: none;
	border-radius: 0 0 10px 10px;
	background: var(--site-white, #fff);
	max-height: 260px;
	overflow-y: auto;
	z-index: 10;
	display: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	scrollbar-color: #c2c0c0 #eeeeee;
	scrollbar-width: thin;
}
.zip-delivery-custom-list::-webkit-scrollbar {
	width: 5px;
}
.zip-delivery-custom-list::-webkit-scrollbar-track {
	background: #eeeeee;
	border-radius: 0;
}
.zip-delivery-custom-list::-webkit-scrollbar-thumb {
	background-color: #c2c0c0;
	border-radius: 0;
}
.zip-delivery-select-wrap.is-open .zip-delivery-custom-list {
	display: block;
}
/* Options – same as .select2-results__option */
.zip-delivery-custom-list li {
	margin: 0;
	padding: 8px 15px;
	cursor: pointer;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	font-size: 16px;
	font-weight: 400;
	color: var(--site-text-color, #333);
	font-family: var(--site-font-family, inherit);
}
.zip-delivery-custom-list li:first-child {
	border-top: none;
}
.zip-delivery-custom-list li:hover {
	background: var(--site-color5);
	color: var(--site-white, #fff);
}
.zip-delivery-custom-list li.is-selected {
	background: var(--site-color5, #2271b1);
	color: var(--site-white, #fff);
}
.zip-delivery-custom-list li.is-selected:hover {
	background: var(--site-color5, #2271b1);
	color: var(--site-white, #fff);
}
.zip-delivery-popup-submit {
	padding: 10px 18px;
	background: var(--wp-admin-theme-color, #2271b1);
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 1rem;
	cursor: pointer;
	transition: opacity 0.2s ease;
}
.zip-delivery-popup-submit:hover:not(:disabled) {
	opacity: 0.9;
}
.zip-delivery-popup-submit:disabled,
.zip-delivery-popup-submit.zip-delivery-popup-submit-loading {
	cursor: not-allowed;
	opacity: 0.7;
}
.zip-delivery-popup-message {
	min-height: 1.5em;
	font-size: 0.9rem;
}
.zip-delivery-popup-message.success { color: #00a32a; }
.zip-delivery-popup-message.error { color: #d63638; }
.zip-delivery-popup-message.loading { color: #555; }
.zip-delivery-spinner {
	display: inline-block;
	width: 1em;
	height: 1em;
	vertical-align: -0.15em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: zip-delivery-spin 0.6s linear infinite;
}


.zip-delivery-custom-list {scrollbar-color: #c2c0c0 #eeeeee;scrollbar-width: thin;-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;}
.zip-delivery-custom-list::-webkit-scrollbar{width:5px;}
.zip-delivery-custom-list::-webkit-scrollbar-track{background:#eeeeee;border-radius:0px;}
.zip-delivery-custom-list::-webkit-scrollbar-thumb{background-color: #c2c0c0; border-radius:0px;}


@keyframes zip-delivery-spin {
	to { transform: rotate(360deg); }
}
.screen-reader-text { clip: rect(1px, 1px, 1px, 1px); position: absolute; height: 1px; width: 1px; overflow: hidden; }

/* Header ZIP link - clickable to change ZIP */
.zip-delivery-open-popup {
	text-decoration: none;
	color: inherit;
	cursor: pointer;
}
.zip-delivery-open-popup:hover {
	text-decoration: underline;
}

/* Header delivery schedule link - hidden when empty */
.zip-delivery-schedule-header-empty {
	display: none;
}
.zip-delivery-schedule-header:not(.zip-delivery-schedule-header-empty) {
	display: inline;
}

/* Checkout Delivery Schedules box */
.zip-delivery-schedules-box { margin: 16px 0; padding: 12px 16px; border: 1px solid #ddd; border-radius: 6px; background: #f9f9f9; }
.zip-delivery-schedules-title { margin: 0 0 8px; font-size: 1rem; font-weight: 600; }
.zip-delivery-schedules-message { margin: 0; color: #666; font-size: 0.9rem; }
.zip-delivery-schedules-detail { margin: 0; font-size: 0.95rem; }
.zip-delivery-schedules-row td { vertical-align: top; border: none; padding-top: 12px; }
