/* DDM Domeček: výpis, filtr, karty, detail. Barvy poboček přicházejí jako CSS proměnné z HTML. */

.ddmd {
	--ddmd-accent: #0f2b6b;
	--ddmd-accent-text: #ffffff;
	--ddmd-dark: #0f1f3d;
	--ddmd-muted: #5b6474;
	--ddmd-bg: #f2f4f7;
	--ddmd-radius: 999px;
	--ddmd-gap: 16px;
	box-sizing: border-box;
	color: var(--ddmd-dark);
	line-height: 1.45;
}
.ddmd *, .ddmd *::before, .ddmd *::after { box-sizing: inherit; }
.ddmd .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.ddmd .is-hidden { display: none !important; }
.ddmd button { font: inherit; cursor: pointer; }
.ddmd :focus-visible { outline: 3px solid var(--ddmd-accent); outline-offset: 3px; }

/* Hlavička s grafikou */
.ddmd-hero {
	display: grid;
	grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr) minmax(120px, 1fr);
	gap: var(--ddmd-gap);
	align-items: center;
}
.ddmd-hero__graphic img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; }
.ddmd-hero__main { text-align: center; }
.ddmd-hero__title {
	margin: 0 0 0.6em;
	font-size: clamp(1.8rem, 3.6vw, 2.8rem);
	font-weight: 800;
	line-height: 1.15;
	color: var(--ddmd-dark);
}
.ddmd-hero__intro { margin: 0 0 1em; color: var(--ddmd-muted); }

.ddmd-group { border: 0; margin: 0 0 1.2em; padding: 0; min-width: 0; }
.ddmd-group__label {
	display: block; width: 100%;
	margin: 0 0 0.5em; padding: 0;
	font-size: 1.15rem; font-weight: 600; color: var(--ddmd-accent);
}
.ddmd-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; }

/* Pilulky */
.ddmd-pill {
	--ddmd-color: var(--ddmd-accent);
	--ddmd-text: var(--ddmd-accent-text);
	display: inline-flex; align-items: center;
	padding: 0.5em 1.2em;
	border: 2px solid var(--ddmd-color);
	border-radius: var(--ddmd-radius);
	background: var(--ddmd-color);
	color: var(--ddmd-text);
	font-weight: 700; font-size: 1.17rem; line-height: 1.2; /* ≥ 18.67px tučně = „velký text“ pro kontrast 3:1 */
	text-transform: none;
	transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.ddmd-pill:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 31, 61, 0.18); }
.ddmd-pill--center { font-size: 1.25rem; padding: 0.5em 1.4em; text-transform: uppercase; letter-spacing: 0.02em; }
/* Neaktivní stav při vybraném filtru: zbylé pilulky zesvětlené, aktivní zvýrazněná */
.ddmd-pills.has-active .ddmd-pill:not(.is-active) { opacity: 0.55; }
.ddmd-pill.is-active { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--ddmd-color); }
.ddmd-pill.is-active::before { content: "✓"; margin-right: 0.45em; font-weight: 900; }

