/* Side cart drawer (inc/thor-side-cart.php) */

.thor-sc {
	position: fixed;
	inset: 0;
	z-index: 100001;
	font-family: var(--thor-sans);
	color: var(--thor-ink);
}

.thor-sc[hidden] {
	display: none;
}

.thor-sc__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 46, 37, .45);
	opacity: 0;
	transition: opacity .25s ease;
}

.thor-sc__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	width: min(100vw, 420px);
	background: var(--thor-surface);
	box-shadow: -20px 0 60px rgba(15, 46, 37, .18);
	transform: translateX(100%);
	transition: transform .28s cubic-bezier(.2, .8, .2, 1);
	outline: none;
}

.thor-sc.is-open .thor-sc__backdrop {
	opacity: 1;
}

.thor-sc.is-open .thor-sc__panel {
	transform: none;
}

.thor-sc__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
	transition: opacity .15s ease;
}

.thor-sc.is-busy .thor-sc__body {
	opacity: .6;
	pointer-events: none;
}

.thor-sc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid var(--thor-line);
}

.thor-sc__title {
	margin: 0;
	font-family: var(--thor-serif);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
}

.thor-sc__title span {
	color: var(--thor-muted);
	font-family: var(--thor-sans);
	font-size: 15px;
	font-weight: 500;
}

.thor-sc__close,
.thor-sc__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 38px;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--thor-pill);
	background: var(--thor-bg);
	color: var(--thor-ink);
	cursor: pointer;
	transition: background-color .15s ease;
}

.thor-sc__close:hover,
.thor-sc__remove:hover {
	background: var(--thor-soft);
}

.thor-sc__close .thor-icon {
	width: 20px;
	height: 20px;
}

.thor-sc__msg {
	margin: 12px 20px 0;
	padding: 10px 14px;
	border-radius: 12px;
	background: #fdecea;
	color: #9b2c1f;
	font-size: 14px;
}

.thor-sc__loading {
	display: grid;
	gap: 16px;
	padding: 20px;
}

.thor-sc__loading span {
	height: 80px;
	border-radius: 14px;
	background: linear-gradient(90deg, var(--thor-bg) 25%, var(--thor-soft) 50%, var(--thor-bg) 75%);
	background-size: 200% 100%;
	animation: thor-sc-shimmer 1.2s linear infinite;
}

@keyframes thor-sc-shimmer {
	to {
		background-position: -200% 0;
	}
}

.thor-sc__scroll {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 4px 20px 20px;
}

.thor-sc__items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.thor-sc__item {
	display: grid;
	grid-template-columns: 80px 1fr auto;
	gap: 14px;
	align-items: start;
	margin: 0;
	padding: 16px 0;
	border-bottom: 1px solid var(--thor-line);
	transition: opacity .2s ease;
}

.thor-sc__item.is-removing {
	opacity: .3;
}

.thor-sc__thumb img {
	display: block;
	width: 80px;
	height: 80px;
	border-radius: 12px;
	background: var(--thor-bg);
	object-fit: cover;
}

.thor-sc__info {
	min-width: 0;
}

.thor-sc__name {
	display: -webkit-box;
	overflow: hidden;
	color: var(--thor-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.thor-sc__name:hover {
	color: var(--thor-accent-text);
}

.thor-sc__meta {
	margin: 4px 0 0;
	color: var(--thor-muted);
	font-size: 13px;
	line-height: 1.4;
}

.thor-sc__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 10px;
}

.thor-sc__qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--thor-line);
	border-radius: var(--thor-pill);
}

.thor-sc__qty button {
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--thor-ink);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.thor-sc__qty span {
	min-width: 22px;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
}

.thor-sc__price {
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
}

.thor-sc__remove {
	width: 30px;
	height: 30px;
	background: none;
	color: var(--thor-muted);
}

.thor-sc__remove .thor-icon {
	width: 16px;
	height: 16px;
}

.thor-sc__recs {
	margin-top: 22px;
}

.thor-sc__recs-title {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .02em;
}

.thor-sc__recs-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.thor-sc__rec {
	display: flex;
	flex-direction: column;
	gap: 4px;
	color: var(--thor-ink);
	text-decoration: none;
}

.thor-sc__rec img {
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	border-radius: 12px;
	background: var(--thor-bg);
	object-fit: cover;
}

.thor-sc__rec-name {
	display: -webkit-box;
	overflow: hidden;
	font-size: 12px;
	line-height: 1.3;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.thor-sc__rec-price {
	font-size: 13px;
	font-weight: 700;
}

.thor-sc__rec-price del {
	color: var(--thor-muted);
	font-weight: 400;
}

.thor-sc__foot {
	display: grid;
	gap: 12px;
	padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--thor-line);
	background: var(--thor-surface);
}

.thor-sc__coupon {
	display: flex;
	gap: 8px;
	margin: 0;
}

.thor-sc__coupon input {
	flex: 1;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--thor-line);
	border-radius: 12px;
	background: var(--thor-bg);
	box-shadow: none;
	font-size: 15px;
}

.thor-sc__coupon input:focus {
	border-color: var(--thor-accent);
	outline: none;
}

.thor-sc__coupon button {
	height: 44px;
	margin: 0;
	padding: 0 18px;
	border: 0;
	border-radius: 12px;
	background: var(--thor-deep);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.thor-sc__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.thor-sc__chips button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 5px 10px;
	border: 1px dashed var(--thor-accent);
	border-radius: var(--thor-pill);
	background: var(--thor-sand);
	color: var(--thor-accent-dark);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	cursor: pointer;
}

.thor-sc__chips .thor-icon {
	width: 12px;
	height: 12px;
}

.thor-sc__totals {
	display: grid;
	gap: 6px;
	margin: 0;
}

.thor-sc__totals div {
	display: flex;
	justify-content: space-between;
	font-size: 15px;
}

.thor-sc__totals dt,
.thor-sc__totals dd {
	margin: 0;
	font-weight: 600;
}

.thor-sc__totals dd {
	font-weight: 700;
}

.thor-sc__totals .is-discount {
	color: var(--thor-accent-text);
}

.thor-sc__note {
	margin: -4px 0 0;
	color: var(--thor-muted);
	font-size: 13px;
}

.thor-sc__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	border-radius: var(--thor-pill);
	background: var(--thor-accent);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
	transition: background-color .15s ease;
}

.thor-sc__checkout:hover,
.thor-sc__checkout:focus-visible {
	background: var(--thor-accent-dark);
	color: #fff;
}

.thor-sc__checkout .thor-icon {
	width: 18px;
	height: 18px;
}

.thor-sc__view {
	color: var(--thor-muted);
	font-size: 14px;
	text-align: center;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.thor-sc__empty {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 40px 28px;
	text-align: center;
}

.thor-sc__empty > .thor-icon {
	width: 56px;
	height: 56px;
	padding: 16px;
	border-radius: var(--thor-pill);
	background: var(--thor-bg);
	color: var(--thor-accent);
}

.thor-sc__empty p {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
}

.thor-sc__empty .thor-sc__checkout {
	align-self: stretch;
}

@media (prefers-reduced-motion: reduce) {
	.thor-sc__panel,
	.thor-sc__backdrop {
		transition: none;
	}
}
