/* ==============================================
   style.css — carmates
   ============================================== */


/********** COLOUR VARIABLES **********/

:root {
	--bg:           #0f1117;
	--bg-card:      #1a1f2e;
	--bg-nav:       #0f1117cc;

	--text:         #e8eaf0;
	--text-muted:   #6b7280;

	--green:        #34d058;
	--green-dim:    #166534;

	--border:       #2a2f3e;
	--border-hover: #4a4f5e;

	--radius:       12px;
}


/********** LIGHT MODE **********/

[data-theme="light"] {
	--bg:           #f5f6f7;
	--bg-card:      #ffffff;
	--bg-nav:       #f5f6f7cc;

	--text:         #111318;
	--text-muted:   #6b7280;

	--green:        #16a34a;
	--green-dim:    #dcfce7;

	--border:       rgba(0, 0, 0, 0.08);
	--border-hover: rgba(0, 0, 0, 0.18);
}


/********** RESET **********/

*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}


/********** BASE **********/

body {
	background-color: var(--bg);
	color: var(--text);
	font-family: system-ui, -apple-system, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	scrollbar-gutter: stable;
}

a {
	color: inherit;
	text-decoration: none;
}

img {
	max-width: 100%;
	display: block;
}


/********** NAV **********/

nav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 10000;

	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;

	padding: 0 40px;
	height: 60px;

	background-color: var(--bg-nav);
	border-bottom: 1px solid var(--border);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);

	transition: padding 0.3s ease, background-color 0.3s ease;
}

nav.scrolled {
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
}

nav ul {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 32px;
}

nav ul a {
	font-size: 14px;
	color: var(--text-muted);
	transition: color 0.2s;
}

nav ul a:hover { color: var(--text); }


/********** LOGO **********/

.logo {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 36px;
	font-weight: 700;
	color: var(--green);
	letter-spacing: -0.03em;
	transition: opacity 0.2s;
	flex-shrink: 0;
}

.logo:hover { opacity: 0.82; }

/* Dot is always visible and glowing — no hover trick */
.logo-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--green);
	box-shadow: 0 0 10px var(--green);
	flex-shrink: 0;
}


/********** NAV CONTROLS **********/

.nav-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.lang-toggle {
	display: flex;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 100px;
	padding: 3px;
	gap: 2px;
}

.lang-btn {
	background: none;
	border: none;
	border-radius: 100px;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 600;
	color: var(--text-muted);
	cursor: pointer;
	transition: all 0.2s;
	letter-spacing: 0.03em;
}

.lang-btn.active                { background-color: var(--green); color: #ffffff; }
.lang-btn:not(.active):hover    { color: var(--text); }



/********** THEME TOGGLE **********/

/* The sliding pill toggle */
.theme-toggle {
	width: 44px;
	height: 24px;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 100px;
	cursor: pointer;
	position: relative;
	flex-shrink: 0;
	transition: background 0.35s, border-color 0.35s;
}

/* The sliding circle */
.theme-toggle::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background-color: var(--text-muted);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
}

/* In light mode the circle slides right and turns green */
[data-theme="light"] .theme-toggle::after {
	transform: translateX(20px);
	background-color: var(--green);
}

/* The 🌙 and ☀️ sit inside the pill */
.theme-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 5px;
	font-size: 9px;
	pointer-events: none;
	user-select: none;
}
[data-theme="dark"]  .theme-icon-light { display: none; }
[data-theme="dark"]  .theme-icon-dark  { display: block; }
[data-theme="light"] .theme-icon-dark  { display: none; }
[data-theme="light"] .theme-icon-light { display: block; }

.nav-cta {
	padding: 6px 14px;
	border: 1px solid var(--green);
	border-radius: 100px;
	color: var(--green) !important;
	font-size: 13px;
	font-weight: 500;
	transition: background-color 0.2s;
}

.nav-cta:hover { background-color: var(--green-dim); }


/********** BUTTONS **********/

