:root {
    --bg: #f6f2eb;
    --card: #fffdf9;
    --ink: #1e1a16;
    --title: #001C50;
    --muted: #736b62;
    --line: #d9d4ce;
    --accent: #AA1D1F;
    --accent-dark: #001C50;
    --button: #001C50;
    --tile: #525558;
    --danger: #AA1D1F;
    --shadow: 0 18px 45px rgba(0, 28, 80, 0.10);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #fff7e6, var(--bg) 42%);
    color: var(--ink);
}

a { color: inherit; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px clamp(18px, 4vw, 56px);
    border-bottom: 1px solid rgba(0,0,0,.06);
    background: rgba(255,253,249,.82);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}
.brand { font-weight: 900; text-decoration: none; letter-spacing: -.02em; color: var(--title); }
.topbar nav { display: flex; gap: 16px; font-size: .95rem; color: var(--muted); }
.topbar nav a { text-decoration: none; }
.page { width: min(1120px, calc(100% - 32px)); margin: 34px auto 60px; }
.footer { padding: 28px; text-align: center; color: var(--muted); font-size: .9rem; }
.footer-links {
    display: flex;
    justify-content: center;
    gap: 12px 18px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.footer-links a {
    color: var(--title);
    text-decoration: none;
    font-weight: 700;
}
.footer-links a:hover {
    color: var(--accent);
}
.hero, .menu-header, .admin-header {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: center;
    margin-bottom: 28px;
}
h1 { font-size: clamp(2rem, 5vw, 4.2rem); line-height: .98; margin: .1em 0 .25em; letter-spacing: -.05em;  color: var(--title);}
h2 { margin: 0 0 8px; letter-spacing: -.03em; }
p { color: var(--muted); line-height: 1.55; }
.eyebrow, .category { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--accent); font-weight: 800; margin: 0 0 8px; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.button {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: var(--button);
    color: white;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.button:hover { background: var(--accent); }
.button.secondary { background: rgba(0,28,80,.10); color: var(--title); }
.button.danger { background: var(--danger); color: white; }
.small-buttons .button { font-size: .85rem; padding: 9px 12px; }
.card, .product-card, .checkout-card, .station-card, .stat-card, .order-card {
    background: rgba(255,253,249,.94);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 28px;
}
.card { padding: 26px; }
.card.narrow { max-width: 560px; margin: 0 auto; }
.center { text-align: center; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.product-card { overflow: hidden; display: grid; grid-template-rows: 150px 1fr; }
.product-image { display: grid; place-items: center; font-size: 4rem; font-weight: 900; background: linear-gradient(135deg, #f3ddaf, #e8cfa4); color: rgba(30,26,22,.42); }
.product-body { padding: 20px; }
.product-footer { display: flex; justify-content: space-between; gap: 14px; align-items: end; margin-top: 20px; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: .9rem; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: white;
    border-radius: 16px;
    padding: 12px 14px;
    font: inherit;
}
.qty { width: 92px; text-align: center; font-weight: 800; color: var(--ink); }
.checkout-card {
    position: sticky;
    bottom: 18px;
    margin-top: 18px;
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(180px, .75fr) minmax(320px, 1.45fr) auto auto;
    gap: 18px;
    align-items: end;
}
.checkout-field-name { max-width: 260px; }
.checkout-field-email { min-width: 320px; }
.total-box { min-width: 130px; display: grid; gap: 4px; }
.total-box span { color: var(--muted); font-size: .85rem; }
.total-box strong { font-size: 1.4rem; }
.validation { color: var(--danger); font-weight: 700; margin-bottom: 14px; }
.summary { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; margin: 18px 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card { padding: 22px; display: grid; gap: 10px; }
.stat-card span { color: var(--muted); }
.stat-card strong { font-size: 2.4rem; }
.station-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; align-items: start; }
.station-card { padding: 20px; }
.order-card { padding: 18px; margin-top: 14px; box-shadow: none; }
.order-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.order-head div { display: grid; gap: 3px; }
.order-head span { color: var(--muted); font-size: .9rem; }
.pill { border-radius: 999px; background: #edf7f1; color: var(--accent) !important; padding: 6px 10px; font-weight: 800; white-space: nowrap; }
.items { padding-left: 0; list-style: none; display: grid; gap: 6px; }
.items li span { font-weight: 900; display: inline-block; min-width: 32px; }
.two-column { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stack { display: grid; gap: 14px; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 720px) {
    .topbar { align-items: flex-start; flex-direction: column; gap: 10px; }
    .hero, .menu-header, .admin-header { align-items: flex-start; flex-direction: column; }
    .checkout-card { position: static; grid-template-columns: 1fr; }
    .product-footer { align-items: start; flex-direction: column; }
}

.tabs {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 22px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,253,249,.72);
}
.tab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 800;
}
.tab span {
    min-width: 26px;
    text-align: center;
    padding: 3px 7px;
    border-radius: 999px;
    background: #eadfcd;
    color: var(--ink);
    font-size: .82rem;
}
.tab.active {
    background: var(--accent);
    color: white;
}
.tab.active span {
    background: rgba(255,255,255,.22);
    color: white;
}
.section-block { margin-top: 28px; }
.section-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 14px;
}
.compact-head { margin-bottom: 6px; }
.total-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #edf7f1;
    color: var(--accent);
    padding: 10px 14px;
    white-space: nowrap;
}
.stat-card.highlight { border-color: rgba(45,106,79,.28); }
.stat-card.highlight strong { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.report-card { overflow: hidden; }
.report-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 14px;
}
.report-head h3 { margin: 0; font-size: 1.35rem; letter-spacing: -.03em; }
.report-head div { display: grid; gap: 3px; text-align: right; }
.report-head span { color: var(--muted); }
.report-head strong { font-size: 1.25rem; }
.table-scroll { overflow-x: auto; }
.number { text-align: right; white-space: nowrap; }
.pill.compact { padding: 4px 8px; font-size: .78rem; }
@media (max-width: 720px) {
    .tabs { border-radius: 22px; }
    .tab { width: 100%; justify-content: space-between; }
    .section-head, .report-head { align-items: flex-start; flex-direction: column; }
    .report-head div { text-align: left; }
}

/* Jugendfest Lok Reinach Anpassungen */
.table-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}
.table-card {
    display: grid;
    gap: 8px;
    padding: 22px;
    border-radius: 24px;
    text-decoration: none;
    background: var(--tile);
    color: white;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}
.table-card:hover { transform: translateY(-2px); }
.table-card span { color: rgba(255,255,255,.72); font-size: .85rem; }
.table-card strong { font-size: 1.55rem; color: white; }
.table-card small { color: rgba(255,255,255,.82); }

.product-tabs {
    margin-bottom: 18px;
}
.product-tab {
    border: 0;
    cursor: pointer;
    font: inherit;
}
.product-image.placeholder {
    background: var(--tile);
    color: rgba(255,255,255,.82);
}
.product-image.has-image {
    background: var(--tile);
    overflow: hidden;
}
.product-image.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.checkout-card {
    grid-template-columns: minmax(160px, .62fr) minmax(360px, 1.65fr) auto auto;
}
.checkout-field-name { max-width: 220px; }
.checkout-field-email { min-width: 380px; }
.button.small { padding: 10px 14px; font-size: .88rem; }
.edit-table input,
.edit-table textarea {
    min-width: 120px;
}
.image-edit-cell {
    min-width: 230px;
}
.image-url-input {
    margin-top: 8px;
    min-width: 220px;
}
.admin-product-thumb {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    object-fit: cover;
    display: inline-grid;
    place-items: center;
    background: var(--tile);
    color: white;
    font-weight: 900;
    vertical-align: middle;
}
.price-cell {
    min-width: 160px;
}
.price-cell input[type="text"] {
    margin-top: 8px;
    max-width: 80px;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
}
.checkbox-label input {
    width: auto;
}
.stat-card {
    background: var(--tile);
    color: white;
}
.stat-card span,
.stat-card p {
    color: rgba(255,255,255,.76);
}
.stat-card strong {
    color: white;
}
.pill,
.total-badge {
    background: rgba(170,29,31,.10);
    color: var(--accent) !important;
}
.tab.active {
    background: var(--button);
}
@media (max-width: 720px) {
    .checkout-field-name,
    .checkout-field-email { max-width: none; min-width: 0; }
    .checkout-card { grid-template-columns: 1fr; }
}

/* Produktbilder und Warenkorb-Zusammenfassung */
.product-card {
    grid-template-rows: 220px 1fr;
}
.product-image.has-image {
    background: #fff;
    padding: 14px;
}
.product-image.has-image img {
    object-fit: contain;
    border-radius: 18px;
}
.cart-card {
    background: rgba(255,253,249,.94);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 28px;
    padding: 20px 22px;
    margin-top: 22px;
}
.muted-box {
    color: var(--muted);
    background: rgba(82,85,88,.08);
    border: 1px dashed rgba(82,85,88,.28);
    border-radius: 18px;
    padding: 16px;
}
.cart-list {
    display: grid;
    gap: 10px;
}
.cart-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 120px 120px auto;
    gap: 14px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
}
.cart-product {
    display: grid;
    gap: 3px;
}
.cart-product span {
    color: var(--muted);
    font-size: .9rem;
}
.cart-qty input {
    text-align: center;
    font-weight: 800;
}
.cart-line-total {
    color: var(--title);
    white-space: nowrap;
}
.icon-button {
    border: 0;
    border-radius: 999px;
    background: rgba(170,29,31,.10);
    color: var(--accent);
    padding: 11px 14px;
    font-weight: 900;
    cursor: pointer;
}
.icon-button:hover {
    background: var(--accent);
    color: white;
}
.table-hint-cell {
    min-width: 260px;
}
@media (max-width: 720px) {
    .product-card { grid-template-rows: 190px 1fr; }
    .cart-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .cart-line-total { font-size: 1.2rem; }
}

/* Warenkorb als kompakte Tabelle */
.cart-list {
    display: block;
    overflow-x: auto;
}
.cart-table-wrap {
    width: 100%;
    overflow-x: auto;
}
.cart-table {
    width: 100%;
    min-width: 640px;
    border-collapse: separate;
    border-spacing: 0 8px;
}
.cart-table th {
    border-bottom: 0;
    padding: 0 12px 6px;
}
.cart-table td {
    border-bottom: 0;
    background: #fff;
    padding: 12px;
    vertical-align: middle;
}
.cart-table tbody tr td:first-child {
    border-radius: 16px 0 0 16px;
}
.cart-table tbody tr td:last-child {
    border-radius: 0 16px 16px 0;
}
.cart-product-name {
    width: 42%;
}
.cart-price {
    white-space: nowrap;
    color: var(--muted);
    font-weight: 700;
}
.cart-quantity-cell {
    width: 112px;
}
.cart-table-qty {
    width: 92px;
    min-width: 92px;
    text-align: center;
    font-weight: 900;
    color: var(--ink);
}
.cart-line-total {
    color: var(--title);
    white-space: nowrap;
    font-size: 1.05rem;
}
.cart-action-cell {
    width: 58px;
    text-align: right;
}
.trash-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: rgba(170,29,31,.10);
    color: var(--accent);
    cursor: pointer;
}
.trash-button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
.trash-button:hover,
.trash-button:focus-visible {
    background: var(--accent);
    color: white;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.legal-document {
    max-width: 860px;
    margin: 0 auto;
    background: rgba(255,253,249,.94);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 28px;
    padding: clamp(24px, 4vw, 42px);
}
.legal-document h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
}
.legal-document h2 {
    margin-top: 28px;
}
.legal-document p {
    max-width: 72ch;
}
.legal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.legal-note {
    margin-top: 24px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(170,29,31,.10);
    color: var(--accent);
    font-weight: 800;
}
@media (max-width: 720px) {
    .cart-table {
        min-width: 560px;
    }
}
