/* Zoran Bundles. Tokens: green = savings, blue = shipping, orange = actions. */
:root {
	--zb-primary: #2e7d32;
	--zb-primary-dark: #1b5e20;
	--zb-primary-light: #e8f5e9;
	--zb-ship-bg: #e3f2fd;
	--zb-ship-border: #b8dcf7;
	--zb-ship-text: #0d47a1;
	--zb-danger: #b42318;
	--zb-ink: #0f172a;
	--zb-muted: #4a5565;
	--zb-border: #e2e8f0;
	--zb-bg-soft: #f7fbfd;
	--zb-radius: 10px;
	--zb-radius-sm: 6px;
	--zb-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.06);
	--zb-shadow-hover: 0 4px 14px rgba(16, 24, 40, 0.10);
}

/* ===== ADMIN: product editor tab ===== */
.zb-admin-panel .zb-admin-section {
	padding: 16px 20px;
	border-bottom: 1px solid var(--zb-border);
}
.zb-admin-panel .zb-section-title label {
	font-weight: 600;
	font-size: 14px;
	color: var(--zb-ink);
}
.zb-notice {
	padding: 10px 14px;
	border-radius: var(--zb-radius-sm);
	font-size: 13px;
	margin: 0 0 12px;
}
.zb-notice--info {
	background: #eef6ff;
	border: 1px solid #bcdcff;
	color: #0b4a8f;
}
.zb-tier-link {
	margin: 4px 0 0;
}
.zb-tier-link a {
	font-size: 12px;
	text-decoration: none;
}
.zb-admin-option {
	background: #fff;
	border: 1px solid var(--zb-border);
	border-radius: var(--zb-radius);
	padding: 14px;
	margin-bottom: 14px;
	box-shadow: var(--zb-shadow);
}
.zb-admin-option-header {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}
.zb-admin-option-header .zb-option-label {
	flex: 1 1 240px;
	min-width: 180px;
}
.zb-inline-checkbox {
	font-size: 12px;
	color: var(--zb-muted);
	white-space: nowrap;
}
.zb-admin-option-row2 {
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--zb-bg-soft);
	border-radius: var(--zb-radius-sm);
	padding: 10px 12px;
	margin-bottom: 10px;
}
.zb-price-group,
.zb-shipping-group {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	flex-wrap: nowrap;
}
.zb-inline-label {
	font-weight: 600;
	color: var(--zb-muted);
	text-transform: uppercase;
	letter-spacing: 0.02em;
	font-size: 11px;
	white-space: nowrap;
	flex: 0 0 auto;
}
.zb-price-group select,
.zb-shipping-group select {
	flex: 0 0 auto;
	max-width: 180px;
}
.zb-price-group input,
.zb-shipping-group input {
	width: 90px;
	flex: 0 0 auto;
}
.zb-remove-link {
	cursor: pointer;
	color: var(--zb-danger);
	font-size: 12px;
	white-space: nowrap;
}
.zb-remove-link:hover {
	text-decoration: underline;
}
.zb-admin-component-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
	position: relative;
}
.zb-admin-component-row.zb-component-deleted {
	background: #fdecea;
	border-radius: var(--zb-radius-sm);
	padding-left: 6px;
}
.zb-component-search {
	flex: 1 1 auto;
	min-width: 220px;
}
.zb-component-qty {
	width: 70px;
}
.zb-component-variation.zb-component-variation-required {
	border-color: var(--zb-danger);
	box-shadow: 0 0 0 1px var(--zb-danger);
}
.zb-suggestions {
	background: #fff;
	border: 1px solid var(--zb-border);
	border-radius: var(--zb-radius-sm);
	list-style: none;
	margin: 0;
	padding: 4px 0;
	z-index: 999999;
	max-height: 240px;
	overflow: auto;
	box-shadow: var(--zb-shadow-hover);
	min-width: 260px;
}
.zb-suggestions li {
	cursor: pointer;
	padding: 6px 12px;
	font-size: 13px;
}
.zb-suggestions li:hover,
.zb-suggestions li.zb-suggestion-active {
	background: var(--zb-primary-light);
}
.zb-add-btn {
	margin-top: 6px;
}
.zb-configurable-settings-row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	background: var(--zb-bg-soft);
	border-radius: var(--zb-radius-sm);
	padding: 12px;
	margin-bottom: 14px;
}
.zb-cfg-field {
	margin: 0 !important;
}
.zb-cfg-field label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--zb-muted);
	margin-bottom: 4px;
}
.zb-cfg-shipping-field {
	display: flex;
	flex-direction: column;
}