.btn-primary {
	display: inline-block;
	background-color: var(--green);
	color: #ffffff;
	font-weight: 600;
	font-size: 14px;
	padding: 12px 24px;
	border-radius: 100px;
	border: none;
	cursor: pointer;
	transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
	display: inline-block;
	background-color: transparent;
	color: var(--text);
	font-weight: 500;
	font-size: 14px;
	padding: 12px 24px;
	border-radius: 100px;
	border: 1px solid var(--border);
	cursor: pointer;
	transition: border-color 0.2s;
}

.btn-secondary:hover { border-color: var(--border-hover); }


/********** SECTION LAYOUT **********/

section {
	max-width: 960px;
	margin: 0 auto;
	padding: 80px 40px;
}

.section-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--green);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: 12px;
}

section h2 {
	font-size: clamp(28px, 4vw, 42px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.03em;
	margin-bottom: 48px;
}

section h2 em {
	font-style: normal;
	color: var(--green);
}


/********** HERO **********/

.hero {
	padding-top: 140px;
	text-align: center;
	max-width: 720px;
}

.hero h1 {
	font-size: clamp(36px, 6vw, 64px);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.04em;
	margin-bottom: 24px;
}

.hero h1 em      { font-style: normal; color: var(--green); }

.hero > p {
	font-size: 17px;
	color: var(--text-muted);
	max-width: 560px;
	margin: 0 auto 36px;
}

.hero-buttons {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
	margin-bottom: 32px;
}


/********** HERO SEARCH **********/

#index-search-form {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-bottom: 32px;
}

#index-search {
	width: 320px;
	padding: 12px 18px;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 100px;
	color: var(--text);
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s;
}

#index-search:focus         { border-color: var(--green); }
#index-search::placeholder  { color: var(--text-muted); }


/********** PREVIEW CARD **********/

.preview-card {
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
	max-width: 340px;
	margin: 0 auto;
	text-align: left;
}

.preview-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.preview-icon { font-size: 24px; }

.preview-header strong { display: block; font-size: 15px; }
.preview-header span   { font-size: 12px; color: var(--text-muted); }

.preview-rating {
	margin-left: auto;
	font-size: 13px;
	color: #f59e0b;
}

.preview-services {
	list-style: none;
	margin-bottom: 16px;
}

.preview-services li {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	padding: 6px 0;
	border-bottom: 1px solid var(--border);
}

.preview-services li:last-child { border-bottom: none; }

.preview-card button {
	width: 100%;
	background-color: var(--green);
	color: #ffffff;
	border: none;
	border-radius: 100px;
	padding: 10px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s;
}

.preview-card button:hover { opacity: 0.85; }


/********** STATS **********/

.stats {
	max-width: 100%;
	padding: 40px;
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
	display: flex;
	justify-content: center;
	gap: 80px;
	flex-wrap: wrap;
	text-align: center;
}

.stats strong {
	display: block;
	font-size: 36px;
	font-weight: 700;
	color: var(--green);
}

.stats p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }


/********** HOW IT WORKS **********/

.steps {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	counter-reset: steps;
}

.steps li {
	counter-increment: steps;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 28px;
}

.steps li::before {
	content: counter(steps, decimal-leading-zero);
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--green);
	margin-bottom: 12px;
	letter-spacing: 0.05em;
}

.step-icon { display: block; font-size: 28px; margin-bottom: 12px; }
.steps h3  { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.steps p   { font-size: 13px; color: var(--text-muted); line-height: 1.6; }


/********** FOR WHO **********/

.audience-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}

.audience-card {
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 32px;
}

