/**
 * bzone-shipping-info: header strip + generic popup.
 *
 * Class names are frozen contracts (Task 8 renderer + Task 9 strip markup):
 * strip   — .bzone-shipping-strip / -from / -more
 *           PDP row: <li class="bzone-strip-slot-pdp"> (theme delivery list),
 *           same frozen inner classes + data-bzone-popup-* contracts
 * popup   — .bzone-popup-overlay / -box / -close / -content
 * loading — .bzone-popup-loading (CSS-only spinner)
 * table   — .bzone-shipping-table / -zone / -zone-header / -zone-countries /
 *           -zone-arrow / -zone-body / -free / -class / -class-name / -ranges /
 *           -table-empty (zone = native <details> accordion, no JS)
 *
 * No frameworks, no external fonts. Neutral gray palette, mobile-friendly.
 */

/*
 * Header strip: flat full-width bar, content flush to the container's right
 * edge, centered on mobile. Text/typography inherit the theme header style.
 */
.bzone-shipping-strip {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 8px;
	color: inherit;
	font-size: 1.4em;
	line-height: 1.5;
	padding-top: 15px;
}

.bzone-shipping-icon {
	flex: 0 0 auto;
}

.bzone-shipping-from {
	white-space: nowrap;
	font-weight: 600;
	color: #ba0f0c
}

.bzone-shipping-strip i {
	color: #ba0f0c
}

/* Trigger: plain underlined text, no box. Underline stays visible in every
 * state; only thickness changes on hover/focus. */
.bzone-shipping-more {
	margin: 0;
	padding: 0;
	font-size: inherit;
	color: inherit;
	background: none;
	border: 0;
	text-decoration: underline;
	cursor: pointer;
}

.bzone-shipping-more:hover,
.bzone-shipping-more:focus-visible {
	text-decoration-thickness: 2px;
}

.bzone-shipping-more:focus-visible {
	outline: 2px dotted currentColor;
	outline-offset: 3px;
}

/*
 * PDP delivery-row (`bzone-strip-slot-pdp`): HeaderStrip::renderRow() prints
 * a <li> inside the theme's `product-shipping-delivers` list (the doweco
 * child theme injects it; see the child shipping-info.php). Theme rules
 * (.content-info flex, icon 25px + 15px gap, li spacing) style the row —
 * only the brand colors stay pinned, scoped over the theme's darker
 * default icon/label colors (theme base selectors run up to 0,3,0, so the
 * rule needs the full ancestor chain to win deterministically on both
 * contexts the theme re-styles: single product and quickview preview).
 */
.single-product .bwp-single-info .product-shipping-delivers .bzone-strip-slot-pdp .bzone-shipping-icon,
.quickview-container .bwp-single-info .product-shipping-delivers .bzone-strip-slot-pdp .bzone-shipping-icon {
	color: #ba0f0c;
}

@media (max-width: 767px) {
	.bzone-shipping-strip {
		justify-content: center;
	}
}

/* Popup overlay + dialog box. Display is toggled from popup.js. */
.bzone-popup-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(15, 18, 24, .55);
}

.bzone-popup-box {
	width: 100%;
	max-width: 640px;
	max-height: 90vh;
	overflow: auto;
	color: #1f2430;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 12px 40px rgba(15, 18, 24, .25);
}

.bzone-popup-box > header {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: #fff;
	border-bottom: 1px solid #e3e6ea;
}

.bzone-popup-box > header > span {
	font-size: 16px;
	font-weight: 600;
}

.bzone-popup-close {
	margin: 0;
	padding: 0 8px;
	min-width: 32px;
	min-height: 32px;
	font-size: 20px;
	line-height: 1;
	color: #1f2430;
	background: transparent;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
}

.bzone-popup-close:hover,
.bzone-popup-close:focus-visible {
	background: #eef1f5;
	outline: none;
}

.bzone-popup-content {
	padding: 4px 16px 16px;
	font-size: 14px;
	overflow-x: auto;
}

/* Loading state: CSS-only spinner. */
.bzone-popup-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 32px 0;
	color: #6a7280;
}

.bzone-popup-loading::before {
	content: '';
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border: 3px solid #dfe3e9;
	border-top-color: #1f2430;
	border-radius: 50%;
	animation: bzone-popup-spin .8s linear infinite;
}

@keyframes bzone-popup-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Popup table: per-zone accordion built on native <details>/<summary> —
 * collapsed by default, no JavaScript involved. */
.bzone-shipping-table {
	font-size: 14px;
}

.bzone-shipping-zone {
	margin: 0 0 8px;
	border: 1px solid #e3e6ea;
}

.bzone-shipping-zone:last-child {
	margin-bottom: 0;
}

.bzone-shipping-zone-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 10px 12px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	color: #1b2430;
	background: transparent;
	cursor: pointer;
	list-style: none;
}

.bzone-shipping-zone-header::-webkit-details-marker {
	display: none;
}

.bzone-shipping-zone-header:hover {
	background: #f5f6f8;
}

.bzone-shipping-zone-header:focus-visible {
	background: #f5f6f8;
	outline: 2px dotted currentColor;
	outline-offset: -2px;
}

.bzone-shipping-zone-countries {
	min-width: 0;
}

/*
 * Down-chevron built from two borders: points down while collapsed,
 * rotates to point up when the zone is open. No icon font needed.
 */
.bzone-shipping-zone-arrow {
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	margin-left: 2px;
	border-right: 2px solid #1b2430;
	border-bottom: 2px solid #1b2430;
	transform: rotate(45deg);
	transition: transform .2s ease;
}

.bzone-shipping-zone[open] .bzone-shipping-zone-arrow {
	transform: rotate(-135deg);
}

.bzone-shipping-zone-body {
	padding: 2px 12px 12px;
}

.bzone-shipping-class {
	margin: 0 0 12px;
}

.bzone-shipping-class:last-child {
	margin-bottom: 0;
}

.bzone-shipping-class-name {
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 600;
	color: #1b2430;
}

.bzone-shipping-free {
	margin: 0 0 12px;
	font-size: 18px;
	font-weight: 600;
	text-align: center;
	color: #ba0f0c;
}

/* Free-delivery icon (Font Awesome fa-truck) before the label — CSS-only,
 * no template markup change. */
.bzone-shipping-free::before {
	content: '\f0d1';
	font-family: FontAwesome;
	font-style: normal;
	margin-right: 6px;
}

.bzone-shipping-ranges {
	width: 100%;
	border-collapse: collapse;
}

.bzone-shipping-ranges th,
.bzone-shipping-ranges td {
	padding: 8px 10px;
	text-align: left;
	border: 1px solid #e3e6ea;
}

.bzone-shipping-ranges thead th {
	font-size: 13px;
	font-weight: 600;
	background: #f5f6f8;
}

.bzone-shipping-ranges th:last-child,
.bzone-shipping-ranges td:last-child {
	text-align: right;
}

.bzone-shipping-table-empty {
	margin: 0;
	padding: 16px 0;
	color: #6a7280;
}

@media (prefers-reduced-motion: reduce) {
	.bzone-shipping-zone-arrow {
		transition: none;
	}
}

.bzone-shipping-strip.bzone-strip-slot-cart {
	justify-content: left;
}

.bzone-shipping-strip.bzone-strip-slot-minicart {
	justify-content: space-around;
}

