/**
 * Store Demo — scan-to-order restaurant concept (menu + merch + cart).
 * Mobile-first: designed for a phone held at a table. One generic
 * stylesheet for every demo store; the store's brand color arrives as
 * --ds-accent (set inline by the template) and every accent shade is
 * derived from it via color-mix with plain-accent fallbacks.
 */

/* ───────────────────────── Base ───────────────────────── */

.store-demo {
	--ds-accent: #C8963E;
	--ds-ink: #241d15;
	--ds-ink-soft: #6b6157;
	--ds-paper: #faf6ef;
	--ds-card: #ffffff;
	--ds-line: #e8e0d4;
	--ds-accent-soft: var(--ds-accent);
	--ds-accent-deep: var(--ds-accent);
	--ds-accent-tint: #f3ead9;
	margin: 0;
	background: var(--ds-paper);
	color: var(--ds-ink);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

@supports (color: color-mix(in srgb, red 50%, white)) {
	.store-demo {
		--ds-accent-soft: color-mix(in srgb, var(--ds-accent) 82%, white);
		--ds-accent-deep: color-mix(in srgb, var(--ds-accent) 72%, black);
		--ds-accent-tint: color-mix(in srgb, var(--ds-accent) 12%, white);
	}
}

.store-demo * { box-sizing: border-box; }
.store-demo img { max-width: 100%; display: block; }
.store-demo button { font: inherit; cursor: pointer; }

/* ───────────────────────── Demo ribbon ───────────────────────── */

.store-demo .demo-ribbon {
	position: sticky;
	top: 0;
	z-index: 60;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 7px 14px;
	background: #1d1913;
	color: #e9e2d6;
	font-size: 12px;
	letter-spacing: .01em;
	text-align: center;
}
.store-demo .demo-ribbon a { color: var(--ds-accent-soft); font-weight: 600; text-decoration: none; }
.store-demo .demo-ribbon-dot {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--ds-accent);
	flex: none;
	animation: ds-pulse 2s ease-in-out infinite;
}
@keyframes ds-pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .45; transform: scale(.8);} }

/* ───────────────────────── Header ───────────────────────── */

