/* Guided Shop — all rules scoped under .guided-shop to avoid leaking into the theme. */

.guided-shop {
	--gs-primary-bg: #2f6fce;
	--gs-card-bg: #4fc3f7;
	--gs-button: #2f6fce;
	--gs-text: #ffffff;
	--gs-minus: #e53935;
	--gs-plus: #43a047;
	--gs-radius: 14px;
	--gs-spacing: 16px;
	--gs-font-size: 16px;

	box-sizing: border-box;
	font-size: var(--gs-font-size);
	font-family: inherit;
	max-width: 900px;
	margin: 0 auto;
	background: var(--gs-primary-bg);
	color: var(--gs-text);
	border-radius: var(--gs-radius);
	padding: calc(var(--gs-spacing) * 1.5);
	position: relative;
}

.guided-shop *,
.guided-shop *::before,
.guided-shop *::after {
	box-sizing: border-box;
}

.guided-shop__app {
	position: relative;
}

.guided-shop__loading {
	display: flex;
	align-items: center;
	gap: 10px;
	justify-content: center;
	padding: 40px 0;
}

.guided-shop__spinner {
	width: 20px;
	height: 20px;
	border: 3px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: guided-shop-spin 0.8s linear infinite;
}

@keyframes guided-shop-spin {
	to { transform: rotate(360deg); }
}

/* Header / basket badge ------------------------------------------------ */

.guided-shop__header {
	display: flex;
	justify-content: flex-end;
	margin-bottom: var(--gs-spacing);
}

.guided-shop__basket-btn {
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: var(--gs-text);
	padding: 8px 18px;
	border-radius: 999px;
	font-size: 0.95em;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
	line-height: 1.2;
}

.guided-shop__basket-label {
	white-space: nowrap;
}

.guided-shop__basket-total {
	font-size: 0.82em;
	font-weight: 500;
	opacity: 0.85;
}

.guided-shop__basket-total,
.guided-shop__basket-total * {
	color: inherit !important;
}

.guided-shop__basket-btn:hover,
.guided-shop__basket-btn:focus-visible {
	background: rgba(255, 255, 255, 0.28);
}

/* Titles / back ---------------------------------------------------------- */

.guided-shop__title {
	margin: 0 0 var(--gs-spacing);
	font-weight: 600;
	font-size: 1.4em;
}

.guided-shop__title-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.guided-shop__title-row .guided-shop__title {
	margin: 0;
}

.guided-shop__back {
	background: transparent;
	border: none;
	color: var(--gs-text);
	font-size: 1.6em;
	line-height: 1;
	cursor: pointer;
	padding: 6px 10px;
	border-radius: 8px;
}

.guided-shop__back:hover,
.guided-shop__back:focus-visible {
	background: rgba(255, 255, 255, 0.15);
}

/* Stage 1: categories ----------------------------------------------------- */

.guided-shop__category-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--gs-spacing);
}

.guided-shop__category-card {
	background: var(--gs-card-bg);
	border: none;
	color: var(--gs-text);
	font-size: 1.05em;
	font-weight: 600;
	text-align: left;
	padding: 24px 18px;
	border-radius: var(--gs-radius);
	min-height: 90px;
	cursor: pointer;
	transition: transform 0.12s ease, filter 0.12s ease;
}

.guided-shop__category-card:hover,
.guided-shop__category-card:focus-visible {
	filter: brightness(1.08);
	transform: translateY(-2px);
}

/* Stage 2: products --------------------------------------------------- */

.guided-shop__search {
	width: 100%;
	padding: 12px 14px;
	border-radius: var(--gs-radius);
	border: none;
	margin-bottom: var(--gs-spacing);
	font-size: 1em;
}

