/* Delivery coverage / charges shortcode + legacy/CZS visibility
 *
 * Visual styles matched to Porto .delivery-coverage-tabs on the live page.
 * Accent: #d4af7f | Header: #9f8f84 | Radius: 10px
 */

body.czs-delivery-mode-legacy #czs-delivery-czs {
	display: none !important;
}

body.czs-delivery-mode-czs #czs-delivery-legacy,
body.czs-delivery-mode-czs .delivery-coverage-tabs,
body.czs-delivery-mode-czs .wpb_text_column:has(a[href="#delivery-coverage-area-and-charges"]),
body.czs-delivery-mode-czs .wpb_raw_code:has(#czs-delivery-legacy) {
	display: none !important;
}

body.czs-delivery-mode-compare .delivery-coverage-tabs::before {
	content: "Current page (WPBakery)";
	display: block;
	font-weight: 600;
	margin: 0 0 0.75rem;
	color: #333;
}

.czs-delivery-charges {
	--czs-accent: #d4af7f;
	--czs-header: #9f8f84;
	--czs-border: #e7e7e7;
	--czs-tab-bg: #f4f4f4;
	--czs-radius: 10px;
	--czs-text: #444444;
	margin: 1rem 0 2rem;
	color: var(--czs-text);
	font-size: 15px;
	line-height: 1.45;
}

.czs-delivery-compare-label {
	font-weight: 600;
	margin: 0 0 0.75rem;
	color: #333;
}

/* —— Search (UI only; tables stay fully in HTML for SEO) —— */
.czs-delivery-search {
	margin: 0 0 1rem;
	width: max-content;
	max-width: 100%;
	box-sizing: border-box;
	overflow: visible;
}

.czs-delivery-search-label {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: #444;
	margin: 0 0 0.35rem;
}

.czs-delivery-search-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: max-content;
	max-width: 100%;
	box-sizing: border-box;
	overflow: visible;
}

.czs-delivery-search-field {
	position: relative;
	flex: 0 0 auto;
	width: calc(var(--czs-search-ch, 28) * 1ch + 1.7rem);
	max-width: 100%;
	box-sizing: border-box;
	/* Room so iOS does not clip the gold focus ring */
	padding: 3px;
	margin: -3px;
	overflow: visible;
}

.czs-delivery-search-input {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--czs-border);
	border-radius: var(--czs-radius);
	padding: 0.65rem 2.4rem 0.65rem 0.85rem;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	color: var(--czs-text);
	background: #fff;
	line-height: 1.4;
	-webkit-appearance: none;
	appearance: none;
	-webkit-text-size-adjust: 100%;
	touch-action: manipulation;
}

.czs-delivery-search-input:focus {
	/* box-shadow instead of outline — outline is clipped on iOS overflow parents */
	outline: none;
	border-color: var(--czs-accent);
	box-shadow: 0 0 0 2px var(--czs-accent);
}

.czs-delivery-search-clear {
	position: absolute;
	top: 50%;
	right: 0.35rem;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: #888;
	font-size: 1.35rem;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.czs-delivery-search-clear:hover,
.czs-delivery-search-clear:focus-visible {
	color: #444;
	background: #f0f0f0;
	outline: none;
}

.czs-delivery-search-clear[hidden] {
	display: none !important;
}

.czs-delivery-search-count {
	flex: 0 0 auto;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: #666;
	line-height: 1.3;
	white-space: nowrap;
}

.czs-delivery-search-hint {
	margin: 0.55rem 0 0;
	font-size: 13px;
	font-weight: 500;
	color: #666;
	line-height: 1.45;
	white-space: nowrap;
}

.czs-delivery-search-hint a {
	color: var(--czs-accent);
	font-weight: 700;
	text-decoration: underline;
}

.czs-delivery-search-hint a:hover,
.czs-delivery-search-hint a:focus {
	color: #b8956a;
}

/*
 * Same iOS Safari lock as checkout (checkout.css):
 * auto-zoom only happens when focused inputs are under 16px.
 */
@media screen and (max-width: 1024px), (hover: none) and (pointer: coarse) {
	#czs-delivery-czs .czs-delivery-search-input {
		font-size: 16px !important;
		line-height: 1.4 !important;
		-webkit-text-size-adjust: 100%;
		touch-action: manipulation;
	}
}

@media screen and (max-width: 480px) {
	.czs-delivery-search {
		width: 100%;
		overflow: visible;
	}

	.czs-delivery-search-row {
		flex-wrap: wrap;
		align-items: flex-start;
		width: 100%;
	}

	.czs-delivery-search-field {
		width: 100%;
		max-width: 100%;
	}

	.czs-delivery-search-input {
		width: 100%;
	}

	.czs-delivery-search-count {
		white-space: normal;
	}

	.czs-delivery-search-hint {
		white-space: normal;
	}
}

.czs-delivery-search-empty {
	margin: 0.5rem 0 0;
	font-size: 14px;
	font-weight: 600;
	color: #a94442;
}

