/* ==========================================================================
   Objednávka fotek – mobile first
   ========================================================================== */

:root {
	--c-primary: #0b3d6e;
	--c-primary-dark: #072a4d;
	--c-accent: #e3262f;
	--c-text: #1d2733;
	--c-muted: #667085;
	--c-border: #d0d5dd;
	--c-input-border: #8a94a6; /* ohraničení polí – kontrast min. 3:1 */
	--c-focus-alt: #f5b400; /* fokus na tmavém pozadí */
	--c-border-light: #e4e7ec;
	--c-bg: #f1f4f8;
	--c-surface: #ffffff;
	--c-success: #067647;
	--c-success-bg: #dcfae6;
	--c-warning: #93370d;
	--c-warning-bg: #fef0c7;
	--c-danger: #b42318;
	--c-danger-bg: #fee4e2;
	--c-info: #175cd3;
	--c-info-bg: #d1e9ff;
	--radius: 10px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
	--gutter: 16px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }

body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--c-text);
	background: var(--c-bg);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

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

a { color: var(--c-primary); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }

[hidden] { display: none !important; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

.muted { color: var(--c-muted); }

/* --- Header / footer ---------------------------------------------------- */

.site-header { background: var(--c-primary); color: #fff; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.site-header__title { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; }

.site-main { flex: 1; padding-top: 20px; padding-bottom: 96px; }

.site-footer { padding: 20px 0 28px; font-size: .875rem; color: var(--c-muted); border-top: 1px solid var(--c-border-light); background: var(--c-surface); }
.site-footer a { color: var(--c-muted); }

/* --- Cards / alerts / badges -------------------------------------------- */

.card {
	background: var(--c-surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 18px var(--gutter);
	margin-bottom: 16px;
}
.card--center { text-align: center; padding: 32px var(--gutter); }

.alert { padding: 12px 14px; border-radius: 8px; margin: 0 0 12px; background: var(--c-info-bg); color: var(--c-info); list-style: none; }
.alert p { margin: 0; }
.alert--success { background: var(--c-success-bg); color: var(--c-success); }
.alert--error, .alert--danger { background: var(--c-danger-bg); color: var(--c-danger); }
.alert--warning { background: var(--c-warning-bg); color: var(--c-warning); }

.form-errors { padding: 0; margin: 0 0 12px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 600; background: var(--c-border-light); color: var(--c-text); white-space: nowrap; }
.badge--success { background: var(--c-success-bg); color: var(--c-success); }
.badge--warning { background: var(--c-warning-bg); color: var(--c-warning); }
.badge--danger { background: var(--c-danger-bg); color: var(--c-danger); }
.badge--info { background: var(--c-info-bg); color: var(--c-info); }
.badge--muted { background: var(--c-border-light); color: #4b5565; }

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

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 44px; padding: 8px 18px;
	border: 1px solid var(--c-border); border-radius: 8px;
	background: var(--c-surface); color: var(--c-text);
	font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
	transition: background-color .15s, border-color .15s;
}
.btn:hover { background: var(--c-bg); }
/* viditelný fokus pro klávesnici – plná barva (kontrast min. 3:1 vůči pozadí) */
:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; }
.site-header :focus-visible { outline-color: var(--c-focus-alt); }
.btn--primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-dark); }
.btn--danger { background: var(--c-surface); border-color: var(--c-danger); color: var(--c-danger); }
.btn--danger:hover { background: var(--c-danger-bg); }
.btn--sm { min-height: 34px; padding: 4px 12px; font-size: .875rem; }
.btn--lg { min-height: 52px; font-size: 1.05rem; }
.btn--block { width: 100%; }

/* --- Forms -------------------------------------------------------------- */

.form-row { margin-bottom: 14px; }
.form-label, .form-row > label { display: block; font-weight: 600; margin-bottom: 4px; }
.form-row--required .form-label label::after { content: " *"; color: var(--c-danger); }
.form-help { display: block; color: var(--c-muted); font-size: .8125rem; margin-top: 4px; }
.form-error { color: var(--c-danger); font-size: .875rem; margin-top: 4px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }

.input, input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number],
input[type=datetime-local], input[type=date], input[type=search], select, textarea {
	width: 100%;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid var(--c-input-border);
	border-radius: 8px;
	background: #fff;
	font: inherit;
	color: inherit;
}
[aria-invalid="true"] { border-color: var(--c-danger); border-width: 2px; }
textarea { min-height: 88px; resize: vertical; }
input[type=file] { font: inherit; max-width: 100%; }

.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.checkbox input { width: 24px; height: 24px; margin: 0; flex: 0 0 auto; accent-color: var(--c-primary); }
.consent__link { margin: 6px 0 0 34px; }

.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* jen pro čtečky obrazovky */
.sr-only {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
	position: absolute; left: 8px; top: -100px; z-index: 100;
	padding: 10px 14px; border-radius: 8px;
	background: #fff; color: var(--c-primary); font-weight: 700;
}
.skip-link:focus { top: 8px; }
main:focus { outline: none; }

