/* Custom Packet Builder — wizard styles */

.cpb-wizard {
	--cpb-accent: #7a9d54;
	--cpb-accent-dark: #5c7a3d;
	--cpb-border: #e2ddd3;
	--cpb-bg: #faf8f4;
	--cpb-text: #2f2a22;
	--cpb-radius: 10px;
	max-width: 760px;
	margin: 24px 0;
	font-size: 15px;
	color: var(--cpb-text);
}

/* Some themes/WooCommerce styles apply "display: ... !important" to .button,
   which overrides the browser's native [hidden] behaviour. Force it here so
   step navigation buttons actually hide when they should. */
.cpb-wizard [hidden] {
	display: none !important;
}

.cpb-intro {
	margin-bottom: 16px;
	color: #6b6558;
}

/* Progress bar */
.cpb-progress {
	display: flex;
	justify-content: space-between;
	margin-bottom: 24px;
	position: relative;
}

.cpb-progress::before {
	content: "";
	position: absolute;
	top: 16px;
	left: 5%;
	right: 5%;
	height: 2px;
	background: var(--cpb-border);
	z-index: 0;
}

.cpb-progress-step {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
	text-align: center;
	opacity: 0.55;
}

.cpb-progress-step.is-active,
.cpb-progress-step.is-complete {
	opacity: 1;
}

.cpb-progress-number {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--cpb-border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	margin-bottom: 6px;
}

.cpb-progress-step.is-active .cpb-progress-number {
	border-color: var(--cpb-accent);
	color: var(--cpb-accent);
}

.cpb-progress-step.is-complete .cpb-progress-number {
	background: var(--cpb-accent);
	border-color: var(--cpb-accent);
	color: #fff;
}

.cpb-progress-label {
	font-size: 12px;
	line-height: 1.3;
}

/* Steps */
.cpb-step {
	display: none;
}

.cpb-step.is-active {
	display: block;
}

.cpb-notice {
	padding: 10px 14px;
	border-radius: var(--cpb-radius);
	margin-bottom: 14px;
}

.cpb-notice--error {
	background: #fdeceb;
	color: #a33;
	border: 1px solid #f3c6c2;
}

.cpb-step-selected-count {
	font-weight: 600;
	margin-bottom: 8px;
}

.cpb-search {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--cpb-border);
	border-radius: var(--cpb-radius);
	margin-bottom: 14px;
	box-sizing: border-box;
}

.cpb-loading {
	padding: 24px;
	text-align: center;
	color: #999;
}

/* Product grid (step 1) */
.cpb-product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px;
}

.cpb-product-card {
	border: 2px solid var(--cpb-border);
	border-radius: var(--cpb-radius);
	padding: 10px;
	text-align: center;
	cursor: pointer;
	background: #fff;
	transition: border-color 0.15s ease, transform 0.1s ease;
	position: relative;
}

.cpb-product-card:hover {
	border-color: var(--cpb-accent);
}

.cpb-product-card.is-selected {
	border-color: var(--cpb-accent);
	background: #f2f7ec;
}

.cpb-product-card.is-disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.cpb-product-card img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: 8px;
	background: #f1efe9;
}

.cpb-product-card .cpb-product-name {
	font-weight: 600;
	font-size: 13px;
	line-height: 1.3;
	display: block;
}

.cpb-product-card .cpb-product-price {
	font-size: 12px;
	color: #8a8373;
	display: block;
	margin-top: 2px;
}

.cpb-product-card .cpb-check {
	position: absolute;
	top: 6px;
	inset-inline-end: 6px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--cpb-accent);
	color: #fff;
	font-size: 12px;
	display: none;
	align-items: center;
	justify-content: center;
}

.cpb-product-card.is-selected .cpb-check {
	display: flex;
}

/* Weight selection (step 2) */
.cpb-weight-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--cpb-border);
}

.cpb-weight-item img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
	background: #f1efe9;
}

.cpb-weight-item .cpb-weight-info {
	flex: 1;
	min-width: 140px;
}

.cpb-weight-item .cpb-weight-name {
	font-weight: 600;
	display: block;
}

.cpb-weight-options {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.cpb-weight-pill {
	border: 1px solid var(--cpb-border);
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 13px;
	cursor: pointer;
	background: #fff;
	user-select: none;
}

.cpb-weight-pill.is-selected {
	background: var(--cpb-accent);
	border-color: var(--cpb-accent);
	color: #fff;
}

.cpb-weight-item .cpb-line-price {
	min-width: 70px;
	text-align: end;
	font-weight: 600;
}

/* Review table (step 3) */
.cpb-review-table {
	width: 100%;
	border-collapse: collapse;
}

.cpb-review-table td {
	padding: 8px 6px;
	border-bottom: 1px solid var(--cpb-border);
}

.cpb-review-table tfoot td {
	border-top: 2px solid var(--cpb-text);
	border-bottom: none;
	font-weight: 700;
	padding-top: 12px;
}

.cpb-review-table .cpb-review-price {
	text-align: end;
	white-space: nowrap;
}

/* Nav buttons */
.cpb-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 20px;
	gap: 10px;
}

.cpb-nav .button {
	min-width: 110px;
}

.cpb-btn-next,
.cpb-btn-add-to-cart {
	margin-inline-start: auto;
}

.cpb-success {
	margin-top: 16px;
	padding: 14px;
	border-radius: var(--cpb-radius);
	background: #eef6e8;
	border: 1px solid #cfe6bc;
}

.cpb-success a.button {
	margin-inline-start: 10px;
}