/* Fulltext a přepínače */
.ddmd-search {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
	gap: 12px 16px;
	margin: 0.5em 0 0;
}
.ddmd-search__label { font-size: 1.15rem; font-weight: 600; color: var(--ddmd-accent); }
.ddmd-search__field {
	position: relative; display: flex; align-items: center;
	flex: 1 1 320px; max-width: 460px;
}
.ddmd-search__field input[type="search"] {
	width: 100%;
	padding: 0.6em 3em 0.6em 1.2em;
	border: 2px solid var(--ddmd-accent);
	border-radius: var(--ddmd-radius);
	background: #fff; color: var(--ddmd-dark);
	font-size: 1rem; line-height: 1.3;
}
.ddmd-search__field input::placeholder { color: #8a93a3; }
.ddmd-search__submit {
	position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border: 0; border-radius: 50%;
	background: var(--ddmd-accent); color: var(--ddmd-accent-text);
}
.ddmd-toggles { display: flex; flex-wrap: wrap; gap: 10px; }
.ddmd-toggle {
	transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
	padding: 0.55em 1.2em;
	border: 2px solid var(--ddmd-accent);
	border-radius: var(--ddmd-radius);
	background: #fff; color: var(--ddmd-accent);
	font-weight: 700; font-size: 0.95rem; line-height: 1.2;
}
/* Hover: světlý podklad a podtržení, aby se přepínač nepletl s modrými pilulkami oborů nad ním. */
.ddmd-toggle:hover { background: #e9eef8; color: var(--ddmd-accent); text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 31, 61, 0.14); }
.ddmd-toggle.is-active { background: var(--ddmd-accent); color: var(--ddmd-accent-text); }
.ddmd-toggle.is-active:hover { background: var(--ddmd-dark); color: #fff; text-decoration: none; }
.ddmd-toggle.is-active::before { content: "✓"; margin-right: 0.45em; }

/* Upřesňující filtry: vždy viditelný zvýrazněný panel (dříve rozbalovací „Více filtrů“). */
.ddmd-more {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
	gap: 12px 18px;
	margin: 1.4em auto 1.8em;
	padding: 16px 24px;
	max-width: 900px;
	background: #e9eef8;
	border-radius: 24px;
}
.ddmd-more__label { margin: 0; padding: 0; font-size: 1.15rem; font-weight: 700; color: var(--ddmd-accent); }
.ddmd-more__panel {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px;
}
.ddmd-select { position: relative; }
.ddmd-select label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
.ddmd-select select,
.ddmd-select input[type="time"] {
	min-width: 170px;
	padding: 0.55em 2.4em 0.55em 1.2em;
	border: 2px solid var(--ddmd-accent);
	border-radius: var(--ddmd-radius);
	background: #fff; color: var(--ddmd-accent);
	font-weight: 700; font-size: 0.95rem; line-height: 1.2;
	appearance: none; -webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='%230f2b6b' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 1em center;
}
/* Čas od: viditelný popisek uvnitř pilulky, jinak by prázdné pole času nedávalo smysl. */
.ddmd-select--time {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 0 1.2em;
	border: 2px solid var(--ddmd-accent);
	border-radius: var(--ddmd-radius);
	background: #fff;
}
.ddmd-select--time label {
	position: static; width: auto; height: auto; overflow: visible; clip: auto;
	font-weight: 700; font-size: 0.95rem; color: var(--ddmd-accent); white-space: nowrap;
}
.ddmd-select--time input[type="time"] { min-width: 0; padding: 0.42em 0; border: 0; border-radius: 0; background: none; }
.ddmd-select select:focus, .ddmd-select--time:focus-within { box-shadow: 0 0 0 3px rgba(15, 43, 107, 0.25); }
.ddmd-select--time input[type="time"]:focus-visible { outline: none; }

/* Výsledky */
.ddmd-results { background: var(--ddmd-bg); border-radius: 24px; padding: 28px 28px 32px; }
.ddmd-results__bar {
	display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px;
	margin-bottom: 14px;
}
.ddmd-results__count { margin: 0; font-weight: 600; color: var(--ddmd-muted); }
.ddmd-reset { font-weight: 600; color: var(--ddmd-accent); text-decoration: underline; }
.ddmd-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	/* Svisle víc místa než vodorovně: tlačítko „zobrazit detail“ přesahuje 16 px pod spodní hranu karty. */
	gap: 40px 24px;
	padding-bottom: 16px;
}
.ddmd-empty { margin: 1em 0; text-align: center; color: var(--ddmd-muted); }
.ddmd-load { text-align: center; margin-top: 36px; padding-bottom: 8px; }

/* Karta */
.ddmd-card {
	--ddmd-color: var(--ddmd-accent);
	--ddmd-text: var(--ddmd-accent-text);
	--ddmd-tint: #ffffff;
	position: relative;
	display: flex; flex-direction: column; align-items: center; text-align: center;
	padding: 20px 18px 34px;
	/* Jemné podbarvení podle pobočky, stejně jako kontakty poboček na úvodu. */
	background: var(--ddmd-tint);
	border: 3px solid var(--ddmd-color);
	border-radius: 18px;
	min-height: 100%;
}
.ddmd-card.is-full { filter: saturate(0.6); }
.ddmd-card.is-full .ddmd-card__btn { filter: none; }
.ddmd-card__badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
.ddmd-badge {
	padding: 0.2em 0.7em; border-radius: var(--ddmd-radius);
	font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.ddmd-badge--new { background: #ffe66d; color: var(--ddmd-dark); }
.ddmd-badge--full { background: #e9ecf1; color: var(--ddmd-muted); }
.ddmd-card__image { display: block; width: 100%; margin: -4px 0 12px; border-radius: 12px; overflow: hidden; }
.ddmd-card__image img { display: block; width: 100%; height: 160px; object-fit: cover; }
.ddmd-card__title { margin: 0 0 8px; font-size: 1.25rem; font-weight: 800; line-height: 1.2; color: var(--ddmd-dark); }
.ddmd-card__title a { color: inherit; text-decoration: none; }
.ddmd-card__title a:hover { text-decoration: underline; }
.ddmd-card__meta { margin: 0 0 4px; font-size: 0.9rem; font-weight: 600; color: var(--ddmd-dark); }
.ddmd-card__price { margin: 0; font-size: 0.9rem; font-weight: 700; color: var(--ddmd-dark); }
.ddmd-card__btn {
	position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%);
	white-space: nowrap;
	z-index: 2;
}
/* Vyšší specificita než obecný .ddmd-btn:hover níže, jinak by tlačítko ztratilo vycentrování. */
.ddmd-card .ddmd-btn.ddmd-card__btn:hover { transform: translate(-50%, -2px); }

/* Tlačítka */
.ddmd-btn {
	/* Barva se dědí z karty/detailu (pobočka); mimo ně se použije hlavní barva filtru. */
	display: inline-flex; align-items: center; justify-content: center;
	padding: 0.55em 1.4em;
	border: 2px solid var(--ddmd-color, var(--ddmd-accent));
	border-radius: var(--ddmd-radius);
	background: var(--ddmd-color, var(--ddmd-accent)); color: var(--ddmd-text, var(--ddmd-accent-text));
	font-weight: 700; font-size: 1.17rem; line-height: 1.2; /* velký tučný text kvůli kontrastu 3:1 */
	text-decoration: none;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.ddmd-btn:hover { color: var(--ddmd-text, var(--ddmd-accent-text)); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 31, 61, 0.18); }
.ddmd-btn--accent { --ddmd-color: var(--ddmd-accent); --ddmd-text: var(--ddmd-accent-text); }
.ddmd-btn--primary { font-size: 1.25rem; padding: 0.7em 1.8em; }
.ddmd-btn--outline { background: #fff; color: var(--ddmd-dark); }
.ddmd-btn--outline:hover { color: var(--ddmd-dark); }
.ddmd-btn[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

/* Upozornění */
.ddmd-notice { padding: 16px 20px; border-radius: 12px; background: #fff4e5; border: 1px solid #f3c78a; }
.ddmd-notice--error { background: #fdecec; border-color: #f0a8a8; }

/* Detail */
.ddmd-detail__header {
	background: var(--ddmd-color); color: var(--ddmd-text);
	border-radius: 24px; padding: 28px 32px; margin-bottom: 24px;
}
.ddmd-breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; padding: 0; font-size: 0.85rem; opacity: 0.9; }
.ddmd-breadcrumb li + li::before { content: "›"; margin: 0 6px 0 2px; }
.ddmd-breadcrumb a { color: inherit; text-decoration: underline; }
.ddmd-detail__title { margin: 0 0 12px; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; line-height: 1.15; color: inherit; }
.ddmd-detail__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ddmd-tag {
	padding: 0.25em 0.8em; border-radius: var(--ddmd-radius);
	background: rgba(255, 255, 255, 0.22); color: inherit;
	font-size: 0.8rem; font-weight: 700;
}
.ddmd-tag--center { background: #fff; color: var(--ddmd-color); }
.ddmd-tag--new { background: #ffe66d; color: var(--ddmd-dark); }
.ddmd-tag--full { background: var(--ddmd-dark); color: #fff; }
.ddmd-detail__image { margin: 0 0 20px; }
.ddmd-detail__image img { display: block; max-width: 100%; height: auto; border-radius: 16px; }
.ddmd-detail__description { font-size: 1.05rem; margin-bottom: 24px; }
.ddmd-detail__subtitle { font-size: 1.3rem; font-weight: 800; margin: 24px 0 10px; color: var(--ddmd-dark); }
.ddmd-table { width: 100%; border-collapse: collapse; margin: 0 0 20px; }
.ddmd-table th, .ddmd-table td { padding: 10px 12px; border-bottom: 1px solid #e3e6ec; text-align: left; vertical-align: top; }
.ddmd-table th { width: 32%; font-weight: 700; color: var(--ddmd-dark); background: var(--ddmd-bg); }
.ddmd-detail__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Blok nejnovějších akcí */
.ddmd-latest__all { text-align: center; margin: 32px 0 0; }

/* Responzivita */
@media (max-width: 1100px) {
	.ddmd-hero { grid-template-columns: minmax(90px, 1fr) minmax(0, 4fr) minmax(90px, 1fr); }
}
@media (max-width: 980px) {
	.ddmd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ddmd-results { padding: 20px 16px 24px; }
	.ddmd-grid { gap: 36px 16px; }
}
@media (max-width: 767px) {
	.ddmd-hero { grid-template-columns: 1fr; }
	.ddmd-hero__graphic { display: none; }
	.ddmd-grid { grid-template-columns: 1fr; }
	.ddmd-search__label { width: 100%; text-align: center; }
	.ddmd-toggles { width: 100%; justify-content: center; }
	.ddmd-detail__header { padding: 20px; border-radius: 16px; }
	.ddmd-table th { width: 40%; }
}
@media (prefers-reduced-motion: reduce) {
	.ddmd * { transition: none !important; }
}
