/* Webshop styles — plain CSS, no build step required. */
:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text: #1d2330;
    --muted: #6b7280;
    --border: #e3e6eb;
    --primary: #1f4e79;
    --primary-dark: #163a5a;
    --danger: #c0392b;
    --success-bg: #e7f6ec; --success: #1e7a3c;
    --error-bg: #fdecea;   --error: #a8261b;
    --info-bg: #e8f1fb;    --info: #1f4e79;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--primary); }
img { max-width: 100%; height: auto; }
h1 { font-size: 1.8rem; margin: .2em 0 .6em; }
h2 { font-size: 1.25rem; margin: 1.4em 0 .6em; }
.panel h2:first-of-type { margin-top: 0; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.right { text-align: right; }
.center { text-align: center; }
.text-danger { color: var(--danger) !important; }
.narrow { max-width: 440px; margin: 0 auto; }
.narrow-left { max-width: 640px; }

/* Shared */
.logo { font-weight: 700; font-size: 1.3rem; text-decoration: none; color: var(--text); }

/* Forms */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=tel], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; background: var(--surface); color: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31, 78, 121, .25); border-color: var(--primary); }
label { display: block; margin-bottom: 14px; font-weight: 500; }
label > input, label > select, label > textarea { margin-top: 4px; font-weight: 400; }
label.checkbox, label.radio { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
label.checkbox input, label.radio input { margin-top: 5px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px 18px 4px; margin: 0 0 18px; }
legend { font-weight: 600; padding: 0 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-2.gap-lg { gap: 24px; align-items: start; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 16px; align-items: center; margin-top: 12px; }
.push-right { margin-left: auto; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; flex: 0 1 260px; }

.btn { display: inline-block; padding: 10px 20px; border: 0; border-radius: var(--radius); background: var(--primary); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--primary-dark); }
.btn-small { padding: 6px 12px; font-size: .9rem; }
.btn-block { display: block; width: 100%; text-align: center; margin: 10px 0; }
.btn-secondary { background: #e9edf2; color: var(--text); }
.btn-secondary:hover { background: #dce2e9; }
.link-button { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-info { background: var(--info-bg); color: var(--info); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }

/* Listings */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin-bottom: .2em; }
.sort-form label { margin: 0; display: flex; gap: 8px; align-items: center; }
.sort-form select { width: auto; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { padding: 5px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; }

.placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 3rem; font-weight: 700; color: #b5bfcc; background: #eef1f5; text-transform: uppercase; }
.price { font-weight: 700; }
.price del { color: var(--muted); font-weight: 400; margin-right: 6px; }
.price-large { font-size: 1.5rem; }
.pagination { display: flex; justify-content: center; gap: 18px; margin: 28px 0 0; align-items: center; }
.pagination .disabled { color: #b5bfcc; }

/* Product detail */
.breadcrumbs { margin-bottom: 12px; color: var(--muted); }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
.gallery-main { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs button { padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; width: 72px; height: 72px; overflow: hidden; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.lead { font-size: 1.1rem; }
.stock { font-weight: 600; }
.in-stock { color: var(--success); }
.out-of-stock { color: var(--danger); }
.add-to-cart { display: flex; gap: 12px; align-items: flex-end; margin: 16px 0 24px; }
.add-to-cart label { margin: 0; width: 100px; }
.description { border-top: 1px solid var(--border); padding-top: 16px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th.right, .table td.right { text-align: right; }
.table th { font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--bg); }
.cart-product { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.cart-product img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.qty-form input { width: 80px; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; }
.thumb-cell { width: 60px; }

/* Totals & checkout */
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; margin: 0 0 12px; }
.totals dd { margin: 0; text-align: right; }
.totals .grand { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--border); padding-top: 8px; }
.cart-summary { max-width: 380px; margin-left: auto; }
.checkout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.checkout-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; position: sticky; top: 16px; }
.checkout-summary h2 { margin-top: 0; }
.summary-lines { list-style: none; padding: 0; margin: 0 0 12px; }
.summary-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.details dd { margin: 0; font-weight: 600; }
.order-status { display: flex; gap: 8px; margin-bottom: 16px; }
.order-columns { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }

.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eef1f5; color: #374151; }
.status-paid, .status-completed, .status-payment-paid { background: var(--success-bg); color: var(--success); }
.status-processing, .status-shipped, .status-payment-open { background: var(--info-bg); color: var(--info); }
.status-cancelled, .status-payment-failed, .status-payment-canceled, .status-payment-expired { background: var(--error-bg); color: var(--error); }
.status-pending, .status-payment-unpaid { background: #fff5e0; color: #8a5a00; }

.tabs { display: flex; gap: 20px; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 20px; padding-bottom: 8px; }
.tabs a { text-decoration: none; color: var(--muted); }
.tabs a.active { color: var(--text); font-weight: 600; }
.tabs form { margin-left: auto; }

/* Admin */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar { background: #1d2330; color: #cbd2dc; padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; }
.admin-sidebar .logo { color: #fff; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar nav a { color: #cbd2dc; text-decoration: none; padding: 8px 10px; border-radius: 6px; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.admin-sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.admin-sidebar-foot a, .admin-sidebar-foot .link-button { color: #cbd2dc; }
.admin-main { padding: 24px 28px 48px; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.stat strong { font-size: 1.5rem; }
.image-list { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.image-list figure { margin: 0; width: 110px; text-align: center; }
.image-list img { width: 110px; height: 110px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: 6px 0; border-bottom: 1px solid var(--border); }

/* Responsive */
@media (max-width: 860px) {
    .product-detail, .checkout, .order-columns, .grid-2.gap-lg { grid-template-columns: 1fr; }
    .checkout-summary { position: static; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .admin-main { padding: 18px 16px; }
}
@media (max-width: 600px) {
    .grid-2 { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
    .table td { border: 0; padding: 4px 12px; text-align: left !important; }
    .table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .85rem; }
    .cart-summary { max-width: none; }
}
