/* A5 Color Code — customer app.
   Mobile-first. The colour sections are the product: they must read like the
   banners hanging above the aisles.

   Note: this renders inside the A5 theme, which styles buttons and inputs
   aggressively (red fills, uppercase, shadows). Everything below is reset
   explicitly rather than relying on defaults. */

.a5cc {
	--a5cc-accent: #d81f26; /* A5 red */
	--a5cc-ink: #1d1d1f;
	--a5cc-muted: #6b6b70;
	--a5cc-line: #e5e5e8;
	--a5cc-surface: #fff;

	max-width: 560px;
	margin: 0 auto;
	padding: 16px 16px 48px;
	font-size: 16px;
	line-height: 1.5;
	color: var(--a5cc-ink);
	-webkit-text-size-adjust: 100%;
}

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

/* Any author-set `display` beats the UA's `[hidden] { display: none }`, so
   elements toggled via the hidden attribute must be forced closed here. */
.a5cc [hidden] { display: none !important; }

.a5cc h2 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; font-weight: 600; }
.a5cc h3 { font-size: 17px; margin: 0 0 8px; font-weight: 600; }
.a5cc p { margin: 0 0 12px; }
.a5cc-lead { color: var(--a5cc-muted); margin: 0 0 16px; }
.a5cc-hint { color: var(--a5cc-muted); font-size: 14px; margin: 0 0 12px; }

/* Header */

.a5cc-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
}
.a5cc-logo { max-height: 40px; width: auto; }
.a5cc-store {
	margin: 0;
	font-size: 14px;
	color: var(--a5cc-muted);
	font-weight: 500;
}

/* Cards */

.a5cc-card {
	background: var(--a5cc-surface);
	border: 1px solid var(--a5cc-line);
	border-radius: 14px;
	padding: 18px;
	margin-bottom: 12px;
}

.a5cc-or {
	text-align: center;
	color: var(--a5cc-muted);
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin: 14px 0;
}

/* Buttons — fully reset, the theme is opinionated */

/* Themes commonly style every <button> with !important, so these resets have
   to match that force or the controls come out as red blocks. */
.a5cc .a5cc-btn,
.a5cc .a5cc-back,
.a5cc .a5cc-alt-toggle,
.a5cc .a5cc-row {
	appearance: none !important;
	-webkit-appearance: none !important;
	background-image: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	font-family: inherit;
	line-height: 1.4;
	transition: none;
	width: auto;
	min-height: 0;
}