.audience-tag {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	color: var(--green);
	background-color: var(--green-dim);
	padding: 3px 10px;
	border-radius: 100px;
	margin-bottom: 16px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.audience-card h3  { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.audience-card > p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

.audience-card ul {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.audience-card ul li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.audience-card ul li          { font-size: 14px; color: var(--text-muted); }


/********** WAITLIST FORM **********/

#waitlist            { text-align: center; }
#waitlist h2         { margin-bottom: 12px; }
#waitlist > p        { color: var(--text-muted); margin-bottom: 32px; }

#waitlist-form {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
	max-width: 480px;
	margin: 0 auto 16px;
}

#waitlist-form input[type="email"] {
	flex: 1;
	min-width: 200px;
	padding: 12px 18px;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 100px;
	color: var(--text);
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s;
}

#waitlist-form input[type="email"]:focus { border-color: var(--green); }
#waitlist-form input::placeholder        { color: var(--text-muted); }

#waitlist-form button {
	background-color: var(--green);
	color: #ffffff;
	font-weight: 600;
	font-size: 14px;
	padding: 12px 24px;
	border-radius: 100px;
	border: none;
	cursor: pointer;
	transition: opacity 0.2s;
}

#waitlist-form button:hover { opacity: 0.85; }

#form-message         { font-size: 14px; min-height: 20px; }
#form-message.success { color: var(--green); }
#form-message.error   { color: #f87171; }


/********** FOOTER **********/

footer {
	border-top: 1px solid var(--border);
	padding: 40px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
}

footer p       { font-size: 13px; color: var(--text-muted); }
footer ul      { list-style: none; display: flex; gap: 24px; }
footer ul a    { font-size: 13px; color: var(--text-muted); transition: color 0.2s; }
footer ul a:hover { color: var(--text); }


/************************************/
/********** RESULTS PAGE ************/
/************************************/

/********** PAGE HEADER **********/

.dir-header {
	padding-top: 120px;
	padding-bottom: 0;
}

.dir-header h1 {
	font-size: clamp(28px, 4vw, 42px);
	font-weight: 700;
	letter-spacing: -0.03em;
	margin-bottom: 8px;
}

.dir-header p { font-size: 15px; color: var(--text-muted); }
#result-count  { font-size: 13px; color: var(--text-muted); margin-top: 4px; margin-bottom: 20px; }


/********** SEARCH TOOLBAR **********/

.toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding-top: 16px;
	padding-bottom: 16px;
}

#search-input {
	flex: 1;
	min-width: 200px;
	padding: 10px 18px 10px 42px;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 100px;
	color: var(--text);
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s;
}

#search-input:focus        { border-color: var(--green); }
#search-input::placeholder { color: var(--text-muted); }

/* Sort: icon sits visually inside the box, select overlaps it transparent */
.sort-wrap {
	position: relative;
	display: flex;
	align-items: center;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 10px;
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	transition: border-color 0.2s;
}

.sort-wrap:hover { border-color: var(--border-hover); }

.sort-icon-svg {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 20px;
	height: 20px;
	color: var(--text-muted);
	pointer-events: none;
}

#sort-select {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
	border: none;
	background: transparent;
	font-size: 13px;
}

#sort-select:focus + .sort-icon-svg,
.sort-wrap:focus-within { border-color: var(--green); }
.sort-wrap:focus-within  { border-color: var(--green); }

#sort-select option { background-color: var(--bg-card); color: var(--text); }


.filter-btn {
	padding: 8px 16px;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 100px;
	color: var(--text-muted);
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s;
	white-space: nowrap;
}

.filter-btn:hover  { border-color: var(--border-hover); color: var(--text); }

.filter-btn.active {
	background-color: var(--green-dim);
	border-color: var(--green);
	color: var(--green);
	font-weight: 600;
}

#sort-select {
	padding: 10px 16px;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 100px;
	color: var(--text-muted);
	font-size: 13px;
	outline: none;
	cursor: pointer;
	transition: border-color 0.2s;
}

#sort-select:focus  { border-color: var(--green); }
#sort-select option { background-color: var(--bg-card); color: var(--text); }


/********** WORKSHOP CARDS **********/

#card-grid {
	max-width: 960px;
	margin: 0 auto;
	padding: 0 40px 80px;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	align-items: start;
}

#loading-message {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--text-muted);
	padding: 60px 0;
}

.workshop-card {
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition: border-color 0.2s;
}

.workshop-card:hover  { border-color: var(--border-hover); }
.workshop-card.hidden { display: none; }