/* —— Tabs (match Porto nav-tabs) —— */
.czs-delivery-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	/* No full-width bottom rule — it stuck out past the rounded panel corner */
	border-bottom: none;
	margin: 0 0 0;
	padding: 0;
	position: relative;
	z-index: 2;
}

.czs-delivery-tab {
	appearance: none;
	background: var(--czs-tab-bg);
	border: 1px solid var(--czs-border);
	border-top: 3px solid var(--czs-border);
	border-bottom: 1px solid var(--czs-border);
	border-radius: var(--czs-radius) var(--czs-radius) 0 0;
	color: var(--czs-accent);
	cursor: pointer;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 1px -1px 0;
	padding: 0.55rem 1.05rem;
	position: relative;
	z-index: 0;
	transition: background-color 0.2s ease, border-top-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.czs-delivery-tab:hover {
	background: #fff;
	border-top-color: var(--czs-accent);
	color: var(--czs-accent);
}

.czs-delivery-tab.is-active {
	background: #fff;
	border-top-color: var(--czs-accent);
	border-left-color: var(--czs-border);
	border-right-color: var(--czs-border);
	border-bottom-color: #fff;
	color: var(--czs-accent);
	font-weight: 700;
	z-index: 3;
}

.czs-delivery-tab:focus-visible {
	outline: 2px solid var(--czs-accent);
	outline-offset: 2px;
}

/* —— Panel (match Porto .tab-content) —— */
.czs-delivery-panels {
	position: relative;
	transition: min-height 0.28s ease;
}

.czs-delivery-panel {
	display: none;
	background: #fff;
	border: 1px solid var(--czs-border);
	/* Top-left flush under tabs; other corners rounded */
	border-radius: 0 var(--czs-radius) var(--czs-radius) var(--czs-radius);
	padding: 0;
	overflow: hidden;
	opacity: 0;
	transform: translateY(6px);
}

.czs-delivery-panel.is-active {
	display: block;
	position: relative;
	z-index: 1;
	opacity: 1;
	transform: translateY(0);
	animation: czs-delivery-panel-in 0.28s ease both;
}

/* Overlay while exiting so height does not stack (was expanding page on mobile search). */
.czs-delivery-panel.is-exiting {
	display: block;
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	width: 100%;
	z-index: 0;
	animation: czs-delivery-panel-out 0.18s ease both;
	pointer-events: none;
}

/* When search leaves only a few tabs, round the full panel box */
.czs-delivery-charges.is-searching .czs-delivery-panel.is-active {
	animation: none;
	border-top: 1px solid var(--czs-border);
	border-radius: var(--czs-radius);
}

@keyframes czs-delivery-panel-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes czs-delivery-panel-out {
	from {
		opacity: 1;
		transform: translateY(0);
	}
	to {
		opacity: 0;
		transform: translateY(4px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.czs-delivery-tab {
		transition: none;
	}

	.czs-delivery-panel.is-active,
	.czs-delivery-panel.is-exiting {
		animation: none;
		opacity: 1;
		transform: none;
	}
}

/* —— Table —— */
.czs-delivery-table-wrap {
	/* No own border — panel already draws the outer edge (avoids excess corner line) */
	overflow: hidden;
	border: none;
	border-radius: 0;
	background: #fff;
}

.czs-delivery-table {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	max-width: 100%;
	margin: 0;
}

.czs-delivery-table th,
.czs-delivery-table td {
	border: none;
	border-bottom: 1px solid var(--czs-border);
	border-right: 1px solid var(--czs-border);
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
	color: var(--czs-text);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.45;
}

.czs-delivery-table th:last-child,
.czs-delivery-table td:last-child {
	border-right: none;
}

.czs-delivery-table tbody tr:last-child td {
	border-bottom: none;
}

.czs-delivery-table thead th {
	background: var(--czs-header);
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	border-bottom-color: var(--czs-header);
}

.czs-delivery-table thead th:last-child {
	border-top-right-radius: var(--czs-radius);
}

.czs-delivery-table tbody tr:last-child td:first-child {
	border-bottom-left-radius: var(--czs-radius);
}

.czs-delivery-table tbody tr:last-child td:last-child {
	border-bottom-right-radius: var(--czs-radius);
}

.czs-delivery-charges.is-searching .czs-delivery-table thead th:first-child {
	border-top-left-radius: var(--czs-radius);
}

.czs-delivery-table tbody td {
	background: #f7f7f7;
}

.czs-delivery-table tbody tr:nth-child(even) td {
	background: #fff;
}

.czs-delivery-table tbody tr[hidden] {
	display: none;
}

.czs-delivery-state-notice {
	margin: 0.75rem 12px 12px;
	font-size: 13px;
	font-style: italic;
	font-weight: 500;
	color: #666;
	line-height: 1.45;
}

@media (max-width: 600px) {
	.czs-delivery-tab {
		font-size: 13px;
		padding: 0.45rem 0.7rem;
	}

	.czs-delivery-table th,
	.czs-delivery-table td {
		font-size: 14px;
		padding: 8px 10px;
	}
}