/* ===== ADMIN: Bundle Settings ===== */
.zb-card {
	background: #fff;
	border: 1px solid var(--zb-border);
	border-radius: var(--zb-radius);
	box-shadow: var(--zb-shadow);
	padding: 20px 24px;
	margin-bottom: 20px;
	max-width: 760px;
}
.zb-card h2 {
	margin-top: 0;
}
.zb-tier-table {
	margin: 10px 0;
	border: 1px solid var(--zb-border);
}
.zb-tier-table th,
.zb-tier-table td {
	padding: 8px 10px;
}
.zb-zone-table {
	border-top: 1px solid var(--zb-border);
	padding-top: 12px;
	margin-top: 16px;
}
.zb-zone-table h3 {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	font-size: 14px;
	margin: 0 0 4px;
}
.zb-zone-free {
	font-size: 12px;
	font-weight: 400;
	color: var(--zb-muted);
}
.zb-extra-kg {
	margin: 10px 0 0;
}

/* ===== FRONTEND: product page (text 14px minimum) ===== */

/* "Buy more" panel (variable hosts) */
.zb-bundle-panel-variable {
	clear: both;
	margin: 24px 0 8px;
	padding: 16px;
	border: 1px solid #cfe9d1;
	border-radius: var(--zb-radius);
	background: var(--zb-primary-light);
}
.zb-bundle-panel-variable .zb-bundle-panel-title {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 12px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--zb-primary-dark);
}
.zb-bundle-panel-variable .zb-tiers-list {
	margin: 0 0 14px;
}
/* Toggle: not orange (reserved for Add to Cart / Buy Now) */
.zb-bundle-panel-variable .zb-bundle-panel-toggle,
.woocommerce-js .zb-bundle-panel-variable .zb-bundle-panel-toggle {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100% !important;
	min-height: 44px;
	margin: 0 !important;
	padding: 10px 16px !important;
	box-sizing: border-box;
	background: #fff !important;
	border: 1.5px solid var(--zb-primary) !important;
	border-radius: var(--zb-radius-sm) !important;
	color: var(--zb-primary-dark) !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	box-shadow: none !important;
	cursor: pointer;
}
.zb-bundle-panel-variable .zb-bundle-panel-toggle::after {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.2s ease;
}
.zb-bundle-panel-variable .zb-bundle-panel-toggle[aria-expanded="true"]::after {
	transform: translateY(2px) rotate(-135deg);
}
.zb-bundle-panel-variable .zb-bundle-panel-toggle:hover,
.zb-bundle-panel-variable .zb-bundle-panel-toggle:focus-visible {
	background: var(--zb-primary-light) !important;
	color: var(--zb-primary-dark) !important;
}
.zb-bundle-panel-variable .zb-bundle-panel-toggle:focus-visible {
	outline: 2px solid var(--zb-primary-dark);
	outline-offset: 2px;
}
.zb-bundle-panel-body {
	margin-top: 14px;
	padding: 14px;
	background: #fff;
	border: 1px solid #cfe9d1;
	border-radius: var(--zb-radius-sm);
}
.zb-bundle-panel-body[hidden] {
	display: none !important;
}