.store-head {
	background:
		radial-gradient(120% 140% at 50% -40%, var(--ds-accent-deep), transparent 70%),
		#241d15;
	color: #f7f2e9;
	padding: 26px 20px 0;
	text-align: center;
}
.store-logo { max-height: 72px; margin: 0 auto 8px; }
.store-name-display {
	display: block;
	font-family: 'Bitter', Georgia, serif;
	font-size: clamp(26px, 7vw, 38px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -.01em;
}
.store-tagline { margin: 6px 0 0; font-size: 14px; color: var(--ds-accent-soft); font-weight: 500; }
.store-meta { margin: 4px 0 0; font-size: 12px; color: rgba(247, 242, 233, .65); }

.store-tabs {
	display: flex;
	gap: 8px;
	max-width: 420px;
	margin: 18px auto 0;
	padding: 0 0 14px;
}
.store-tab {
	flex: 1;
	padding: 10px 0;
	border: 1px solid rgba(247, 242, 233, .25);
	border-radius: 999px;
	background: transparent;
	color: rgba(247, 242, 233, .8);
	font-weight: 600;
	font-size: 15px;
	transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.store-tab.is-active {
	background: var(--ds-accent);
	border-color: var(--ds-accent);
	color: #1d1913;
}

/* ───────────────────────── Main / views ───────────────────────── */

.store-main {
	max-width: 760px;
	margin: 0 auto;
	padding: 14px 16px 110px;
}

/* Category pills */
.cat-pills {
	position: sticky;
	top: 30px;
	z-index: 40;
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 10px 2px;
	margin: 0 -16px;
	padding-left: 16px;
	padding-right: 16px;
	background: linear-gradient(var(--ds-paper) 82%, transparent);
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
	flex: none;
	padding: 8px 15px;
	border: 1px solid var(--ds-line);
	border-radius: 999px;
	background: var(--ds-card);
	color: var(--ds-ink-soft);
	font-size: 13.5px;
	font-weight: 600;
	white-space: nowrap;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.cat-pill.is-active {
	background: var(--ds-ink);
	border-color: var(--ds-ink);
	color: #f7f2e9;
}

/* Category section heading */
.cat-heading {
	font-family: 'Bitter', Georgia, serif;
	font-size: 20px;
	font-weight: 700;
	margin: 22px 2px 10px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.cat-heading::after {
	content: '';
	flex: 1;
	height: 1px;
	background: repeating-linear-gradient(90deg, var(--ds-line) 0 10px, transparent 10px 16px);
}

/* ───────────────────────── Item cards ───────────────────────── */

.item-card {
	display: flex;
	align-items: stretch;
	gap: 12px;
	width: 100%;
	text-align: left;
	background: var(--ds-card);
	border: 1px solid var(--ds-line);
	border-radius: 14px;
	padding: 12px;
	margin-bottom: 10px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.item-card:active { border-color: var(--ds-accent); }

.item-tile {
	flex: none;
	width: 62px;
	height: 62px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Bitter', Georgia, serif;
	font-size: 24px;
	font-weight: 700;
	color: rgba(255, 255, 255, .92);
	align-self: center;
	overflow: hidden;
}
.item-tile.has-photo {
	padding: 0;
	background: var(--ds-line);
}
.item-tile.has-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.item-tile[data-initial]:not(.has-photo)::before {
	content: attr(data-initial);
}
[data-hue="amber"] .item-tile, .item-tile[data-hue="amber"] { background: linear-gradient(135deg, #c8963e, #9a6b23); }
[data-hue="rust"]  .item-tile, .item-tile[data-hue="rust"]  { background: linear-gradient(135deg, #b0563a, #7d3722); }
[data-hue="olive"] .item-tile, .item-tile[data-hue="olive"] { background: linear-gradient(135deg, #7a8450, #545e30); }
[data-hue="brown"] .item-tile, .item-tile[data-hue="brown"] { background: linear-gradient(135deg, #7d5a3c, #543a24); }
[data-hue="plum"]  .item-tile, .item-tile[data-hue="plum"]  { background: linear-gradient(135deg, #7d4a5e, #55293c); }
[data-hue="slate"] .item-tile, .item-tile[data-hue="slate"] { background: linear-gradient(135deg, #5b6672, #39424c); }

.item-body { flex: 1; min-width: 0; }
.item-name { margin: 0; font-size: 15.5px; font-weight: 650; }
.item-desc {
	margin: 3px 0 0;
	font-size: 13px;
	color: var(--ds-ink-soft);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.item-tags { margin-top: 5px; display: flex; gap: 5px; }
.tag-chip {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--ds-accent-tint);
	color: var(--ds-accent-deep);
}

.item-side {
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px;
}
.item-price { font-weight: 700; font-size: 14.5px; }
.item-add {
	border: none;
	border-radius: 999px;
	background: var(--ds-accent);
	color: #1d1913;
	font-weight: 700;
	font-size: 13px;
	padding: 7px 14px;
	transition: transform .12s ease, background .15s ease;
}
.item-add:active { transform: scale(.94); }

/* ───────────────────────── Merch ───────────────────────── */

.merch-intro {
	margin: 14px 2px 4px;
	font-size: 14px;
	color: var(--ds-ink-soft);
}
.merch-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin-top: 12px;
}
.merch-card {
	text-align: left;
	background: var(--ds-card);
	border: 1px solid var(--ds-line);
	border-radius: 14px;
	overflow: hidden;
	padding: 0 0 12px;
	transition: border-color .15s ease;
}
.merch-card:active { border-color: var(--ds-accent); }
.merch-tile {
	width: 100%;
	height: 96px;
	border-radius: 0;
	margin-bottom: 10px;
}
.merch-tile.has-photo {
	height: 120px;
	margin-bottom: 0;
}
.merch-card .merch-tile.has-photo + .merch-name {
	margin-top: 10px;
}
.merch-card .merch-name { margin: 0 12px; font-size: 14.5px; font-weight: 650; }
.merch-card .merch-desc { margin: 3px 12px 0; font-size: 12.5px; color: var(--ds-ink-soft); }
.merch-card .merch-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 10px 12px 0;
}
.merch-card .item-price { font-size: 14px; }

/* ───────────────────────── Cart FAB ───────────────────────── */

.cart-fab {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	z-index: 55;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 480px;
	margin: 0 auto;
	padding: 14px 18px;
	border: none;
	border-radius: 999px;
	background: var(--ds-ink);
	color: #f7f2e9;
	font-weight: 650;
	font-size: 15px;
	box-shadow: 0 10px 30px rgba(29, 25, 19, .35);
	animation: ds-fab-in .25s ease;
}
@keyframes ds-fab-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.cart-fab-label { flex: 1; text-align: left; }
.cart-fab-count {
	background: var(--ds-accent);
	color: #1d1913;
	font-size: 12.5px;
	font-weight: 800;
	min-width: 22px;
	height: 22px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 6px;
}
.cart-fab-total { font-variant-numeric: tabular-nums; }

/* ───────────────────────── Bottom sheet ───────────────────────── */

.sheet-root { position: fixed; inset: 0; z-index: 70; }
.sheet-backdrop {
	position: absolute; inset: 0;
	background: rgba(29, 25, 19, .5);
	animation: ds-fade .2s ease;
}
@keyframes ds-fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-card {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	max-height: 88vh;
	overflow-y: auto;
	background: var(--ds-paper);
	border-radius: 20px 20px 0 0;
	padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px));
	animation: ds-sheet-up .25s ease;
	max-width: 560px;
	margin: 0 auto;
}
@keyframes ds-sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-grab {
	width: 42px; height: 4px;
	border-radius: 999px;
	background: var(--ds-line);
	margin: 4px auto 14px;
}
.sheet-close {
	position: absolute;
	top: 14px; right: 14px;
	width: 30px; height: 30px;
	border: none;
	border-radius: 50%;
	background: var(--ds-line);
	color: var(--ds-ink);
	font-size: 15px;
	line-height: 1;
}

.sheet-title { font-family: 'Bitter', Georgia, serif; font-size: 21px; font-weight: 700; margin: 0 30px 4px 0; }
.sheet-hero {
	margin: -10px -18px 12px;
	border-radius: 20px 20px 0 0;
	overflow: hidden;
	max-height: 180px;
	background: var(--ds-line);
}
.sheet-hero img {
	width: 100%;
	height: 180px;
	object-fit: cover;
	display: block;
}
.sheet-desc { margin: 0 0 12px; font-size: 14px; color: var(--ds-ink-soft); }
.sheet-price { font-weight: 700; font-size: 16px; margin: 0 0 14px; }

/* Modifier + size selectors */
.opt-row { margin: 0 0 14px; }
.opt-label { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ds-ink-soft); margin: 0 0 7px; }
.opt-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.opt-chip {
	padding: 7px 14px;
	border: 1.5px solid var(--ds-line);
	border-radius: 999px;
	background: var(--ds-card);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--ds-ink);
	transition: border-color .15s ease, background .15s ease;
}
.opt-chip.is-on {
	border-color: var(--ds-accent);
	background: var(--ds-accent-tint);
	color: var(--ds-accent-deep);
}

/* Qty stepper */
.qty-step {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	border: 1.5px solid var(--ds-line);
	border-radius: 999px;
	padding: 4px 8px;
	background: var(--ds-card);
}
.qty-btn {
	width: 30px; height: 30px;
	border: none;
	border-radius: 50%;
	background: var(--ds-accent-tint);
	color: var(--ds-accent-deep);
	font-size: 17px;
	font-weight: 700;
	line-height: 1;
}
.qty-num { min-width: 20px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.sheet-cta-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.sheet-cta {
	flex: 1;
	border: none;
	border-radius: 999px;
	background: var(--ds-accent);
	color: #1d1913;
	font-weight: 750;
	font-size: 15.5px;
	padding: 14px 18px;
	transition: transform .12s ease;
}
.sheet-cta:active { transform: scale(.97); }
.sheet-cta[disabled] { opacity: .45; cursor: not-allowed; }

/* ───────────────────────── Cart sheet ───────────────────────── */

.cart-lines { margin: 4px 0 12px; }
.cart-line {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px dashed var(--ds-line);
}
.cart-line-body { flex: 1; min-width: 0; }
.cart-line-name { margin: 0; font-size: 14.5px; font-weight: 650; }
.cart-line-sub { margin: 1px 0 0; font-size: 12px; color: var(--ds-ink-soft); }
.cart-line .qty-step { padding: 2px 6px; gap: 10px; }
.cart-line .qty-btn { width: 25px; height: 25px; font-size: 14px; }
.cart-line-price { font-weight: 700; font-size: 13.5px; min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }

.cart-empty { text-align: center; color: var(--ds-ink-soft); padding: 26px 0; font-size: 14px; }

.cart-totals { margin: 6px 0 14px; font-size: 14px; }
.cart-totals .tot-row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ds-ink-soft); }
.cart-totals .tot-row.grand {
	color: var(--ds-ink);
	font-weight: 750;
	font-size: 17px;
	border-top: 1.5px solid var(--ds-line);
	margin-top: 6px;
	padding-top: 9px;
}

.cart-fields { display: flex; gap: 10px; margin: 0 0 4px; }
.cart-field { flex: 1; }
.cart-field label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ds-ink-soft); margin-bottom: 4px; }
.cart-field input {
	width: 100%;
	padding: 10px 12px;
	border: 1.5px solid var(--ds-line);
	border-radius: 10px;
	background: var(--ds-card);
	font: inherit;
	font-size: 15px;
	color: var(--ds-ink);
}
.cart-field input:focus { outline: none; border-color: var(--ds-accent); }

/* ───────────────────────── Success ───────────────────────── */

.success-wrap { text-align: center; padding: 18px 6px 6px; }
.success-mark {
	width: 64px; height: 64px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: var(--ds-accent-tint);
	color: var(--ds-accent-deep);
	display: flex;
	align-items: center;
	justify-content: center;
	animation: ds-pop .3s ease;
}
@keyframes ds-pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.success-wrap h2 { font-family: 'Bitter', Georgia, serif; font-size: 23px; margin: 0 0 6px; }
.success-wrap p { margin: 0 0 8px; font-size: 14px; color: var(--ds-ink-soft); }
.success-note {
	margin: 14px 0 0 !important;
	padding: 10px 14px;
	border-radius: 10px;
	background: var(--ds-accent-tint);
	color: var(--ds-accent-deep) !important;
	font-size: 12.5px !important;
	font-weight: 550;
}

/* ───────────────────────── Footer ───────────────────────── */

.store-foot {
	background: #241d15;
	color: #f7f2e9;
	text-align: center;
	padding: 36px 22px 30px;
	margin-top: 30px;
}
.foot-cta h2 { font-family: 'Bitter', Georgia, serif; font-size: 22px; margin: 0 0 8px; }
.foot-cta p { margin: 0 auto 16px; max-width: 400px; font-size: 14px; color: rgba(247, 242, 233, .72); }
.foot-btn {
	display: inline-block;
	background: var(--ds-accent);
	color: #1d1913;
	font-weight: 750;
	text-decoration: none;
	border-radius: 999px;
	padding: 12px 26px;
	font-size: 15px;
}
.foot-credit { margin: 26px 0 0; font-size: 11.5px; color: rgba(247, 242, 233, .5); line-height: 1.7; }
.foot-credit a { color: var(--ds-accent-soft); text-decoration: none; }

/* ───────────────────────── Larger screens ───────────────────────── */

@media (min-width: 720px) {
	.store-head { padding-top: 40px; }
	.merch-grid { grid-template-columns: repeat(3, 1fr); }
	.sheet-card { border-radius: 20px; bottom: auto; top: 50%; transform: translateY(-50%); animation: ds-fade .2s ease; }
	.cat-pills { top: 30px; }
}

@media (prefers-reduced-motion: reduce) {
	.store-demo *, .store-demo *::before, .store-demo *::after { animation: none !important; transition: none !important; }
}
