/* Dreem Custom Boxes — box builder */
.dreem-box {
	--dreem-accent: #1a1a1a;
	--dreem-accent-contrast: #ffffff;
	--dreem-border: #e6e2dc;
	--dreem-soft: #f7f5f2;
	--dreem-good: #2f7d4f;
	margin: 1.25em 0 2em;
	font-size: 15px;
}

.dreem-box__heading {
	margin: 0 0 0.25em;
}

.dreem-box__status {
	margin: 0 0 0.75em;
	color: #666;
}

.dreem-box__status.is-complete {
	color: var(--dreem-good);
	font-weight: 600;
}

/* Slots */
.dreem-box__slots {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.dreem-box__slot {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 2px dashed var(--dreem-border);
	background-color: var(--dreem-soft);
	background-size: cover;
	background-position: center;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.dreem-box__slot.is-filled {
	border-style: solid;
	border-color: var(--dreem-accent);
	animation: dreem-pop 0.25s ease;
}

@keyframes dreem-pop {
	0% { transform: scale(0.6); }
	70% { transform: scale(1.1); }
	100% { transform: scale(1); }
}

/* Progress bar */
.dreem-box__progress {
	height: 5px;
	border-radius: 3px;
	background: var(--dreem-soft);
	overflow: hidden;
	margin-bottom: 1.25em;
}

.dreem-box__progress-fill {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 3px;
	background: var(--dreem-accent);
	transition: width 0.3s ease, background-color 0.3s ease;
}

.dreem-box.is-complete .dreem-box__progress-fill {
	background: var(--dreem-good);
}

/* Grid of selectable items */
.dreem-box__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 14px;
	margin-bottom: 1.25em;
}

.dreem-box__item {
	position: relative;
	border: 1px solid var(--dreem-border);
	border-radius: 10px;
	padding: 10px;
	text-align: center;
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dreem-box__item:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

.dreem-box__item.is-selected {
	border-color: var(--dreem-accent);
	box-shadow: 0 0 0 1px var(--dreem-accent);
}

.dreem-box__item-media {
	position: relative;
	margin-bottom: 8px;
}

.dreem-box__item.is-oos {
	opacity: 0.55;
}

.dreem-box__item.is-oos .dreem-box__step {
	pointer-events: none;
	opacity: 0.35;
}

.dreem-box__item-oos {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	background: rgba(26, 26, 26, 0.85);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 12px;
	white-space: nowrap;
}

.dreem-box__item-media img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

.dreem-box__item-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 12px;
	background: var(--dreem-accent);
	color: var(--dreem-accent-contrast);
	font-size: 13px;
	font-weight: 700;
	line-height: 24px;
}

.dreem-box__item-name {
	display: block;
	font-weight: 600;
	line-height: 1.3;
	margin-bottom: 2px;
}

.dreem-box__item-price {
	display: block;
	color: #777;
	font-size: 0.9em;
	margin-bottom: 8px;
}

/* Stepper */
.dreem-box__stepper {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 6px;
}

.dreem-box__step {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid var(--dreem-border);
	background: #fff;
	color: inherit;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.dreem-box__step:hover:not(:disabled) {
	background: var(--dreem-accent);
	border-color: var(--dreem-accent);
	color: var(--dreem-accent-contrast);
}

.dreem-box__step:disabled {
	opacity: 0.35;
	cursor: default;
}

.dreem-box__qty {
	min-width: 20px;
	font-weight: 700;
	text-align: center;
}

/* Summary bar */
.dreem-box__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	border-top: 1px solid var(--dreem-border);
	padding-top: 1em;
}

.dreem-box__totals {
	display: flex;
	align-items: baseline;
	gap: 10px;
}

.dreem-box__total {
	font-size: 1.5em;
	font-weight: 700;
}

.dreem-box__was {
	color: #999;
}

.dreem-box__savings {
	color: var(--dreem-good);
	font-weight: 600;
	font-size: 0.95em;
}

.dreem-box__form {
	margin: 0 !important;
}

.dreem-box__add {
	min-width: 200px;
}

.dreem-box__add:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.dreem-box__add.is-added {
	background: var(--dreem-good) !important;
	border-color: var(--dreem-good) !important;
	color: #fff !important;
}

.dreem-box__error {
	width: 100%;
	color: #b32d2e;
	margin: 0.5em 0 0;
}

/* Sticky summary on small screens */
@media (max-width: 782px) {
	.dreem-box__grid {
		grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	}

	.dreem-box__summary {
		position: sticky;
		bottom: 0;
		z-index: 40;
		background: #fff;
		box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.08);
		padding: 12px;
		margin: 0 -12px;
	}

	.dreem-box__add {
		flex: 1;
		min-width: 0;
	}
}