/* Free Shipping tag: outlined, to stand apart from the filled delivery box */
.zb-top-free-shipping-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	color: var(--zb-ship-text);
	border: 1.5px solid var(--zb-ship-text);
	border-radius: var(--zb-radius-sm);
	font-weight: 600;
	font-size: 14px;
	line-height: 1.2;
	padding: 5px 10px;
	margin: 2px 0 12px;
}
.zb-top-free-shipping-badge[hidden] {
	display: none !important;
}
.zb-top-free-shipping-icon {
	width: 17px;
	height: 17px;
	flex-shrink: 0;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Buttons: layout only (look from Astra and CSS-002) */
.zb-bundle-form .zb-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	clear: both;
}
.zb-bundle-form .zb-actions .single_add_to_cart_button {
	float: none;
}
.zoran-buy-now-wrap {
	flex: 0 0 100%;
	width: 100%;
	clear: both;
	margin-top: 10px;
}
.zoran-buy-now-wrap .zoran-buy-now-btn {
	float: none;
}
/* Cancel Astra's -1em offset (applied when quantity is hidden) */
.woocommerce-js .product .zb-bundle-form .button.single_add_to_cart_button,
.woocommerce-js .product .zoran-buy-now-wrap .button.single_add_to_cart_button {
	margin-left: 0 !important;
}

/* Incomplete Build-Your-Own pack: explained, not blocked silently */
.zb-configurable-error {
	margin: 0 0 12px;
	padding: 10px 14px;
	border-radius: var(--zb-radius-sm);
	background: #fef3f2;
	border: 1px solid #fecdca;
	color: var(--zb-danger);
	font-size: 15px;
	font-weight: 600;
}
.zb-configurable-error[hidden] {
	display: none !important;
}

