/*
 * LUXZ basket, sticky bar and toast.
 * Colours come from the theme's tokens where present, with sane fallbacks
 * so the plugin still looks right on any other theme.
 */

/* The tokens have to cover the bar and the toast too, not just the basket:
   both live outside .luxz-basket in the markup. */
.luxz-basket,
.luxz-bar,
.luxz-toast {
	--ink: var(--luxz-ink, #121212);
	--muted: var(--luxz-muted, #6B6B6B);
	--line: var(--luxz-line, #E6E2DA);
	--paper: var(--luxz-paper, #FFFFFF);
	--alabaster: var(--luxz-alabaster, #FAF8F4);
	--gold: var(--luxz-gold, #B9924A);
	--sale: var(--luxz-sale, #B0342E);
	--navy: var(--luxz-navy, #17255A);
	--radius: var(--luxz-radius, 16px);
	--radius-sm: var(--luxz-radius-sm, 10px);
	--pill: var(--luxz-radius-pill, 999px);
}

/* Empty state ------------------------------------------------------------ */

.luxz-basket__empty { text-align: center; padding: 72px 20px 96px; }
.luxz-basket__empty-title {
	font-family: var(--luxz-font-display, Georgia, serif);
	font-size: clamp(1.6rem, 4vw, 2.3rem);
	line-height: 1.15; margin: 0 0 10px; color: var(--navy);
}
.luxz-basket__empty-text { color: var(--muted); margin: 0 0 28px; }

/* Layout ----------------------------------------------------------------- */

.luxz-basket__body { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: start; }
@media (min-width: 900px) {
	.luxz-basket__body { grid-template-columns: minmax(0, 1fr) 360px; gap: 56px; }
}

.luxz-basket__items { list-style: none; margin: 0; padding: 0; }

/* A line ----------------------------------------------------------------- */

.luxz-line {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr) auto;
	gap: 18px;
	padding: 22px 0;
	border-bottom: 1px solid var(--line);
	align-items: start;
}
.luxz-line:first-child { border-top: 1px solid var(--line); }
.luxz-line.is-unavailable,
.luxz-line.is-gone { opacity: .55; }

.luxz-line__media { display: block; width: 88px; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-sm); background: var(--alabaster); }
.luxz-line__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.luxz-line__ph { display: block; width: 100%; height: 100%; border-radius: var(--radius-sm); background: var(--alabaster); }

.luxz-line__title {
	display: block;
	font-size: 1.02rem; line-height: 1.3; color: var(--navy); text-decoration: none;
}
.luxz-line__title:hover { color: var(--gold); }

.luxz-line__opts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.luxz-line__opt { font-size: .8rem; color: var(--muted); }
.luxz-line__opt strong { color: var(--navy); font-weight: 500; }

.luxz-line__flag { margin: 8px 0 0; font-size: .8rem; color: var(--sale); }

.luxz-line__controls { display: flex; align-items: center; gap: 18px; margin-top: 14px; }

.luxz-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--pill); background: var(--paper); overflow: hidden; }
.luxz-qty__btn {
	width: 40px; height: 40px; border: 0; background: none; cursor: pointer;
	font-size: 1rem; color: var(--ink); line-height: 1;
}
.luxz-qty__btn:hover { background: var(--alabaster); }
.luxz-qty__input {
	width: 42px; height: 40px; border: 0;
	text-align: center; font-size: 16px; background: none; color: var(--navy);
	-moz-appearance: textfield;
}
.luxz-qty__input::-webkit-outer-spin-button,
.luxz-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.luxz-line__remove {
	border: 0; background: none; padding: 6px 0; cursor: pointer;
	font-size: .78rem; color: var(--muted); border-bottom: 1px solid currentColor;
}
.luxz-line__remove:hover { color: var(--sale); }

.luxz-line__price { text-align: right; white-space: nowrap; }
.luxz-line__each { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 4px; }
.luxz-line__price strong { font-size: 1.02rem; font-weight: 500; color: var(--navy); }

@media (max-width: 600px) {
	.luxz-line { grid-template-columns: 76px minmax(0, 1fr); gap: 14px; }
	.luxz-line__media { width: 76px; }
	.luxz-line__price { grid-column: 2; text-align: left; margin-top: 10px; }
	.luxz-line__each { display: inline; margin-right: 8px; }
}

/* Summary ---------------------------------------------------------------- */

.luxz-basket__aside {
	background: var(--paper);
	padding: 26px;
	border-radius: var(--radius);
	position: sticky; top: 24px;
}
@media (max-width: 899px) { .luxz-basket__aside { position: static; } }

.luxz-basket__total {
	display: flex; justify-content: space-between; align-items: baseline;
	padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
}
.luxz-basket__total span { font-size: .78rem; color: var(--muted); }
.luxz-basket__total strong { font-family: var(--luxz-font-display, Georgia, serif); font-size: 1.6rem; font-weight: 600; color: var(--navy); }

.luxz-basket__note-label label { font-size: .78rem; color: var(--muted); }
.luxz-basket__note {
	width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
	background: var(--alabaster);
	padding: 12px 14px; font: inherit; font-size: 16px; color: var(--navy);
	resize: vertical; margin-bottom: 16px;
}
.luxz-basket__note:focus { outline: none; border-color: var(--navy); }

.luxz-basket__warn { font-size: .8rem; color: var(--sale); margin: 10px 0 0; }
.luxz-basket__reassure { font-size: .78rem; line-height: 1.6; color: var(--muted); margin: 16px 0 0; }

.luxz-basket__clear {
	display: block; margin: 12px auto 0;
	padding: 8px 10px; border: 0; background: none; cursor: pointer;
	font-size: .76rem; color: var(--muted);
	border-bottom: 1px solid currentColor; padding: 0;
}
.luxz-basket__clear:hover { color: var(--sale); }

/* Buttons ---------------------------------------------------------------- */

.luxz-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 52px; padding: 0 28px; width: 100%;
	border: 1px solid var(--ink); border-radius: var(--pill);
	background: var(--ink); color: #fff;
	font-size: .86rem; font-weight: 500;
	cursor: pointer; text-decoration: none; transition: background .2s ease, color .2s ease, opacity .2s ease;
}
.luxz-btn:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.luxz-btn[disabled] { opacity: .4; cursor: not-allowed; }
.luxz-btn--solid { width: auto; }
.luxz-btn--wa.is-busy { opacity: .6; pointer-events: none; }
.luxz-wa-icon { width: 20px; height: 20px; fill: currentColor; flex: 0 0 auto; }

/* Sticky bar ------------------------------------------------------------- */

.luxz-bar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
	background: var(--ink); color: #fff;
	box-shadow: 0 -6px 24px rgba(0,0,0,.16);
}
.luxz-bar[hidden] { display: none; }
.luxz-bar__meta { display: flex; flex-direction: column; line-height: 1.3; }
.luxz-bar__count { font-size: .72rem; opacity: .7; }
.luxz-bar__total { font-family: var(--luxz-font-display, Georgia, serif); font-size: 1.15rem; font-weight: 600; }
.luxz-bar__cta {
	display: inline-flex; align-items: center; gap: 8px;
	background: #fff; color: var(--ink); text-decoration: none;
	border-radius: var(--pill);
	padding: 11px 22px; font-size: .8rem; font-weight: 500;
}
.luxz-bar__cta:hover { background: var(--luxz-blush-deep, #F8E7E0); }
@media (min-width: 900px) { .luxz-bar { display: none; } }

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

.luxz-toast {
	position: fixed; left: 50%; bottom: 96px; z-index: 90;
	transform: translate(-50%, 12px);
	background: var(--luxz-ink, #0F0F0F); color: #fff;
	padding: 12px 22px; font-size: .84rem; border-radius: var(--pill);
	opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease;
	max-width: calc(100vw - 32px); text-align: center;
}
.luxz-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.luxz-toast--warn { background: var(--luxz-sale, #B3322C); }
@media (min-width: 900px) { .luxz-toast { bottom: 32px; } }

@media (prefers-reduced-motion: reduce) {
	.luxz-toast, .luxz-btn, .luxz-line__title { transition: none; }
}