.card-top { display: flex; align-items: flex-start; gap: 10px; }
.card-icon    { font-size: 22px; flex-shrink: 0; }
.card-name    { font-size: 15px; font-weight: 600; line-height: 1.3; }
.card-address { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.card-rating {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--text-muted);
}

.card-stars { color: #f59e0b; }

.card-partner-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	color: var(--green);
	background-color: var(--green-dim);
	padding: 2px 8px;
	border-radius: 100px;
}

.card-tags  { display: flex; flex-wrap: wrap; gap: 5px; }

.card-tag {
	font-size: 11px;
	padding: 3px 8px;
	border: 1px solid var(--border);
	border-radius: 100px;
	color: var(--text-muted);
}

.card-spacer  { flex: 1; }
.card-actions { display: flex; gap: 8px; }

.card-actions a {
	flex: 1;
	text-align: center;
	padding: 8px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 500;
	transition: opacity 0.2s;
}

.card-actions .action-primary   { background-color: var(--green); color: #ffffff; }
.card-actions .action-secondary { border: 1px solid var(--border); color: var(--text-muted); }
.card-actions a:hover            { opacity: 0.8; }


/*********************************************/
/********** RESPONSIVE — MOBILE/TAB **********/
/*********************************************/

@media (max-width: 768px) {

	nav ul    { display: none; }
	nav       { padding: 0 20px; }
	section   { padding: 60px 20px; }

	.steps          { grid-template-columns: 1fr; }
	.audience-grid  { grid-template-columns: 1fr; }

	#card-grid {
		grid-template-columns: repeat(2, 1fr);
		padding: 0 20px 60px;
	}

	.stats  { gap: 40px; padding: 40px 20px; }

	footer {
		flex-direction: column;
		align-items: flex-start;
		padding: 32px 20px;
	}
}

@media (max-width: 600px) {
	#card-grid      { grid-template-columns: 1fr; }
	.dir-header     { padding-left: 20px; padding-right: 20px; }
	.toolbar        { padding-left: 20px; padding-right: 20px; }
	.filter-section { padding-left: 0; padding-right: 0; }

	/* List mode on mobile: drop the mid column, keep name + action only */
	#card-grid.list-mode .lr {
		padding: 10px 12px;
	}

	.lr-name {
		width: auto;
		flex: 1;
		border-right: none;
		padding-right: 0;
	}

	.lr-mid {
		display: none;
	}

	.lr-action {
		padding-left: 10px;
	}

	/* Expand panel goes single-column */
	.lr-expand {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.hero h1 { font-size: 32px; }
}

/* ==============================================
CARDS, LIST MODE, LANGUAGE, ETC
   ============================================== */


/********** FILTER ROW (results page) **********/

.filter-section {
	padding-top: 0;
	padding-bottom: 0;
}

.filter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	padding: 0 40px 20px;
	max-width: 960px;
	margin: 0 auto;
}


/********** SEARCH OUTER (with autocomplete) **********/

.search-outer {
	flex: 1;
	min-width: 200px;
	position: relative;
}

.search-input {
	width: 100%;
	padding: 10px 18px 10px 42px;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 100px;
	color: var(--text);
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s;
}

.search-input:focus        { border-color: var(--green); }
.search-input::placeholder { color: var(--text-muted); }

/* Magnifier icon inside the input */
.search-icon {
	position: absolute;
	left: 13px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	pointer-events: none;
	color: var(--text-muted);
}


/********** AUTOCOMPLETE DROPDOWN **********/

.ac-drop {
	display: none;
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 5000;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0,0,0,.35);
}

.ac-drop.open { display: block; }

.ac-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	cursor: pointer;
	border-bottom: 1px solid var(--border);
	transition: background 0.1s;
}

.ac-item:last-child          { border-bottom: none; }
.ac-item:hover,
.ac-item.focused             { background-color: var(--bg-card); filter: brightness(1.1); }

.ac-icon  { font-size: 18px; flex-shrink: 0; }