/* --- Order page --------------------------------------------------------- */

.intro { margin-bottom: 20px; }
.intro__next { margin-top: 0; color: var(--c-muted); font-size: .875rem; }
.intro__deadline { margin: 0 0 6px; background: var(--c-warning-bg); color: var(--c-warning); padding: 10px 14px; border-radius: 8px; border-left: 4px solid var(--c-warning); }
.intro__deadline-label { display: block; font-weight: 700; text-transform: uppercase; font-size: .8125rem; letter-spacing: .03em; }.intro__note { background: var(--c-info-bg); color: var(--c-info); padding: 10px 12px; border-radius: 8px; }

.step { margin-bottom: 28px; }
.step__title { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.step__num {
	display: inline-flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; border-radius: 50%;
	background: var(--c-primary); color: #fff; font-size: 1rem; flex: 0 0 auto;
}

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; position: sticky; top: 0; z-index: 5; background: var(--c-bg); padding: 8px 0; }
.filters__item span { display: block; font-size: .8125rem; font-weight: 600; color: var(--c-muted); margin-bottom: 2px; }
.filters__empty { color: var(--c-muted); }

.photo-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

.photo-card { background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.photo-card.is-selected { box-shadow: 0 0 0 3px var(--c-primary), var(--shadow); }
.photo-card__image { display: block; padding: 0; border: 0; background: #dfe3ea; cursor: zoom-in; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; }
.photo-card__image img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.photo-card__body { padding: 14px var(--gutter) 16px; }
.photo-card__title { margin-bottom: 2px; }
.photo-card__meta { color: var(--c-muted); font-size: .9rem; margin-bottom: 10px; }

.size-list { display: flex; flex-direction: column; gap: 8px; }
.size-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--c-border-light); }
.size-row:first-child { border-top: 0; }
.size-row__label { display: flex; flex-direction: column; line-height: 1.25; cursor: pointer; }
.size-row__price { color: var(--c-muted); font-size: .9rem; }

.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--c-input-border); border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.stepper__btn { width: 44px; min-height: 44px; border: 0; background: var(--c-bg); font-size: 1.35rem; line-height: 1; cursor: pointer; color: var(--c-primary); }
.stepper__btn:active { background: var(--c-border-light); }
.stepper__input { width: 52px; min-height: 44px; border: 0; border-left: 1px solid var(--c-input-border); border-right: 1px solid var(--c-input-border); text-align: center; font: inherit; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.stepper__input::-webkit-outer-spin-button, .stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.summary { margin-bottom: 16px; }
.summary__list { list-style: none; padding: 0; margin: 0 0 10px; }
.summary__list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--c-border-light); }
.summary__total { font-size: 1.15rem; text-align: right; margin: 0; }
.summary__empty { color: var(--c-muted); }

.consent { margin: 16px 0; }

.cart-bar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
	background: var(--c-surface); box-shadow: 0 -2px 12px rgba(16, 24, 40, .15);
}
.cart-bar__info { display: flex; flex-direction: column; line-height: 1.2; }
.cart-bar__info span { color: var(--c-muted); font-size: .875rem; }
.cart-bar__info strong { font-size: 1.15rem; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.lightbox img { max-width: 96vw; max-height: 90vh; width: auto; user-select: none; pointer-events: none; }
.lightbox form { position: absolute; top: 4px; right: 4px; margin: 0; }
.lightbox__close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.75rem; cursor: pointer; }

/* --- Thanks / payment --------------------------------------------------- */

.payment__grid { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 12px 0; }
.payment__qr { width: 240px; height: 240px; image-rendering: pixelated; border: 1px solid var(--c-border-light); border-radius: 8px; }
.payment__details { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; width: 100%; }
.payment__details dt { color: var(--c-muted); }
.payment__details dd { margin: 0; word-break: break-word; }

/* --- Tables ------------------------------------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--c-border-light); text-align: left; vertical-align: top; }
.table thead th { background: var(--c-bg); font-size: .8125rem; text-transform: uppercase; letter-spacing: .02em; color: var(--c-muted); white-space: nowrap; }
.table tfoot th, .table tfoot td { border-bottom: 0; font-weight: 700; }
.table .num { text-align: right; white-space: nowrap; }

.prose p { max-width: 70ch; }

/* --- Breakpoints -------------------------------------------------------- */

@media (min-width: 600px) {
	h1 { font-size: 1.85rem; }
	.form-grid { grid-template-columns: 1fr 1fr; }
	.form-row--full { grid-column: 1 / -1; }
	.photo-grid { grid-template-columns: repeat(2, 1fr); }
	.payment__grid { flex-direction: row; align-items: flex-start; }
	.filters { position: static; max-width: 560px; }
}

@media (min-width: 960px) {
	.photo-grid { grid-template-columns: repeat(3, 1fr); }
	.card { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
