:root {
	--primary: #0b5cad;
	--primary-dark: #084682;
	--accent: #f28c00;
	--text: #1f2933;
	--muted: #6b7785;
	--border: #dde3ea;
	--bg: #f5f7fa;
	--surface: #fff;
	--success: #1d8a4a;
	--danger: #c62828;
	--radius: 6px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--text);
	background: var(--bg);
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
h1 { font-size: 1.75rem; margin: 1rem 0; }
h2 { font-size: 1.3rem; margin: 2rem 0 1rem; }
img { max-width: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main.container { min-height: 60vh; padding-bottom: 3rem; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; gap: 1.5rem; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.4rem; color: var(--primary); text-decoration: none; white-space: nowrap; }
.search { flex: 1; display: flex; min-width: 220px; }
.search input { flex: 1; padding: .55rem .8rem; border: 2px solid var(--primary); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); font-size: 1rem; }
.search button { padding: 0 1.1rem; border: 0; background: var(--primary); color: #fff; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; font-weight: 600; }
.header-links { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.header-links a { text-decoration: none; }
.header-links a.current { font-weight: 700; }
.cart-link { font-weight: 600; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; background: var(--accent); color: #fff; border-radius: 1em; font-size: .8rem; text-align: center; }

.category-nav { background: var(--primary); }
.category-nav .container { display: flex; flex-wrap: wrap; }
.category-nav a { color: #fff; text-decoration: none; padding: .65rem 1rem; font-weight: 600; font-size: .95rem; }
.category-nav a:hover { background: var(--primary-dark); }

.site-footer { background: #1f2933; color: #cfd6de; padding: 2rem 0; font-size: .9rem; }
.site-footer a { color: #fff; }

/* flash */
.flash { margin: 1rem 0; padding: .75rem 1rem; border-radius: var(--radius); background: #e7f0fa; border-left: 4px solid var(--primary); }
.flash-success { background: #e6f4ec; border-color: var(--success); }
.flash-warning { background: #fff4e0; border-color: var(--accent); }
.flash-error { background: #fdecea; border-color: var(--danger); }

/* home */
.hero { margin: 1.5rem 0; padding: 2rem; background: linear-gradient(120deg, var(--primary), #1478d4); color: #fff; border-radius: var(--radius); }
.hero h1 { margin-top: 0; }
.category-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.category-tile { display: block; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.category-tile:hover { border-color: var(--primary); }
.category-tile strong { display: block; color: var(--primary); margin-bottom: .25rem; }
.category-tile span { font-size: .85rem; color: var(--muted); }

/* listing */
.breadcrumbs { margin-top: 1rem; font-size: .9rem; color: var(--muted); }
.subcategories { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.subcategories a { padding: .35rem .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 2rem; text-decoration: none; font-size: .9rem; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; color: var(--muted); }
.sorting { display: flex; gap: .75rem; flex-wrap: wrap; font-size: .9rem; margin: 1rem 0; }
.sorting a { text-decoration: none; }
.sorting a.current { font-weight: 700; color: var(--text); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.product-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.product-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.product-image { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; margin-bottom: .75rem; }
.product-image img { max-height: 100%; object-fit: contain; }
.no-image { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 160px; background: var(--bg); color: var(--muted); font-size: .85rem; border-radius: var(--radius); }
.product-card h3 { font-size: 1rem; margin: 0 0 .5rem; flex: 1; }
.product-card h3 a { color: var(--text); text-decoration: none; }
.product-card h3 a:hover { color: var(--primary); }
.product-buy { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.price { font-size: 1.15rem; }
.stock { font-size: .85rem; margin: 0 0 .5rem; font-weight: 600; }
.in-stock { color: var(--success); }
.out-of-stock { color: var(--accent); }

.pagination { display: flex; gap: .35rem; justify-content: center; margin: 2rem 0; flex-wrap: wrap; }
.pagination a { padding: .4rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; }
.pagination a.current { background: var(--primary); color: #fff; border-color: var(--primary); }

.empty { color: var(--muted); padding: 2rem 0; }

/* product detail */
.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; background: var(--surface); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); margin-top: 1rem; }
.product-detail-image { display: flex; align-items: center; justify-content: center; min-height: 300px; }
.product-detail-info h1 { margin-top: 0; }
.product-meta { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; font-size: .9rem; color: var(--muted); }
.product-meta dd { margin: 0; color: var(--text); }
.price-big { font-size: 2rem; font-weight: 800; margin: 1rem 0 0; }
.price-note { color: var(--muted); margin: 0 0 1rem; font-size: .9rem; }
.buy-form { display: flex; gap: .5rem; align-items: center; }
.product-description { background: var(--surface); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); margin-top: 1.5rem; }
.product-description h2 { margin-top: 0; }

/* buttons & forms */
.button, button.button, input.button { display: inline-block; padding: .6rem 1.2rem; background: var(--accent); color: #fff; border: 0; border-radius: var(--radius); font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer; }
.button:hover { background: #d97d00; color: #fff; }
.button-small { padding: .4rem .75rem; font-size: .85rem; }
.button-large { padding: .9rem 1.6rem; font-size: 1.1rem; }
.button-secondary { background: var(--surface); color: var(--primary); border: 1px solid var(--primary); }
.button-secondary:hover { background: #e7f0fa; color: var(--primary); }
input.quantity { width: 5rem; }

input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], input[type=url], select, textarea {
	padding: .5rem .65rem; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; background: #fff; max-width: 100%;
}
.form { max-width: 640px; }
.form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1.25rem; background: var(--surface); }
.form legend { font-weight: 700; padding: 0 .4rem; }
.field { display: flex; flex-direction: column; margin-bottom: .9rem; }
.field label { font-weight: 600; margin-bottom: .25rem; font-size: .9rem; }
.field input, .field textarea, .field select { width: 100%; }
.radio, .checkbox { display: block; margin: .4rem 0; cursor: pointer; }
.error, .errors { color: var(--danger); font-size: .9rem; }
.errors { padding-left: 1.2rem; }
.hint { color: var(--muted); font-size: .9rem; }
.hint-success { color: var(--success); font-weight: 600; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.narrow { max-width: 460px; }

/* Nette default form rendering ({control form}) */
form table { border-collapse: collapse; }
form table th { text-align: right; padding: .4rem 1rem .4rem 0; vertical-align: top; font-weight: 600; font-size: .9rem; }
form table td { padding: .4rem 0; }
form table td input[type=text], form table td select, form table td textarea { width: 32rem; max-width: 100%; }
form .required label { font-weight: 700; }

/* tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table th, .table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table thead th { background: var(--bg); font-size: .85rem; color: var(--muted); }
.table .num { text-align: right; white-space: nowrap; }
.table tr.inactive td { color: var(--muted); }
.remove { color: var(--danger); text-decoration: none; font-size: 1.3rem; }

/* checkout */
.checkout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.checkout-form { max-width: none; }
.checkout-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; position: sticky; top: 1rem; }
.checkout-summary h2 { margin-top: 0; }
.checkout-summary ul { list-style: none; padding: 0; margin: 0; }
.checkout-summary li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.summary-total { font-size: 1.1rem; }

/* status */
.status { display: inline-block; padding: .1rem .55rem; border-radius: 1rem; font-size: .8rem; font-weight: 600; background: var(--bg); }
.status-new { background: #e7f0fa; color: var(--primary); }
.status-processing { background: #fff4e0; color: #9a5800; }
.status-shipped { background: #ede7fa; color: #5b2bb5; }
.status-completed { background: #e6f4ec; color: var(--success); }
.status-cancelled { background: #fdecea; color: var(--danger); }

/* admin */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.stat { display: block; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--muted); }
.stat strong { display: block; font-size: 2rem; color: var(--primary); }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
code { background: #eef1f5; padding: .1rem .35rem; border-radius: 3px; font-size: .9em; word-break: break-all; }

@media (max-width: 800px) {
	.product-detail, .checkout, .admin-columns { grid-template-columns: 1fr; }
	.checkout-summary { position: static; }
	.table { display: block; overflow-x: auto; }
}