.ac-text  { flex: 1; min-width: 0; }
.ac-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.ac-name mark { background: none; color: var(--green); font-weight: 600; }
.ac-sub   { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ac-label {
	font-size: 10.5px;
	padding: 2px 8px;
	border-radius: 4px;
	background-color: var(--green-dim);
	color: var(--green);
	white-space: nowrap;
	flex-shrink: 0;
}


/********** VIEW TOGGLE (grid / list) **********/

.view-toggle {
	display: flex;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 3px;
	gap: 2px;
	flex-shrink: 0;
}

.view-btn {
	background: none;
	border: none;
	border-radius: 7px;
	width: 32px;
	height: 32px;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--text-muted);
	transition: all 0.2s;
}

.view-btn.active {
	background-color: var(--green);
	color: #ffffff;
}


/********** FILTER BUTTON — CLEAR **********/

.filter-btn-clear {
	background: rgba(239,68,68,.08);
	border-color: rgba(239,68,68,.3);
	color: #f87171;
}
.filter-btn-clear:hover {
	background: rgba(239,68,68,.15);
	border-color: rgba(239,68,68,.5);
	color: #f87171;
}
[data-theme="light"] .filter-btn-clear       { color: #dc2626; }
[data-theme="light"] .filter-btn-clear:hover { color: #b91c1c; }


/********** RICH CARD — GRID MODE **********/

.card {
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	display: flex;
	flex-direction: column;
	height: 400px;
	overflow: hidden;
	transition: border-color 0.2s;
}

.card:hover  { border-color: var(--border-hover); }
.card.hidden { display: none !important; }

/* Static header — name + area + rating in one row */
.card-static {
	padding: 14px 14px 10px;
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
	overflow: hidden;
}

.card-static-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 3px;
}

.c-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--text);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
	flex: 1;
}

.c-rating-inline {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 11.5px;
	color: var(--text-muted);
	flex-shrink: 0;
	white-space: nowrap;
}

