/* Seemleius — household volume calculator */

.sm-vol {
	--vol-border: #D8DBE6;
	--vol-navy: #1A3A6B;
	--vol-green: #7BC144;
	--vol-green-dark: #6BAB39;
	--vol-muted: #5F6479;
	font-family: inherit;
}

/* Search */
.sm-vol__search {
	position: relative;
}
.sm-vol__search-label {
	display: block;
	font-family: var(--sm-font-display, system-ui);
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--vol-navy);
	margin-bottom: 0.4rem;
}
.sm-vol__input {
	width: 100%;
	padding: 0.8rem 1rem;
	font-size: 1rem;
	border: 1px solid var(--vol-border);
	border-radius: 10px;
	background: #fff;
	color: #1a1a1a;
	font-family: inherit;
}
.sm-vol__input:focus {
	outline: none;
	border-color: var(--vol-green);
	box-shadow: 0 0 0 3px rgba(123, 193, 68, 0.25);
}
.sm-vol__results {
	position: absolute;
	z-index: 30;
	left: 0;
	right: 0;
	top: calc(100% + 4px);
	margin: 0;
	padding: 4px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--vol-border);
	border-radius: 10px;
	box-shadow: 0 14px 32px rgba(11, 12, 35, 0.16);
	/* ~4.5 rows visible, the rest scrolls */
	max-height: 232px;
	overflow-y: auto;
}
.sm-vol__results[hidden] { display: none; }
.sm-vol__result {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	padding: 0.6rem 0.7rem;
	border-radius: 7px;
	cursor: pointer;
}
.sm-vol__result:hover,
.sm-vol__result.is-active {
	background: var(--sm-green-tint, #EFF8E6);
}
.sm-vol__result-name {
	font-weight: 600;
	color: var(--vol-navy);
	flex: 1;
}
.sm-vol__result-room {
	font-size: 0.78rem;
	color: var(--vol-muted);
	white-space: nowrap;
}
.sm-vol__result-cbm {
	font-size: 0.78rem;
	color: var(--vol-green-dark);
	font-weight: 600;
	white-space: nowrap;
}
.sm-vol__result--none {
	color: var(--vol-muted);
	cursor: default;
}
.sm-vol__result--none:hover { background: transparent; }

/* Added items */
.sm-vol__list {
	margin-top: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.sm-vol__empty {
	margin-top: 1rem;
	padding: 1.25rem;
	text-align: center;
	color: var(--vol-muted);
	font-size: 0.9rem;
	background: var(--sm-navy-tint, #E9EFF7);
	border-radius: 10px;
}
.sm-vol__empty[hidden] { display: none; }
.sm-vol__item {
	display: grid;
	grid-template-columns: 1fr auto auto auto;
	align-items: center;
	gap: 0.75rem;
	padding: 0.6rem 0.75rem;
	background: #fff;
	border: 1px solid var(--vol-border);
	border-radius: 9px;
}
.sm-vol__item-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.sm-vol__item-name {
	font-weight: 600;
	color: var(--vol-navy);
	font-size: 0.9375rem;
}
.sm-vol__item-room {
	font-size: 0.75rem;
	color: var(--vol-muted);
}
.sm-vol__stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--vol-border);
	border-radius: 999px;
	overflow: hidden;
}
.sm-vol__step {
	width: 2rem;
	height: 2rem;
	border: none;
	background: #fff;
	color: var(--vol-navy);
	font-size: 1.1rem;
	font-weight: 700;
	cursor: pointer;
	line-height: 1;
}
.sm-vol__step:hover { background: var(--sm-green-tint, #EFF8E6); }
.sm-vol__qty {
	min-width: 2rem;
	text-align: center;
	font-weight: 700;
	color: var(--vol-navy);
	font-size: 0.95rem;
}
.sm-vol__item-vol {
	font-size: 0.8rem;
	color: var(--vol-muted);
	white-space: nowrap;
	min-width: 4.5rem;
	text-align: right;
}
.sm-vol__remove {
	width: 1.9rem;
	height: 1.9rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: transparent;
	color: var(--vol-muted);
	cursor: pointer;
	border-radius: 50%;
}
.sm-vol__remove:hover { background: #FBE9E7; color: #C0392B; }

/* Total bar */
.sm-vol__totalbar {
	margin-top: 1.1rem;
	padding: 1rem 1.2rem;
	background: var(--vol-navy);
	color: #fff;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}
.sm-vol__totalbar[hidden] { display: none; }
.sm-vol__total {
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
}
.sm-vol__total-cbm {
	font-family: var(--sm-font-display, system-ui);
	font-size: 2rem;
	font-weight: 800;
	color: var(--vol-green);
	line-height: 1;
}
.sm-vol__total-unit {
	font-size: 1.1rem;
	font-weight: 700;
	color: #fff;
}
.sm-vol__total-cbft {
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.7);
}
.sm-vol__container {
	font-size: 0.875rem;
	color: rgba(255, 255, 255, 0.92);
	font-weight: 600;
	text-align: right;
	max-width: 18rem;
}

/* Skip */
.sm-vol__skip {
	margin-top: 0.85rem;
	width: 100%;
	padding: 0.7rem;
	background: transparent;
	border: 1px dashed var(--vol-border);
	border-radius: 9px;
	color: var(--vol-muted);
	font-size: 0.875rem;
	cursor: pointer;
	font-family: inherit;
}
.sm-vol__skip:hover { border-color: var(--vol-navy); color: var(--vol-navy); }
.sm-vol__skip.is-on {
	border-style: solid;
	border-color: var(--vol-green);
	background: var(--sm-green-tint, #EFF8E6);
	color: var(--vol-green-dark);
	font-weight: 600;
}

@media (max-width: 560px) {
	.sm-vol__item {
		grid-template-columns: 1fr auto;
		grid-template-areas: 'info remove' 'stepper vol';
		row-gap: 0.5rem;
	}
	.sm-vol__item-info { grid-area: info; }
	.sm-vol__remove   { grid-area: remove; }
	.sm-vol__stepper  { grid-area: stepper; }
	.sm-vol__item-vol { grid-area: vol; }
}

/* ===================== Packing boxes ===================== */
.sm-vol__boxes {
	margin: 0 0 1.25rem;
	padding: 0.85rem 1rem 1rem;
	background: #F8F9FC;
	border: 1px solid var(--vol-border);
	border-radius: 12px;
}
.sm-vol__section-title {
	font-family: var(--sm-font-display, system-ui);
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--vol-navy);
	margin-bottom: 0.65rem;
}
.sm-vol__box {
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	align-items: center;
	gap: 0.7rem;
	padding: 0.5rem 0.2rem;
	border-top: 1px solid var(--vol-border);
	cursor: pointer;
	font-size: 0.95rem;
}
.sm-vol__box:first-of-type {
	border-top: 0;
}
.sm-vol__box-check {
	width: 18px;
	height: 18px;
	accent-color: var(--vol-green);
	flex-shrink: 0;
	cursor: pointer;
}
.sm-vol__box-name {
	color: #1a1a1a;
}
.sm-vol__box-cbm {
	font-size: 0.8125rem;
	color: var(--vol-muted);
	font-variant-numeric: tabular-nums;
	min-width: 4rem;
	text-align: right;
}
.sm-vol__stepper--box[data-state="off"] {
	opacity: 0.5;
}

/* ===================== Custom item adder ===================== */
.sm-vol__custom {
	margin: 0 0 1rem;
	padding: 0.65rem 0.85rem;
	background: #FFFBF1;
	border: 1px dashed #E8DBB5;
	border-radius: 10px;
}
.sm-vol__custom > summary {
	font-family: var(--sm-font-display, system-ui);
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--vol-navy);
	cursor: pointer;
	list-style: none;
}
.sm-vol__custom > summary::-webkit-details-marker { display: none; }
.sm-vol__custom > summary::before {
	content: "+";
	display: inline-block;
	width: 1.2em;
	text-align: center;
	margin-right: 0.35rem;
	color: var(--vol-green-dark);
	font-weight: 800;
}
.sm-vol__custom[open] > summary::before {
	content: "−";
}
.sm-vol__custom-row {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
	gap: 0.5rem;
	margin-top: 0.7rem;
}
.sm-vol__custom-name,
.sm-vol__custom-size {
	padding: 0.6rem 0.75rem;
	font-size: 0.9rem;
	border: 1px solid var(--vol-border);
	border-radius: 8px;
	background: #fff;
	color: #1a1a1a;
	font-family: inherit;
}
.sm-vol__custom-name:focus,
.sm-vol__custom-size:focus {
	outline: none;
	border-color: var(--vol-green);
	box-shadow: 0 0 0 3px rgba(123, 193, 68, 0.20);
}
.sm-vol__custom-add {
	padding: 0 1.1rem;
	font-family: var(--sm-font-display, system-ui);
	font-weight: 600;
	font-size: 0.875rem;
	color: #fff;
	background: var(--vol-green);
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}
.sm-vol__custom-add:hover {
	background: var(--vol-green-dark);
}
.sm-vol__custom-hint {
	margin: 0.5rem 0 0;
	font-size: 0.78rem;
	color: var(--vol-muted);
}

@media (max-width: 560px) {
	.sm-vol__box {
		grid-template-columns: auto 1fr auto;
		grid-template-rows: auto auto;
	}
	.sm-vol__box-cbm {
		grid-column: 2 / 3;
		grid-row: 2;
		text-align: left;
		min-width: 0;
	}
	.sm-vol__stepper--box {
		grid-column: 3;
		grid-row: 1 / 3;
	}
	.sm-vol__custom-row {
		grid-template-columns: 1fr;
	}
}