.guided-shop__product-list {
	background: var(--gs-card-bg);
	border-radius: var(--gs-radius);
	padding: var(--gs-spacing);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.guided-shop__product-list--scrollable {
	max-height: 560px;
	overflow-y: auto;
	scrollbar-gutter: stable;
}

.guided-shop__product-row {
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	align-items: center;
	gap: 12px;
	background: #fff;
	color: #1a1a1a;
	border-radius: 10px;
	padding: 10px 14px;
}

.guided-shop__product-row.is-unavailable {
	opacity: 0.55;
}

.guided-shop__product-img {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 8px;
}

.guided-shop__product-name-col {
	min-width: 0;
}

.guided-shop__product-name {
	font-weight: 600;
}

.guided-shop__product-variation,
.guided-shop__product-sku,
.guided-shop__product-desc {
	font-size: 0.85em;
	color: #555;
}

.guided-shop__stock {
	font-size: 0.8em;
	color: #b45309;
	margin-top: 2px;
}

.guided-shop__stock--out {
	color: #dc2626;
	font-weight: 600;
}

.guided-shop__view-product {
	display: inline-block;
	font-size: 0.8em;
	color: var(--gs-button);
	margin-top: 4px;
	text-decoration: underline;
}

.guided-shop__product-price {
	font-weight: 600;
	white-space: nowrap;
}

.guided-shop__qty-controls {
	display: flex;
	align-items: center;
	gap: 8px;
}

.guided-shop__qty-value {
	min-width: 22px;
	text-align: center;
	font-weight: 600;
}

.guided-shop__qty-btn {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: none;
	color: #fff;
	font-size: 1.1em;
	line-height: 1;
	cursor: pointer;
}

.guided-shop__qty-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.guided-shop__qty-btn--minus {
	background: var(--gs-minus);
}

.guided-shop__qty-btn--plus {
	background: var(--gs-plus);
}

.guided-shop__load-more {
	display: block;
	margin: var(--gs-spacing) auto 0;
	background: rgba(255, 255, 255, 0.15);
	color: var(--gs-text);
	border: none;
	padding: 10px 20px;
	border-radius: 999px;
	cursor: pointer;
}

/* Basket ---------------------------------------------------------------- */

.guided-shop__basket-list {
	background: var(--gs-card-bg);
	border-radius: var(--gs-radius);
	padding: var(--gs-spacing);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.guided-shop__basket-list--scrollable {
	max-height: 480px;
	overflow-y: auto;
	scrollbar-gutter: stable;
}

.guided-shop__basket-row {
	display: grid;
	grid-template-columns: 1fr auto auto auto;
	align-items: center;
	gap: 12px;
	background: #fff;
	color: #1a1a1a;
	border-radius: 10px;
	padding: 10px 14px;
	transition: opacity 0.15s ease;
}

.guided-shop__basket-row.is-removing {
	opacity: 0.5;
}

.guided-shop__basket-remove {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.06);
	color: var(--gs-minus);
	font-size: 1.1em;
	line-height: 1;
	cursor: pointer;
}

.guided-shop__basket-remove:hover,
.guided-shop__basket-remove:focus-visible {
	background: var(--gs-minus);
	color: #fff;
}

.guided-shop__basket-remove:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.guided-shop__basket-empty {
	background: rgba(255, 255, 255, 0.15);
	padding: 30px;
	text-align: center;
	border-radius: var(--gs-radius);
}

.guided-shop__subtotal {
	margin-top: var(--gs-spacing);
	font-size: 1.1em;
	text-align: right;
}

.guided-shop__checkout-btn {
	display: block;
	margin: 14px 0 0 auto;
	background: var(--gs-button);
	color: #fff;
	border: none;
	padding: 12px 28px;
	border-radius: var(--gs-radius);
	font-weight: 600;
	font-size: 1em;
	cursor: pointer;
}

.guided-shop__checkout-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

/* Toast ------------------------------------------------------------------ */

.guided-shop__toast {
	position: absolute;
	left: 50%;
	bottom: 12px;
	transform: translate(-50%, 20px);
	background: #1a1a1a;
	color: #fff;
	padding: 10px 18px;
	border-radius: 8px;
	font-size: 0.9em;
	opacity: 0;
	pointer-events: none;
	transition: transform 0.2s ease, opacity 0.2s ease;
	max-width: 90%;
	text-align: center;
	z-index: 10;
}

.guided-shop__toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
	pointer-events: auto;
}

.guided-shop__noscript {
	text-align: center;
	padding: 30px;
}

.guided-shop__btn {
	display: inline-block;
	background: #fff;
	color: var(--gs-primary-bg);
	padding: 10px 20px;
	border-radius: var(--gs-radius);
	text-decoration: none;
	font-weight: 600;
	margin-top: 10px;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 780px) {
	.guided-shop__category-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.guided-shop {
		padding: var(--gs-spacing);
		border-radius: 0;
	}

	.guided-shop__product-row {
		grid-template-columns: auto 1fr;
		grid-template-areas:
			"img name"
			"price controls";
		row-gap: 8px;
	}

	.guided-shop__product-img { grid-area: img; }
	.guided-shop__product-name-col { grid-area: name; }
	.guided-shop__product-price { grid-area: price; }
	.guided-shop__qty-controls { grid-area: controls; justify-self: end; }

	.guided-shop__qty-btn {
		width: 40px;
		height: 40px;
	}

	.guided-shop__basket-row {
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"name remove"
			"qty remove"
			"amount remove";
		row-gap: 4px;
	}

	.guided-shop__basket-name { grid-area: name; }
	.guided-shop__basket-qty { grid-area: qty; }
	.guided-shop__basket-amount { grid-area: amount; }
	.guided-shop__basket-remove { grid-area: remove; align-self: center; }
}
