/**
 * Turn On — side cart drawer (task_011 / task_012)
 * Markup: inc/side-cart.php · Behaviour: assets/js/side-cart.js
 *
 * Palette from the header block: navy #0b2545, green #3cb371,
 * surface #f4f2ec, border #e8e4da.
 *
 * z-index sits above the sticky header (99999) and the floating
 * buttons, below CookieYes' preference modal (999999999).
 */

html.tosc-open,
html.tosc-open body {
	overflow: hidden;
}

.tosc {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	font-family: 'Noto Sans', sans-serif;
	-webkit-font-smoothing: antialiased;
	color: #1a1a1a;
}
.tosc[hidden] { display: none; }

.tosc__overlay {
	position: absolute;
	inset: 0;
	background: rgba(11, 37, 69, 0.45);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.tosc__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(420px, 100vw);
	background: #ffffff;
	display: flex;
	flex-direction: column;
	box-shadow: -12px 0 32px rgba(11, 37, 69, 0.12);
	transform: translateX(100%);
	transition: transform 0.25s ease;
	outline: none;
}
[dir="rtl"] .tosc__panel {
	right: auto;
	left: 0;
	transform: translateX(-100%);
}

.tosc.is-open .tosc__overlay { opacity: 1; }
.tosc.is-open .tosc__panel   { transform: none; }

@media (prefers-reduced-motion: reduce) {
	.tosc__overlay,
	.tosc__panel { transition: none; }
}

/* ── Head ─────────────────────────────────────────────────── */
.tosc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid #e8e4da;
}
.tosc__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #0b2545;
}
.tosc__count {
	font-weight: 500;
	color: #6b6b6b;
	margin-inline-start: 4px;
}
.tosc__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #3a3a3a;
	cursor: pointer;
}
.tosc__close:hover,
.tosc__close:focus-visible { background: #f4f2ec; }

.tosc__notice {
	margin: 0;
	padding: 10px 20px;
	font-size: 13px;
	background: #fff4e5;
	color: #8a4b00;
	border-bottom: 1px solid #f3dcb8;
}
.tosc__notice[hidden] { display: none; }

/* ── Body ─────────────────────────────────────────────────── */
.tosc__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
	transition: opacity 0.15s ease;
}
.tosc__body.is-busy { opacity: 0.55; pointer-events: none; }

.tosc__loading {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}
.tosc__loading span {
	width: 28px;
	height: 28px;
	border: 3px solid #e8e4da;
	border-top-color: #0b2545;
	border-radius: 50%;
	animation: tosc-spin 0.8s linear infinite;
}
@keyframes tosc-spin { to { transform: rotate(360deg); } }

.tosc__items {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
	margin: 0;
	padding: 4px 20px;
}

.tosc__item {
	position: relative;
	display: grid;
	grid-template-columns: 76px 1fr;
	gap: 14px;
	padding: 16px 28px 16px 0;
	border-bottom: 1px solid #edeae2;
	transition: opacity 0.15s ease;
}
.tosc__item:last-child { border-bottom: 0; }
.tosc__item.is-removing { opacity: 0.4; }

.tosc__thumb {
	width: 76px;
	height: 76px;
	border-radius: 10px;
	background: #f4f2ec;
	overflow: hidden;
}
.tosc__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.tosc__info { min-width: 0; }
.tosc__name {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
}
.tosc__name a {
	color: #1a1a1a;
	text-decoration: none;
}
.tosc__name a:hover { color: #0b2545; text-decoration: underline; }

.tosc__info .variation {
	margin: 0 0 4px;
	font-size: 12px;
	color: #6b6b6b;
}
.tosc__info .variation dt,
.tosc__info .variation dd,
.tosc__info .variation p { display: inline; margin: 0; }

.tosc__unit {
	margin: 0 0 10px;
	font-size: 13px;
	color: #6b6b6b;
}
.tosc__unit small,
.tosc__line small,
.tosc__subtotal small { font-size: 11px; font-weight: 400; color: #6b6b6b; }

.tosc__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.tosc__qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid #e8e4da;
	border-radius: 999px;
	overflow: hidden;
}
.tosc__qty-btn {
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	font-size: 16px;
	line-height: 1;
	color: #0b2545;
	cursor: pointer;
}
.tosc__qty-btn:hover:not(:disabled) { background: #f4f2ec; }
.tosc__qty-btn:disabled { color: #c8c4ba; cursor: not-allowed; }
.tosc__qty-val {
	min-width: 26px;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
}
.tosc__qty-fixed { font-size: 13px; color: #6b6b6b; }

.tosc__line {
	font-size: 15px;
	font-weight: 700;
	color: #0b2545;
	white-space: nowrap;
}

.tosc__remove {
	position: absolute;
	top: 14px;
	right: 0;
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #9a9a9a;
	cursor: pointer;
}
[dir="rtl"] .tosc__remove { right: auto; left: 0; }
.tosc__remove:hover,
.tosc__remove:focus-visible { background: #fdecec; color: #c62828; }

/* ── Foot ─────────────────────────────────────────────────── */
.tosc__foot {
	padding: 16px 20px 20px;
	border-top: 1px solid #e8e4da;
	background: #ffffff;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.tosc__subtotal {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	font-size: 15px;
}
.tosc__subtotal strong {
	font-size: 18px;
	color: #0b2545;
}
.tosc__tax {
	margin: -6px 0 0;
	font-size: 12px;
	color: #6b6b6b;
	text-align: right;
}
.tosc__tax-row {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	color: #3a3a3a;
}
.tosc__subtotal--total {
	padding-top: 8px;
	border-top: 1px solid #e8e4da;
}
.tosc__hint {
	margin: -4px 0 4px;
	font-size: 12px;
	color: #6b6b6b;
}

.tosc__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 20px;
	border-radius: 999px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}
.tosc__btn--primary {
	background: #0b2545;
	color: #ffffff;
	border: 1px solid #0b2545;
}
.tosc__btn--primary:hover { background: #163a66; color: #ffffff; }
.tosc__btn--ghost {
	background: #ffffff;
	color: #0b2545;
	border: 1px solid #0b2545;
}
.tosc__btn--ghost:hover { background: #f4f2ec; color: #0b2545; }

/* ── Empty ────────────────────────────────────────────────── */
.tosc__empty {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 40px 24px;
	text-align: center;
	color: #9a9a9a;
}
.tosc__empty p {
	margin: 0;
	font-size: 15px;
	color: #3a3a3a;
}
.tosc__empty .tosc__btn { min-width: 220px; }
