/* Bakery Nana — үндсэн загвар */
:root {
  /* Bakery палитр: ванилийн цөцгий, какао шоколад, гүзээлзгэнэ */
  --bg: #FFF8F3;
  --card: #FFFFFF;
  --line: #F1E0D6;
  --line-2: #E3C9BC;
  --text: #3B2219;
  --muted: #75594B;
  --primary: #7A3E2B;
  --primary-dark: #5E2D1E;
  --primary-tint: #FCECE8;
  --choc: #5A2A1C;
  --accent: #D04A63;
  --accent-tint: #FDE8EC;
  --rust: #9A3B2E;
  --rust-tint: #FDF0EC;
  --berry: #D04A63;
  --ok: #3F7D3A;
  --radius: 16px;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Lora', Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 560px; }
.stack, .stack-sm, .stack-lg { display: flex; flex-direction: column; }
.stack { gap: 12px; }
.stack-sm { gap: 8px; }
.stack-lg { gap: 22px; }
.stack > .alert, .stack-lg > .alert { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.row-between { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.align-start { align-items: flex-start; }

.h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 4vw, 34px); line-height: 1.2; color: var(--choc); }
.h2 { font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.25; color: var(--choc); }
.h3 { font-size: 16px; font-weight: 800; }
.h4 { font-size: 16px; font-weight: 800; }
.page-title { margin-top: 6px; }
.link-strong { font-weight: 700; text-decoration: none; font-size: 14px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(251, 245, 236, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.header-row { display: flex; align-items: center; gap: 8px; min-height: 64px; }
.brand { display: block; margin-right: auto; }
.brand img { height: 40px; width: auto; }
.top-nav { display: none; gap: 24px; margin-right: 12px; }
.top-nav a { color: var(--text); text-decoration: none; font-weight: 700; padding: 8px 0; border-bottom: 2px solid transparent; }
.top-nav a[aria-current] { color: var(--primary); border-color: var(--primary); }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 22px; color: var(--text); background: none; border: 0; cursor: pointer; position: relative; text-decoration: none; }
.icon-btn:hover { background: rgba(0, 0, 0, .04); color: var(--text); }
.badge-count { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--berry); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

.site-main { padding: 16px 0 110px; min-height: 60vh; }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 110px; font-size: 14px; }
.site-footer .wrap > * + * { margin-top: 8px; }
.site-footer img { height: 32px; width: auto; }
.site-footer a { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-weight: 700; }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 700; }
.bottom-nav a[aria-current] { color: var(--primary); font-weight: 800; }
.bottom-nav a[aria-current]::before { content: ''; position: absolute; top: 0; width: 44px; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 23px; background: var(--primary); color: #fff; font-weight: 800; font-size: 15px; text-decoration: none; border: 0; cursor: pointer; }
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--text); border: 1.5px solid var(--line-2); border-radius: 12px; min-height: 42px; font-weight: 700; }
.btn-outline:hover { background: var(--primary-tint); color: var(--text); border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-ghost:hover { background: var(--primary-tint); color: var(--primary-dark); }
.btn-danger { background: var(--berry); }
.btn-danger:hover { background: #962639; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 18px; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 54px; font-size: 17px; border-radius: 27px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.alert { padding: 12px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.alert-ok { background: var(--primary-tint); color: var(--primary-dark); }
.alert-err { background: #FBE9EC; color: #8E2236; }
.note-soft { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--rust-tint); color: var(--rust); font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.note-soft svg { flex: none; margin-top: 1px; }

/* Home */
.hero { padding: 0; overflow: hidden; background: var(--primary-tint); }
.hero-img { width: 100%; height: clamp(180px, 38vw, 380px); object-fit: cover; }
.hero-body { padding: 16px 18px 20px; background: var(--primary-tint); }
.hero-body > * + * { margin-top: 10px; }
.hero-body .btn { margin-top: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); }
.mini-card img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; width: 100%; }
.mini-name { font-weight: 800; font-size: 14px; line-height: 1.2; }
.mini-price { font-size: 13px; font-weight: 700; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; font-weight: 700; line-height: 1.25; color: var(--text); }
.feature svg { color: var(--accent); }

/* Products */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: none; min-height: 36px; padding: 0 16px; border-radius: 18px; background: #fff; border: 1px solid var(--line-2); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }
.chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
.product-card { display: flex; flex-direction: column; gap: 8px; }
.product-img img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: 16px; width: 100%; }
.product-name { font-size: 16px; font-weight: 800; line-height: 1.3; }
.product-name a { color: var(--text); text-decoration: none; }
.product-price { font-size: 17px; font-weight: 800; }
.size-table { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; }
.size-table > div { padding: 8px 2px; border-radius: 10px; background: var(--bg); display: flex; flex-direction: column; font-size: 13px; }