.c-area {
	font-size: 11.5px;
	color: var(--text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.c-count { color: var(--text-muted); }
.stars   { color: #f59e0b; font-size: 11px; }

/* Flip zone fills remaining height */
.card-body-wrap {
	flex: 1;
	overflow: hidden;
	position: relative;
	min-height: 0;
}

.card-front,
.card-back {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	display: flex;
	flex-direction: column;
	transition: opacity 0.22s ease;
}

.card-front { opacity: 1; pointer-events: auto; }

.card.flipped .card-front { opacity: 0; pointer-events: none; }

/* Action buttons */
.z-actions {
	display: flex;
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
}

.qa {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	padding: 10px 6px;
	font-size: 11px;
	color: var(--text-muted);
	border-right: 1px solid var(--border);
	transition: background 0.15s, color 0.15s;
	text-decoration: none;
	cursor: pointer;
}

.qa:last-child { border-right: none; }
.qa:hover      { background-color: var(--green-dim); color: var(--green); }
.qa svg        { stroke: currentColor; }

/* Hours dropdown */
.z-hours {
	padding: 12px 14px 0;
	flex-shrink: 0;
}

.hrow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	padding-bottom: 4px;
}

.hrow-left {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	flex: 1;
	overflow: hidden;
}

.hst {
	font-size: 12px;
	font-weight: 600;
	flex-shrink: 0;
}
.hst.open   { color: var(--green); }
.hst.closed { color: #f87171; }
[data-theme="light"] .hst.closed { color: #dc2626; }

.hnext {
	font-size: 11px;
	color: var(--text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hchev {
	color: var(--text-muted);
	display: inline-flex;
	align-items: center;
	transition: transform 0.28s;
}

.card.hopen .hchev { transform: rotate(180deg); }

.hours-exp {
	overflow: hidden;
	max-height: 0;
	transition: max-height 0.32s cubic-bezier(0.4,0,0.2,1);
}

.hours-exp.open { max-height: 210px; }

.hday {
	display: flex;
	justify-content: space-between;
	font-size: 11.5px;
	padding: 3px 0;
	border-bottom: 1px solid var(--border);
}
.hday:last-child { border-bottom: none; }

.hday-name       { color: var(--text-muted); }
.hday-name.today { color: var(--text); font-weight: 600; }
.hday-time       { color: var(--text-muted); }
.hday-time.cr    { color: #f87171; }
[data-theme="light"] .hday-time.cr { color: #dc2626; }

/* Back content — two equal halves */
.card-back {
	opacity: 0;
	pointer-events: none;
	padding: 14px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.card.flipped .card-back { opacity: 1; pointer-events: auto; }

.back-half {
	flex: 1;
	min-height: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.back-half + .back-half {
	border-top: 1px solid var(--border);
	padding-top: 10px;
	margin-top: 10px;
}

.back-section-title {
	font-size: 10px;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.07em;
	margin-bottom: 6px;
	font-weight: 600;
	flex-shrink: 0;
}

.back-service-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 3px;
	overflow: hidden;
}

.back-service-list li {
	font-size: 12px;
	color: var(--text-muted);
	padding-left: 12px;
	position: relative;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.back-service-list li::before {
	content: '·';
	position: absolute;
	left: 0;
	color: var(--border-hover);
}

.back-links      { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.back-link-row   { display: flex; align-items: center; gap: 8px; font-size: 11.5px; min-width: 0; }
.back-link-label { color: var(--text-muted); min-width: 54px; flex-shrink: 0; font-size: 11px; }

a.back-link-val {
	color: var(--text-muted);
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	display: block;
	flex: 1;
	min-width: 0;
	transition: color 0.15s;
	font-size: 11.5px;
}
a.back-link-val:hover { color: var(--green); }

/* Fixed bottom button */
.card-btn-wrap {
	padding: 10px 14px 14px;
	flex-shrink: 0;
	border-top: 1px solid var(--border);
}

.card-btn-action {
	background: none;
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--text-muted);
	font-size: 12px;
	padding: 8px;
	cursor: pointer;
	width: 100%;
	transition: border-color 0.15s, color 0.15s;
	font-family: inherit;
	text-align: center;
	display: block;
}
.card-btn-action:hover { border-color: var(--border-hover); color: var(--text); }


/********** MAP **********/

.map-section {
	max-width: 960px;
	margin: 0 auto;
	padding: 0 40px 20px;
}

.map-wrap {
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid var(--border);
	height: 400px;
	transition: height 0.35s cubic-bezier(0.4,0,0.2,1), border-color 0.2s;
}

.map-wrap.expanded { height: 680px; }

#workshop-map {
	width: 100%;
	height: 100%;
}

/* Override Leaflet default controls — hide them, we use our own */
.leaflet-control-zoom { display: none !important; }
.leaflet-control-attribution {
	font-size: 9px;
	opacity: 0.5;
	background: transparent !important;
	color: var(--text-muted) !important;
}

/* Custom map controls */
.map-controls {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.map-btn {
	width: 36px;
	height: 36px;
	background-color: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 10px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.15s, background-color 0.15s;
	color: var(--text-muted);
}

.map-btn svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
}

.map-btn:hover {
	border-color: var(--border-hover);
	color: var(--text);
}

.map-btn.active {
	background-color: var(--green);
	border-color: var(--green);
	color: #ffffff;
}

.map-btn.active svg { stroke: #ffffff; }

/* Custom pin marker */
.map-pin {
	background-color: var(--green);
	border: 2px solid #ffffff;
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	box-shadow: 0 2px 8px rgba(0,0,0,0.3);
	transition: transform 0.15s;
}

.map-pin.active {
	background-color: var(--text);
	transform: rotate(-45deg) scale(1.2);
}

/* Leaflet popup override */
.leaflet-popup-content-wrapper {
	background-color: var(--bg-card) !important;
	border: 1px solid var(--border) !important;
	border-radius: 12px !important;
	box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
	padding: 0 !important;
}

.leaflet-popup-content {
	margin: 0 !important;
	min-width: 180px;
}

.leaflet-popup-tip-container { display: none; }

.leaflet-popup-close-button {
	color: var(--text-muted) !important;
	font-size: 18px !important;
	top: 6px !important;
	right: 8px !important;
}

.map-popup {
	padding: 12px 14px;
}

.map-popup-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
	margin-bottom: 2px;
}

.map-popup-area {
	font-size: 11.5px;
	color: var(--text-muted);
	margin-bottom: 6px;
}

.map-popup-row {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11.5px;
	color: var(--text-muted);
}

.map-popup-open  { color: var(--green); font-weight: 600; }
.map-popup-closed { color: #f87171; font-weight: 600; }

[data-theme="light"] .map-popup-closed { color: #dc2626; }

/* Dark map tiles tint for dark mode */
[data-theme="dark"] #workshop-map { filter: brightness(0.85) invert(1) hue-rotate(180deg); }
[data-theme="dark"] .map-pin      { filter: invert(1) hue-rotate(180deg); }

@media (max-width: 600px) {
	.map-section { padding: 0 20px 16px; }
	.map-wrap    { height: 280px; border-radius: 12px; }
	.map-wrap.expanded { height: 480px; }
}


/********** LIST MODE **********/

/* In list mode the grid becomes a single column bordered list */
#card-grid.list-mode {
	grid-template-columns: 1fr;
	gap: 0;
}

#card-grid.list-mode .card {
	border-radius: 0;
	border-left: none;
	border-right: none;
	border-bottom: none;
	height: auto;
	overflow: visible;
}

#card-grid.list-mode .card:first-child { border-top: 1px solid var(--border); }
#card-grid.list-mode .card:last-child  { border-bottom: 1px solid var(--border); }

/* In list mode, hide the grid-only parts */
#card-grid.list-mode .card-static,
#card-grid.list-mode .card-body-wrap,
#card-grid.list-mode .card-btn-wrap { display: none; }

/* In list mode, show the list row */
#card-grid.list-mode .lr { display: flex; }

/* List row */
.lr {
	display: none; /* hidden in grid mode */
	align-items: center;
	padding: 12px 16px;
	gap: 0;
	cursor: default;
	transition: background 0.1s;
	min-width: 0;
	overflow: hidden;
}

.lr:hover { background-color: var(--bg-card); filter: brightness(1.08); }

.lr-name {
	font-size: 13.5px;
	font-weight: 500;
	color: var(--text);
	width: 200px;
	min-width: 0;
	flex-shrink: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding-right: 12px;
	border-right: 1px solid var(--border);
}

.lr-mid {
	flex: 1;
	padding: 0 14px;
	min-width: 0;
	border-right: 1px solid var(--border);
}

.lr-rating {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	color: var(--text-muted);
}

.lr-count { color: var(--text-muted); }

.lr-addr {
	font-size: 11.5px;
	color: var(--text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-top: 2px;
}

.lr-action {
	padding-left: 14px;
	display: flex;
	align-items: center;
}

/* Navigation button in list row */
.btn-nav {
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background-color: var(--green);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: #ffffff;
	transition: opacity 0.2s;
}

.btn-nav:hover { opacity: 0.85; }
.btn-nav svg   { stroke: #ffffff; }

/* Expandable detail row in list mode */
.lr-expand {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px 16px;
	max-height: 0;
	overflow: hidden;
	padding: 0 16px;
	background-color: var(--bg-card);
	filter: brightness(0.97);
	border-top: 0px solid var(--border);
	transition: max-height 0.35s ease, padding 0.35s ease, border-top-width 0.35s;
}

.lr-expand.open {
	max-height: 120px;
	padding: 10px 16px 14px;
	border-top-width: 1px;
}

.lre-item  { display: flex; flex-direction: column; gap: 1px; }
.lre-lbl   { font-size: 10.5px; color: var(--text-muted); }
.lre-val   { font-size: 12px; color: var(--text); }
.lre-val a { color: var(--green); text-decoration: none; }