:root {
  --red: #850d1a;
  --red-dark: #640711;
  --gold: #d78a16;
  --cream: #fffaf0;
  --paper: #fffefb;
  --ink: #261b1a;
  --muted: #776e69;
  --line: #e9dfd2;
  --shadow: 0 12px 35px rgba(72, 39, 25, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 20% 0, #fff 0, var(--cream) 48%, #f8f0e2 100%); font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.site-header { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px clamp(20px, 5vw, 72px); color: white; background: linear-gradient(125deg, var(--red), var(--red-dark)); box-shadow: 0 4px 18px rgba(63, 4, 11, .22); }
.brand { color: inherit; display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; font-size: 32px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; }
.brand strong { display: block; font: 700 clamp(21px, 2.2vw, 30px)/1 Georgia, serif; text-transform: uppercase; letter-spacing: .02em; }
.brand small { display: block; margin-top: 4px; opacity: .82; }
.admin-link { padding: 10px 14px; color: var(--red); background: #fffaf0; border: 1px solid rgba(255,255,255,.55); border-radius: 10px; font-weight: 750; text-decoration: none; }

main { width: min(1440px, 100%); margin: 0 auto; padding: 34px clamp(18px, 4vw, 56px) 80px; }
.intro { margin-bottom: 22px; }
.intro h1, .admin-main h1 { margin: 0; color: var(--red-dark); font: 700 clamp(36px, 5vw, 62px)/1.02 Georgia, serif; letter-spacing: -.025em; }
.intro > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 17px; }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 12px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }

.category-nav { display: flex; gap: 8px; margin: 0 0 22px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.category-nav::-webkit-scrollbar { display: none; }
.category-nav button { flex: 0 0 auto; padding: 9px 16px; color: #4d4240; background: white; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 750; }
.category-nav button.active { color: white; background: var(--red); border-color: var(--red); }

.menu-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.category-card, .cart, .card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.category-card > header { min-height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; color: white; background: linear-gradient(105deg, var(--red), #a71923); }
.category-card:nth-child(4n) > header { background: linear-gradient(105deg, #c37108, #ec9719); }
.category-card h2 { margin: 0; font: 700 21px/1.1 Georgia, serif; }
.category-card header span { font-size: 12px; opacity: .82; }
.product-row { min-height: 76px; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 34px; gap: 11px; align-items: center; padding: 9px 12px; border-bottom: 1px solid #eee7df; }
.product-row:last-child { border-bottom: 0; }
.product-image { width: 52px; height: 52px; display: grid; place-items: center; overflow: hidden; background: #faf4eb; border: 1px solid #eee2d4; border-radius: 10px; font-size: 30px; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-copy h3, .cart-row h3 { margin: 0; font-size: 14px; line-height: 1.2; }
.product-copy p, .cart-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.price { color: var(--red); font-size: 13px; white-space: nowrap; }
.add-button { width: 32px; height: 32px; padding: 0; color: white; background: var(--red); border: 0; border-radius: 9px; font-size: 20px; font-weight: 750; }

.cart { position: sticky; top: 18px; padding: 18px; }
.cart-title-row { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.cart-title-row h2 { margin: 0; color: var(--red); font: 700 22px Georgia, serif; }
.count { min-width: 28px; height: 28px; display: grid; place-items: center; color: white; background: var(--red); border-radius: 50%; font-weight: 800; }
.cart-items { min-height: 80px; }
.empty { margin: 26px 0; color: var(--muted); text-align: center; }
.cart-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 9px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.product-image.small { width: 42px; height: 42px; font-size: 23px; }
.quantity { display: flex; align-items: center; gap: 6px; }
.quantity button { width: 25px; height: 25px; padding: 0; color: var(--red); background: white; border: 1px solid var(--line); border-radius: 6px; }
.quantity span { min-width: 12px; text-align: center; }
.cart-total { display: flex; justify-content: space-between; padding: 18px 0 8px; font-size: 18px; }
.cart-total strong { color: var(--red); }
.cart-note { margin: 6px 0 0; padding: 11px; color: var(--muted); background: #faf5ec; border-radius: 8px; font-size: 12px; }
.mobile-cart { display: none; }

.admin-main { max-width: 1100px; }
.login-panel { width: min(480px, 100%); margin: 8vh auto; padding: clamp(24px, 5vw, 42px); }
.login-panel h1 { font-size: 44px; }
.login-panel > p:not(.eyebrow) { color: var(--muted); }
.form-stack { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 750; }
input { width: 100%; min-height: 45px; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #d9cec3; border-radius: 8px; outline: none; }
input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(133,13,26,.12); }
.primary-button, .secondary-button, .danger-button { min-height: 42px; padding: 9px 15px; border-radius: 8px; font-weight: 800; }
.primary-button { color: white; background: var(--red); border: 1px solid var(--red); }
.secondary-button { color: var(--red); background: white; border: 1px solid #d9c9c8; }
.danger-button { color: #a20f1e; background: #fff3f3; border: 1px solid #f0c8cd; }
.error { min-height: 1.2em; color: #a20f1e; font-weight: 700; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.admin-heading h1 { font-size: 48px; }
.admin-actions { display: flex; gap: 8px; }
.admin-products { display: grid; gap: 10px; }
.admin-product { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 14px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 5px 20px rgba(72,39,25,.06); }
.admin-product .product-image { width: 64px; height: 64px; }
.admin-product h2 { margin: 1px 0 3px; font-size: 17px; }
.admin-product p { margin: 0; color: var(--muted); }
.admin-product .product-category { color: var(--gold); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.admin-product-actions { display: flex; gap: 7px; }
dialog { width: min(620px, calc(100% - 28px)); padding: 0; background: white; border: 0; border-radius: 16px; box-shadow: 0 24px 80px rgba(32,12,8,.3); }
dialog::backdrop { background: rgba(31, 13, 10, .65); backdrop-filter: blur(4px); }
.product-form { padding: clamp(20px, 4vw, 32px); }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin: 0; color: var(--red); font: 700 28px Georgia, serif; }
.icon-button { width: 38px; height: 38px; padding: 0; background: #f6f0e8; border: 0; border-radius: 50%; font-size: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 25px 0; }
.file-label { grid-column: 1 / -1; }
.file-label small { color: var(--muted); font-weight: 400; }
.dialog-actions { justify-content: flex-end; }

@media (max-width: 980px) {
  .menu-layout { grid-template-columns: 1fr; }
  .cart { position: static; scroll-margin-top: 20px; }
}

@media (max-width: 680px) {
  body { padding-bottom: 78px; }
  .site-header { min-height: 72px; padding: 10px 15px; }
  .brand { gap: 10px; }
  .brand-mark { width: 40px; height: 40px; font-size: 25px; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 10px; }
  .admin-link { padding: 8px 10px; font-size: 12px; }
  main { padding: 24px 12px 44px; }
  .intro h1 { font-size: 39px; }
  .intro > p:last-child { font-size: 14px; }
  .menu-grid { grid-template-columns: 1fr; gap: 13px; }
  .category-card { border-radius: 11px; }
  .product-row { grid-template-columns: 48px minmax(0, 1fr) auto 32px; padding-inline: 9px; }
  .product-image { width: 48px; height: 48px; }
  .price { font-size: 12px; }
  .mobile-cart { position: fixed; z-index: 5; inset: auto 0 0; display: flex; align-items: center; justify-content: space-between; padding: 11px 14px max(11px, env(safe-area-inset-bottom)); color: white; background: linear-gradient(105deg, var(--red-dark), var(--red)); box-shadow: 0 -6px 20px rgba(66,5,12,.25); }
  .mobile-cart[hidden] { display: none; }
  .mobile-cart span { display: flex; gap: 8px; align-items: baseline; }
  .mobile-cart small { opacity: .85; }
  .mobile-cart button { padding: 9px 12px; color: var(--red); background: white; border: 0; border-radius: 8px; font-weight: 800; }
  .admin-heading { align-items: flex-start; flex-direction: column; }
  .admin-actions { width: 100%; }
  .admin-actions button { flex: 1; }
  .admin-product { grid-template-columns: 54px 1fr; }
  .admin-product .product-image { width: 54px; height: 54px; }
  .admin-product-actions { grid-column: 1 / -1; }
  .admin-product-actions button { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .file-label { grid-column: auto; }
}