/* Product */
.product-page { display: grid; gap: 20px; }
.product-hero img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 20px; }
.ing + .ing { margin-top: 10px; }
.ing-label { font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--accent); }
.ing p { font-size: 14px; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.field legend, .legend { display: block; padding: 0; margin-bottom: 10px; font-size: 15px; font-weight: 800; }
.field input[type=text], .field input[type=tel], .form input, .form select, .form textarea, .form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; font-size: 16px;
}
textarea { resize: vertical; }
.field input:focus, .form input:focus, .form-grid input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.counter { display: block; text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }

.opt { display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt-box { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: #fff; }
.opt-box.center { justify-content: center; font-weight: 700; min-height: 46px; }
.opt-main { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.opt-main small { color: var(--muted); font-size: 12px; }
.opt input:checked + .opt-box { border-color: var(--primary); background: var(--primary-tint); }
.opt input:focus-visible + .opt-box { outline: 2px solid var(--primary); outline-offset: 2px; }
.size-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.size-options .opt input:checked + .opt-box { background: var(--primary); color: #fff; }
.size-options .opt input:checked + .opt-box small { color: #F3DED6; }
.opt-check + .opt-check { margin-top: 8px; }
.tick { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid #C9AFA2; display: flex; align-items: center; justify-content: center; color: transparent; background: #fff; }
.opt input:checked + .opt-box .tick { background: var(--primary); border-color: var(--primary); color: #fff; }
.opt-check svg { stroke-width: 3.2; }
.dot { flex: none; width: 22px; height: 22px; border-radius: 11px; border: 2px solid #C9AFA2; position: relative; }
.opt input:checked + .opt-box .dot { border-color: var(--primary); }
.opt input:checked + .opt-box .dot::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--primary); }
.opt-radio + .opt-radio { margin-top: 8px; }
.upload { margin-top: 8px; }
.upload-box { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1.5px dashed #DDA9A0; background: var(--primary-tint); cursor: pointer; }
.upload-box small { display: block; color: var(--muted); font-size: 12px; }
.upload-box b { color: var(--primary-dark); word-break: break-all; }
.upload-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; }

.sticky-buy { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 20px rgba(58, 36, 24, .10); }
.sticky-buy small { display: block; }
.total { font-size: 21px; font-weight: 800; }

/* Cart */
.empty { text-align: center; padding: 32px 16px; }
.empty .btn { margin-top: 14px; }
.cart-item { display: flex; gap: 12px; align-items: flex-start; }
.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 12px; flex: none; }
.cart-info { flex: 1; min-width: 0; }
.cart-info > * + * { margin-top: 2px; }
.day-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.opt-box.day { flex-direction: column; justify-content: center; gap: 0; min-height: 78px; padding: 6px 2px; text-align: center; }
.opt-box.day b { font-size: 19px; line-height: 1.2; }
.opt-box.day small { font-size: 11px; font-weight: 700; }
.opt-box.day .mon { color: var(--muted); font-weight: 600; }
.opt-box.day em { font-style: normal; font-size: 10px; font-weight: 800; color: var(--rust); }
.day-options .opt input:checked + .opt-box { background: var(--primary); color: #fff; }
.day-options .opt input:checked + .opt-box em, .day-options .opt input:checked + .opt-box .mon { color: #fff; }
.slot-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot-options .opt input:checked + .opt-box { background: var(--primary); color: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px 16px; align-items: end; }
.form-grid label, .form label { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; font-size: 14px; font-weight: 700; }
.form-grid input, .form-grid select { height: 48px; }
.form-grid textarea { min-height: 84px; }
.form-grid select, .form select, .filters select { -webkit-appearance: none; appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237A3E2B' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center; }
.summary .total-row, .total-row { border-top: 1px solid var(--line); padding-top: 10px; font-size: 18px; }

/* Order */
.success-head { display: flex; gap: 12px; align-items: center; }
.ok-ico { flex: none; width: 48px; height: 48px; border-radius: 24px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; }
.order-no { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 14px; background: var(--bg); }
.order-no b { font-size: 30px; letter-spacing: .06em; color: var(--choc); }
.status { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 800; background: #EEE6DA; color: var(--text); }
.status-new { background: var(--rust-tint); color: var(--rust); }
.status-paid, .status-baking { background: var(--primary-tint); color: var(--primary-dark); }
.status-delivery { background: #E8EEF7; color: #2C4A72; }
.status-done { background: var(--primary); color: #fff; }
.status-cancelled { background: #EEE; color: #555; }
.pay-box { padding: 14px; border-radius: 14px; border: 1.5px solid var(--primary); background: var(--primary-tint); }
.pay-box .big { font-size: 22px; }
.urgent-tag { font-style: normal; color: var(--rust); font-weight: 800; }
.order-card p svg { vertical-align: -4px; color: var(--primary); }

@media (min-width: 768px) {
  .top-nav { display: flex; }
  .bottom-nav { display: none; }
  .site-main { padding-bottom: 48px; }
  .site-footer { padding-bottom: 32px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; }
  .product-page { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
  .product-hero { position: sticky; top: 84px; }
  .sticky-buy { bottom: 16px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: span 2; }
  .hero { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; }
  .hero-img { height: 100%; min-height: 360px; }
  .hero-body { padding: 32px; }
  .mini-grid { gap: 20px; }
  .features { gap: 16px; }
  .feature { font-size: 14px; padding: 18px 12px; }
}

/* ---------- Admin ---------- */
.admin-body { background: #FBF3EE; }
.admin-top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.admin-top .wrap { display: flex; align-items: center; gap: 16px; min-height: 58px; flex-wrap: wrap; }
.admin-top img { height: 32px; width: auto; }
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.admin-nav a { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 14px; }
.admin-nav a[aria-current] { background: var(--primary-tint); color: var(--primary-dark); }
.admin-main { padding: 20px 0 60px; }
.admin-main .wrap { max-width: 1200px; }
.install-logo { width: 240px; margin: 24px auto 16px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat small { color: var(--muted); font-weight: 700; font-size: 13px; }
.stat b { display: block; font-size: 24px; margin-top: 4px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #F0E8DC; vertical-align: top; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #FBF8F3; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl input:not([type=checkbox]), .tbl select { display: block; width: 100%; height: 40px; padding: 6px 10px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 14px; box-sizing: border-box; }
.tbl td { vertical-align: middle; }
.tbl input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primary); }
.tbl td.c, .tbl th.c { text-align: center; }
.tbl input.num { text-align: right; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
.filters input, .filters select { height: 42px; padding: 6px 10px; border: 1.5px solid var(--line-2); border-radius: 10px; background-color: #fff; font-size: 14px; }
.filters select { padding-right: 34px; }
.btn-act { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; min-width: 112px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 800; text-decoration: none; cursor: pointer; border: 1.5px solid var(--primary); background: #fff; color: var(--primary); white-space: nowrap; }
.btn-act:hover { background: var(--primary-tint); color: var(--primary-dark); }
.btn-act.solid { background: var(--primary); color: #fff; }
.btn-act.solid:hover { background: var(--primary-dark); color: #fff; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.section-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tbl.fixed { table-layout: fixed; }
.tbl .w-xs { width: 80px; } .tbl .w-sm { width: 110px; } .tbl .w-md { width: 150px; } .tbl .w-lg { width: 180px; }
.admin-grid { display: grid; gap: 16px; }
.thumb { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.pos { color: var(--ok); font-weight: 800; }
.neg { color: var(--berry); font-weight: 800; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (min-width: 900px) { .admin-grid.two { grid-template-columns: 1.4fr 1fr; align-items: start; } }
@media print { .admin-top, .no-print { display: none !important; } .admin-body { background: #fff; } }
.form-grid input, .form-grid select, .form-grid textarea, .form input, .form select, .form textarea, .filters input, .filters select, .field input { font-weight: 400; }