.zb-tiers-table {
	background: linear-gradient(135deg, var(--zb-primary-light), #fff);
	border: 1px solid #cfe9d1;
	border-radius: var(--zb-radius);
	padding: 12px 16px;
	margin-bottom: 16px;
}
.zb-tiers-title {
	font-weight: 700;
	color: var(--zb-primary-dark);
	margin: 0 0 8px;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.zb-tiers-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.zb-tiers-list li {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	border: 1px solid #cfe9d1;
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 14px;
}
.zb-tier-buy {
	font-weight: 600;
	color: var(--zb-ink);
}
.zb-tier-arrow {
	color: var(--zb-muted);
}
.zb-tier-save {
	font-weight: 700;
	color: var(--zb-primary-dark);
}

.zb-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 16px;
}
.zb-option {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	border: 2px solid var(--zb-border);
	border-radius: var(--zb-radius);
	padding: 14px 16px;
	cursor: pointer;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.zb-option:hover {
	border-color: #b9dcbb;
	box-shadow: var(--zb-shadow-hover);
}
.zb-option:has(input:checked),
.zb-option.zb-option--selected {
	border-color: var(--zb-primary);
	background: var(--zb-primary-light);
	box-shadow: 0 0 0 1px var(--zb-primary);
}
.zb-option.zb-option--out {
	cursor: not-allowed;
	opacity: 0.6;
}
.zb-option.zb-option--out:hover {
	border-color: var(--zb-border);
	box-shadow: none;
}
.zb-option input[type="radio"] {
	margin-top: 4px;
	width: 20px;
	height: 20px;
	accent-color: var(--zb-primary);
	flex-shrink: 0;
}
.zb-option-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.zb-option-label {
	font-weight: 700;
	font-size: 16px;
	color: var(--zb-ink);
}
.zb-option-includes {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.zb-component-thumbs {
	display: flex;
	gap: 4px;
	flex-shrink: 0;
}
.zb-component-thumb {
	/* Size is set inline */
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid var(--zb-border);
	max-width: 100%;
}
@media (max-width: 480px) {
	/* !important overrides each image's inline size on small phones. */
	.zb-component-thumb {
		width: 40px !important;
		height: 40px !important;
	}
}
.zb-option-includes-text {
	font-size: 14px;
	color: var(--zb-muted);
}
.zb-option-side {
	flex: 0 0 auto;
	text-align: right;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	min-width: 130px;
}
.zb-option-price {
	font-size: 18px;
	font-weight: 700;
	color: var(--zb-ink);
}
.zb-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 999px;
	padding: 3px 10px;
	white-space: nowrap;
}
.zb-badge--free,
.zb-badge--shipping {
	gap: 6px;
	background: #fff;
	color: var(--zb-ship-text);
	border: 1.5px solid var(--zb-ship-text);
	border-radius: var(--zb-radius-sm);
	padding: 4px 9px;
	line-height: 1.2;
}
.zb-badge-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.zb-badge--out {
	background: #fdecea;
	color: var(--zb-danger);
}
.zb-savings-breakdown {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
	font-size: 14px;
	color: var(--zb-muted);
}
.zb-savings-total {
	font-weight: 700;
	color: var(--zb-primary-dark);
}
.zb-unavailable {
	color: var(--zb-danger);
	font-style: italic;
}

/* Phones: name and price on one row, everything else full width below */
@media (max-width: 544px) {
	.zb-bundle-panel-variable { padding: 12px; }
	.zb-bundle-panel-body {
		padding: 0;
		border: 0;
		background: transparent;
	}
	.zb-option {
		display: grid;
		grid-template-columns: 20px minmax(0, 1fr) auto;
		grid-template-areas:
			"radio label price"
			".     includes includes"
			".     badge badge"
			".     savings savings";
		column-gap: 10px;
		row-gap: 8px;
		padding: 12px;
	}
	.zb-option-main,
	.zb-option-side { display: contents; }
	.zb-option input[type="radio"] { grid-area: radio; margin-top: 2px; }
	.zb-option-label { grid-area: label; line-height: 1.35; }
	.zb-option-price { grid-area: price; white-space: nowrap; text-align: right; }
	.zb-option-includes { grid-area: includes; }
	.zb-option .zb-badge { grid-area: badge; justify-self: start; }
	.zb-option .zb-savings-breakdown { grid-area: savings; align-items: flex-start; text-align: left; }
}

/* ===== FRONTEND: Build-Your-Own Pack ===== */
.zb-configurable-rule {
	font-weight: 600;
	font-size: 16px;
	color: var(--zb-ink);
	margin-bottom: 10px;
}
.zb-configurable-items {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
}
.zb-configurable-item {
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	grid-template-areas: "thumb name price stepper";
	align-items: center;
	gap: 8px 12px;
	border: 1px solid var(--zb-border);
	border-radius: var(--zb-radius-sm);
	padding: 8px 12px;
	background: #fff;
}
.zb-configurable-item--out {
	opacity: 0.55;
}
/* Single-item pack: plain quantity row */
.zb-configurable-item.zb-configurable-item--single {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 16px;
	border: 0;
	padding: 0;
	background: transparent;
}
.zb-configurable-item--single .zb-configurable-item-name {
	font-size: 16px;
	font-weight: 600;
}
.zb-configurable-item--single .zb-configurable-item-stepper {
	margin: 0;
}
.zb-configurable-item-thumb { grid-area: thumb; }
.zb-configurable-item-name { grid-area: name; font-weight: 600; font-size: 15px; min-width: 0; color: var(--zb-ink); }
.zb-configurable-item-price { grid-area: price; color: var(--zb-muted); font-size: 15px; text-align: right; white-space: nowrap; }
.zb-configurable-item-stepper { grid-area: stepper; display: flex; align-items: center; gap: 6px; }
@media (max-width: 480px) {
	/* The stepper drops to its own row so "+" never runs off-screen. */
	.zb-configurable-item {
		grid-template-columns: auto 1fr auto;
		grid-template-areas:
			"thumb name price"
			"stepper stepper stepper";
	}
	.zb-configurable-item-stepper {
		justify-content: flex-end;
		margin-top: 4px;
	}
}

/* Stepper: neutral; resets Astra's global button style */
.zb-configurable-item-stepper .zb-qty-decrease,
.zb-configurable-item-stepper .zb-qty-increase,
.woocommerce-js .zb-configurable-item-stepper .zb-qty-decrease,
.woocommerce-js .zb-configurable-item-stepper .zb-qty-increase {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box !important;
	width: 40px !important;
	min-width: 40px !important;
	max-width: 40px !important;
	height: 40px !important;
	min-height: 40px !important;
	padding: 0 !important;
	margin: 0 !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	flex: 0 0 40px;
	border: 1px solid #cbd5e1 !important;
	border-radius: var(--zb-radius-sm) !important;
	background: #fff !important;
	color: var(--zb-ink) !important;
	font-family: Arial, Helvetica, sans-serif !important;
	font-size: 20px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	box-shadow: none !important;
	cursor: pointer;
}
.zb-configurable-item-stepper .zb-qty-decrease:hover,
.zb-configurable-item-stepper .zb-qty-increase:hover {
	background: var(--zb-bg-soft) !important;
	border-color: var(--zb-ink) !important;
}
.zb-configurable-item-stepper .zb-qty-decrease:focus-visible,
.zb-configurable-item-stepper .zb-qty-increase:focus-visible {
	outline: 2px solid var(--zb-ink);
	outline-offset: 1px;
}
.zb-configurable-item-stepper .zb-qty-decrease[disabled],
.zb-configurable-item-stepper .zb-qty-increase[disabled] {
	cursor: not-allowed;
	background: var(--zb-border) !important;
	color: var(--zb-muted) !important;
}
.zb-configurable-item-stepper .zb-qty-input {
	-moz-appearance: textfield;
	appearance: textfield;
	box-sizing: border-box !important;
	width: 48px !important;
	min-width: 48px !important;
	height: 40px !important;
	min-height: 40px !important;
	margin: 0 !important;
	padding: 0 2px !important;
	text-align: center;
	font-size: 16px !important;
	font-weight: 600;
	font-family: Arial, Helvetica, sans-serif;
	border: 1px solid #cbd5e1;
	border-radius: var(--zb-radius-sm);
}
.zb-qty-input::-webkit-outer-spin-button,
.zb-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
/* Phones: compact stepper (same size as UX-001's) */
@media (max-width: 544px) {
	.zb-configurable-item-stepper { gap: 4px; }
	.zb-configurable-item-stepper .zb-qty-decrease,
	.zb-configurable-item-stepper .zb-qty-increase,
	.woocommerce-js .zb-configurable-item-stepper .zb-qty-decrease,
	.woocommerce-js .zb-configurable-item-stepper .zb-qty-increase {
		width: 36px !important;
		min-width: 36px !important;
		max-width: 36px !important;
		height: 36px !important;
		min-height: 36px !important;
		flex: 0 0 36px;
		font-size: 18px !important;
	}
	.zb-configurable-item-stepper .zb-qty-input {
		width: 40px !important;
		min-width: 40px !important;
		height: 36px !important;
		min-height: 36px !important;
	}
}
.zb-configurable-summary {
	background: var(--zb-bg-soft);
	border-radius: var(--zb-radius-sm);
	padding: 10px 14px;
	font-size: 15px;
	color: var(--zb-ink);
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}
.zb-configurable-summary[hidden] {
	display: none !important;
}
.zb-summary-separator {
	color: var(--zb-muted);
}
.zb-summary-shipping-part {
	font-weight: 700;
	color: var(--zb-ship-text);
}

/* ===== Cart, checkout, order ===== */
.zb-shipping-notice {
	border-radius: var(--zb-radius);
	padding: 12px 16px;
	margin-bottom: 16px;
	font-size: 15px;
}
.zb-shipping-notice--free,
.zb-shipping-notice--partial {
	background: var(--zb-ship-bg);
	border: 1px solid var(--zb-ship-border);
	color: var(--zb-ship-text);
}
.zb-order-item-thumbs {
	display: flex;
	gap: 4px;
	margin-bottom: 4px;
}
.zb-order-item-thumbs img {
	border-radius: 6px;
	border: 1px solid var(--zb-border);
}

/* Admin builder: WooCommerce floats panel labels off-screen; keep ours inline and visible. */
#woocommerce-product-data .zb-admin-option label.zb-inline-label,
#woocommerce-product-data .zb-admin-option label.zb-inline-checkbox,
#woocommerce-product-data .zb-configurable-settings-row label.zb-inline-label {
	float: none;
	width: auto;
	min-width: 64px;
	margin: 0 8px 0 0;
	padding: 0;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	white-space: nowrap;
}