.a5cc .a5cc-btn {
	display: block;
	width: 100% !important;
	padding: 15px 16px !important;
	margin-top: 12px;
	border: 0 !important;
	border-radius: 10px !important;
	font-size: 17px;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	background: var(--a5cc-accent) !important;
	color: #fff !important;
}
.a5cc .a5cc-btn:hover { background: #b91a20 !important; }

/* Hover, focus and active are styled explicitly for every variant. A theme
   that only sets `button:hover { background: red }` would otherwise repaint
   these on hover and leave red text on a red fill. The doubled class raises
   specificity above the theme's descendant selectors. */

.a5cc .a5cc-btn.a5cc-btn-secondary,
.a5cc .a5cc-btn.a5cc-btn-secondary:hover,
.a5cc .a5cc-btn.a5cc-btn-secondary:focus,
.a5cc .a5cc-btn.a5cc-btn-secondary:active {
	background: #fff !important;
	color: var(--a5cc-accent) !important;
	box-shadow: inset 0 0 0 2px var(--a5cc-accent) !important;
}
.a5cc .a5cc-btn.a5cc-btn-secondary:hover {
	background: #fdf1f1 !important;
	color: #a5161c !important;
	box-shadow: inset 0 0 0 2px #a5161c !important;
}

.a5cc .a5cc-btn.a5cc-btn-link,
.a5cc .a5cc-btn.a5cc-btn-link:hover,
.a5cc .a5cc-btn.a5cc-btn-link:focus,
.a5cc .a5cc-btn.a5cc-btn-link:active {
	background: none !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: var(--a5cc-accent) !important;
	font-weight: 500;
	font-size: 15px;
	padding: 12px !important;
}
.a5cc .a5cc-btn.a5cc-btn-link:hover {
	color: #a5161c !important;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.a5cc button.a5cc-back,
.a5cc button.a5cc-back:hover,
.a5cc button.a5cc-back:focus,
.a5cc button.a5cc-back:active {
	border: 0 !important;
	background: none !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: var(--a5cc-accent) !important;
	padding: 0 0 14px !important;
	font-size: 15px;
	cursor: pointer;
}
.a5cc button.a5cc-back:hover { color: #a5161c !important; text-decoration: underline; }

/* Inputs */

.a5cc input[type='search'],
.a5cc textarea {
	width: 100%;
	padding: 13px 14px;
	border: 1px solid #ccccd0;
	border-radius: 10px;
	font-size: 16px; /* 16px stops iOS zooming on focus */
	font-family: inherit;
	background: #fff;
	color: var(--a5cc-ink);
}
.a5cc input[type='search']:focus,
.a5cc textarea:focus {
	outline: 2px solid var(--a5cc-accent);
	outline-offset: 1px;
	border-color: transparent;
}

/* Details form */

.a5cc-field { display: block; margin-bottom: 14px; }
.a5cc-field-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 5px;
}

.a5cc input[type='text'],
.a5cc input[type='email'] {
	width: 100%;
	padding: 13px 14px;
	border: 1px solid #ccccd0;
	border-radius: 10px;
	font-size: 16px; /* 16px stops iOS zooming on focus */
	font-family: inherit;
	background: #fff;
	color: var(--a5cc-ink);
}
.a5cc input[type='text']:focus,
.a5cc input[type='email']:focus {
	outline: 2px solid var(--a5cc-accent);
	outline-offset: 1px;
	border-color: transparent;
}

.a5cc-consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 14px;
	line-height: 1.45;
	color: #3a3a3f;
	margin: 4px 0 10px;
	cursor: pointer;
}
.a5cc-consent input[type='checkbox'] {
	width: 22px;
	height: 22px;
	margin: 0;
	flex-shrink: 0;
	accent-color: var(--a5cc-accent);
}

.a5cc-declaration {
	background: #fbf7ee;
	border: 1px solid #edd9a8;
	border-radius: 8px;
	padding: 10px 12px;
}
.a5cc-required { color: #a3271f; font-weight: 600; }

.a5cc-error {
	color: #a3271f;
	background: #fdecea;
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 14px;
	margin: 0 0 4px;
}

.a5cc-fineprint {
	font-size: 12px;
	line-height: 1.5;
	color: #8a8a90;
	margin: 12px 0 0;
}
.a5cc-fineprint a { color: var(--a5cc-accent); }

/* Search and grade rows */

.a5cc-results { margin-top: 10px; }

.a5cc .a5cc-row {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
	padding: 14px;
	margin-bottom: 8px;
	background: #f6f6f7;
	border: 1px solid var(--a5cc-line);
	border-radius: 10px;
	text-align: left;
	cursor: pointer;
	font-size: 16px;
	color: var(--a5cc-ink);
}
.a5cc .a5cc-row:hover { background: #efeff1; }
.a5cc-row-title { font-weight: 600; }
.a5cc-row-sub { font-size: 13px; color: var(--a5cc-muted); }

/* Processing */

.a5cc-spinner {
	width: 36px;
	height: 36px;
	margin: 28px auto 18px;
	border: 3px solid var(--a5cc-line);
	border-top-color: var(--a5cc-accent);
	border-radius: 50%;
	animation: a5cc-spin 0.9s linear infinite;
}
@keyframes a5cc-spin { to { transform: rotate(360deg); } }

.a5cc-progress-track {
	height: 6px;
	background: #ececed;
	border-radius: 3px;
	overflow: hidden;
	margin: 14px 0 10px;
}

.a5cc-progress-bar {
	height: 100%;
	width: 0;
	background: var(--a5cc-accent);
	border-radius: 3px;
	transition: width 0.5s linear;
}

/* Result header and overall tracker */

.a5cc-result-head { margin-bottom: 14px; }
.a5cc-result-sub { color: var(--a5cc-muted); font-size: 15px; margin: 0; }

.a5cc-tracker {
	position: sticky;
	top: 0;
	z-index: 5;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: saturate(180%) blur(8px);
	border: 1px solid var(--a5cc-line);
	border-radius: 12px;
	padding: 12px 14px 6px;
	margin-bottom: 16px;
}
.a5cc-tracker-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 14px;
	font-weight: 600;
}
.a5cc-tracker-row span:last-child { color: var(--a5cc-muted); font-weight: 500; }
.a5cc-tracker .a5cc-progress-track { margin: 8px 0 6px; }

/* Download prompt, above the list */

.a5cc-download-cta {
	margin-bottom: 18px;
}
.a5cc-download-cta .a5cc-btn {
	margin-top: 0;
}
.a5cc-download-cta .a5cc-hint {
	text-align: center;
	margin: 8px 0 0;
	font-size: 13px;
}

/* Colour sections — the banner metaphor */

.a5cc-section {
	background: var(--a5cc-surface);
	border: 1px solid var(--a5cc-line);
	border-radius: 14px;
	margin-bottom: 14px;
	/* No overflow:hidden — it would break the sticky header below. */
}

.a5cc-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 13px 16px;
	border-radius: 13px 13px 0 0;
	/* White and yellow sections need an edge or they vanish on white */
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
	/* Sticks under the tracker so you can always see which colour section
	   you're standing in, even halfway down a long list. */
	position: sticky;
	top: 68px;
	z-index: 3;
}

.a5cc-section-name {
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.a5cc-section-count {
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	opacity: 0.85;
}

.a5cc-section.complete { opacity: 0.55; }

/* Items */

.a5cc-items { padding: 4px 16px 8px; }

.a5cc-item {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 14px 0;
	border-top: 1px solid #f2f2f4;
	cursor: pointer;
}
.a5cc-items > .a5cc-item:first-of-type { border-top: 0; }
.a5cc-item-plain { cursor: default; }

.a5cc .a5cc-check {
	appearance: none;
	-webkit-appearance: none;
	width: 26px;
	height: 26px;
	margin: 0;
	flex-shrink: 0;
	border: 2px solid #bfbfc4;
	border-radius: 7px;
	background: #fff;
	cursor: pointer;
	position: relative;
}
.a5cc .a5cc-check:checked {
	background: var(--a5cc-section-color, var(--a5cc-accent));
	border-color: rgba(0, 0, 0, 0.2);
}
.a5cc .a5cc-check:checked::after {
	content: '';
	position: absolute;
	left: 7px;
	top: 2px;
	width: 6px;
	height: 12px;
	/* Tick colour follows the section, so it stays legible on yellow and white */
	border: solid var(--a5cc-section-ink, #fff);
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
}

.a5cc-item-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	flex: 1;
}

.a5cc-item-head {
	display: flex;
	gap: 8px;
	align-items: baseline;
}

.a5cc-qty {
	font-size: 15px;
	font-weight: 700;
	color: var(--a5cc-ink);
	background: #f0f0f2;
	border-radius: 6px;
	padding: 2px 7px;
	flex-shrink: 0;
}

.a5cc-item-name {
	font-size: 16px;
	font-weight: 500;
	line-height: 1.35;
}

.a5cc-item.done .a5cc-item-name,
.a5cc-item.done .a5cc-qty {
	text-decoration: line-through;
	color: #a0a0a6;
}
.a5cc-item.done .a5cc-qty { background: #f7f7f8; }

.a5cc-item-source {
	font-size: 13px;
	color: var(--a5cc-muted);
	line-height: 1.4;
}

.a5cc-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.a5cc-tag {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	background: #eef0f3;
	color: #55565b;
	border-radius: 5px;
	padding: 3px 7px;
}
.a5cc-tag-warn { background: #fdecea; color: #a3271f; }

/* Alternatives */

.a5cc button.a5cc-alt-toggle,
.a5cc button.a5cc-alt-toggle:hover,
.a5cc button.a5cc-alt-toggle:focus,
.a5cc button.a5cc-alt-toggle:active {
	align-self: flex-start;
	background: none !important;
	background-color: transparent !important;
	box-shadow: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 4px 0 !important;
	color: var(--a5cc-accent) !important;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.a5cc button.a5cc-alt-toggle:hover { color: #a5161c !important; }
.a5cc .a5cc-alt-toggle::after { content: ' ▾'; text-decoration: none; }
.a5cc .a5cc-alt-toggle.open::after { content: ' ▴'; }

.a5cc-alt-list {
	padding: 4px 0 2px 12px;
	border-left: 3px solid var(--a5cc-line);
	margin-top: 4px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: flex-start;
}

/* Each alternative is a button — tapping it swaps the product in */
.a5cc .a5cc-alt {
	appearance: none !important;
	-webkit-appearance: none !important;
	background: #f6f6f7 !important;
	background-image: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	border: 1px solid var(--a5cc-line) !important;
	border-radius: 8px !important;
	color: #35353a !important;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.35;
	text-align: left;
	width: 100% !important;
	padding: 9px 11px !important;
	cursor: pointer;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.a5cc button.a5cc-alt:hover,
.a5cc button.a5cc-alt:focus,
.a5cc button.a5cc-alt:active {
	background: #efeff1 !important;
	color: #35353a !important;
	box-shadow: none !important;
}
.a5cc .a5cc-alt::after {
	content: 'Use this';
	margin-left: auto;
	font-size: 12px;
	font-weight: 600;
	color: var(--a5cc-accent);
	white-space: nowrap;
}

.a5cc-tag-swap { background: #e6f0fb; color: #14538f; }

/* Toast — confirms a swap, and says where the item moved to */

.a5cc-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translate(-50%, 12px);
	z-index: 50;
	max-width: 88%;
	background: #1d1d1f;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	padding: 11px 16px;
	border-radius: 22px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.a5cc-toast.visible { opacity: 1; transform: translate(-50%, 0); }

.a5cc-section-unmatched .a5cc-items { padding-top: 12px; }
