:root {
  --ink: #1b2232; --muted: #6f6a5f; --paper: #f7f3ea; --card: #fffdf8; --line: #e8e0cf;
  --navy: #1f3a5f; --navy-2: #142844; --gold: #b5862f; --gold-2: #d8b169; --ok: #17803d; --bad: #b42318; --warn: #b05f05;
  --r: 16px; --shadow: 0 10px 30px rgba(31, 42, 68, .08), 0 2px 6px rgba(31, 42, 68, .05);
  --serif: "Frank Ruhl Libre", "David", "Times New Roman", serif;
  --sans: "Heebo", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* hero */
.hero { background: radial-gradient(900px 400px at 85% -20%, #345a8c 0%, transparent 60%), linear-gradient(165deg, var(--navy-2), var(--navy) 60%, #284975);
  color: #f6ecd2; padding: 26px 20px 34px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(243, 226, 184, .07) 1px, transparent 1px); background-size: 20px 20px; pointer-events: none; }
.hero-inner, .hero-tools { max-width: 1180px; margin: 0 auto; position: relative; z-index: 1; }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 16px; }
.logo { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: var(--navy-2); display: grid; place-items: center;
  font-family: var(--serif); font-weight: 900; font-size: 30px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); overflow: hidden; flex: none; }
.logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.brand h1 { font-family: var(--serif); font-size: clamp(24px, 4vw, 38px); margin: 0; font-weight: 900; letter-spacing: -.3px; line-height: 1.15; }
.brand p { margin: 4px 0 0; color: #dccca5; font-size: 15px; }
.cart-btn { display: flex; align-items: center; gap: 9px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(243, 226, 184, .3); color: #fff; padding: 10px 16px; border-radius: 14px; cursor: pointer; position: relative; transition: background .2s; }
.cart-btn:hover { background: rgba(255, 255, 255, .18); }
.cart-btn .count { background: var(--gold-2); color: var(--navy-2); font-weight: 800; border-radius: 10px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: 12.5px; padding: 0 6px; }
.cart-btn.bump { animation: bump .4s ease; }
@keyframes bump { 40% { transform: scale(1.08); } }
.hero-tools { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search { position: relative; flex: 1 1 300px; max-width: 460px; }
.search input { width: 100%; padding: 12px 44px 12px 16px; border-radius: 14px; border: 1px solid rgba(243, 226, 184, .25); background: rgba(255, 255, 255, .95); color: var(--ink); outline: none; }
.search input:focus { box-shadow: 0 0 0 3px rgba(216, 177, 105, .45); }
.search > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.cats { display: flex; gap: 8px; flex-wrap: wrap; }
.cats button { background: rgba(255, 255, 255, .08); border: 1px solid rgba(243, 226, 184, .25); color: #f3e6c4; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-weight: 600; transition: .2s; }
.cats button.on, .cats button:hover { background: var(--gold-2); color: var(--navy-2); border-color: var(--gold-2); }

/* grid */
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 120px; }
.notice { background: #fff4e0; border: 1px solid #f0d9a8; color: #6b4a0e; padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease; animation: rise .4s ease both; }
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(31, 42, 68, .12); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.cover { aspect-ratio: 4 / 3; background: linear-gradient(150deg, #24416a, #1a3152); position: relative; display: grid; place-items: center; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .ph { color: #e9d7ab; font-family: var(--serif); text-align: center; padding: 18px; }
.cover .ph svg { width: 44px; height: 44px; opacity: .8; margin-bottom: 6px; }
.cover .ph div { font-size: 19px; font-weight: 700; line-height: 1.3; }
.cover::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(233, 215, 171, .35); border-radius: 10px; pointer-events: none; }
.tag { position: absolute; top: 14px; right: 14px; background: var(--gold-2); color: var(--navy-2); font-weight: 800; font-size: 12.5px; padding: 4px 10px; border-radius: 8px; z-index: 1; }
.tag.out { background: #e7e2d6; color: #6f6a5f; }
.body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.body h3 { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.35; font-weight: 700; }
.body .desc { color: var(--muted); font-size: 13.5px; margin: 0; }
.meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.price { font-size: 23px; font-weight: 800; color: var(--navy); }
.price s { font-size: 14px; color: var(--muted); font-weight: 500; margin-inline-start: 6px; }
.avail { font-size: 12.5px; color: var(--ok); font-weight: 600; }
.avail.low { color: var(--warn); }
.avail.out { color: var(--muted); }
.add { display: flex; gap: 8px; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.qty button { width: 36px; height: 40px; border: none; background: none; cursor: pointer; font-size: 18px; color: var(--navy); }
.qty button:hover { background: #f3eee2; }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty span { min-width: 30px; text-align: center; font-weight: 700; }
.btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 12px; padding: 10px 16px; font-weight: 700; cursor: pointer; transition: background .2s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); color: #fff; }
.btn.gold:hover { background: #9f7426; }
.btn.ghost { background: #efe9dc; color: var(--ink); }
.btn:disabled { background: #e3ddd0; color: #9a9384; cursor: not-allowed; }
.btn.in-cart { background: #e3efe6; color: var(--ok); }
.empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--muted); }
.skel { height: 360px; border-radius: var(--r); background: linear-gradient(90deg, #efe8da, #f8f4ec, #efe8da); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* cart */
.scrim { position: fixed; inset: 0; background: rgba(15, 20, 35, .45); z-index: 50; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.cart { position: fixed; top: 0; bottom: 0; left: 0; width: min(460px, 100%); background: var(--paper); z-index: 60; display: flex; flex-direction: column; box-shadow: 0 0 60px rgba(0, 0, 0, .3); animation: slide .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { transform: translateX(-100%); } }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; background: var(--navy); color: #f6ecd2; }
.cart-head h2 { margin: 0; font-family: var(--serif); font-size: 22px; }
.x { background: rgba(255, 255, 255, .12); color: #fff; border: none; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 16px; }
.cart-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); background: var(--card); }
.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line .n { font-weight: 700; }
.line .p { color: var(--muted); font-size: 13px; }
.line .sub { font-weight: 800; text-align: left; }
.line .ctr { display: flex; align-items: center; gap: 10px; }
.line .rm { background: none; border: none; color: var(--bad); cursor: pointer; font-size: 13px; padding: 0; }
.line .warn { grid-column: 1 / -1; color: var(--bad); font-size: 12.5px; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.total b { font-size: 26px; color: var(--navy); }
.form { display: grid; gap: 12px; }
.form label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 4px; }
.form input, .form textarea { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: #fff; outline: none; }
.form input:focus, .form textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31, 58, 95, .12); }
.form .err { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(180, 35, 24, .12); }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.msg { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.msg.bad { background: #fde8e6; color: var(--bad); }
.msg.info { background: #eef2f8; color: var(--navy); }
.steps { display: flex; gap: 8px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.steps span.on { color: var(--navy); font-weight: 700; }
.done { text-align: center; padding: 20px 4px; }
.done .ok { width: 76px; height: 76px; border-radius: 50%; background: #e3f4e8; color: var(--ok); display: grid; place-items: center; margin: 6px auto 14px; animation: pop .5s cubic-bezier(.2, .8, .2, 1.3); }
.done .ok svg { width: 40px; height: 40px; stroke-width: 2.5; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.done h3 { font-family: var(--serif); font-size: 26px; margin: 0 0 4px; }
.done .no { font-size: 18px; margin-bottom: 14px; }
.done ul { list-style: none; padding: 0; margin: 14px 0; text-align: right; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.done li { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.done li:last-child { border-bottom: none; font-weight: 800; }

/* footer & mobile bar */
.foot { max-width: 1180px; margin: 0 auto; padding: 20px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }
.mobile-bar { position: fixed; bottom: 12px; left: 12px; right: 12px; z-index: 40; background: var(--navy); color: #fff; border-radius: 16px; padding: 10px 12px 10px 16px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: rise .3s ease; }
.mobile-bar div { display: flex; flex-direction: column; }
.mobile-bar span { font-size: 12px; color: #d6c9a8; }
.mobile-bar button { background: var(--gold-2); color: var(--navy-2); border: none; font-weight: 800; padding: 10px 18px; border-radius: 12px; cursor: pointer; }
@media (min-width: 761px) { .mobile-bar { display: none !important; } }
@media (max-width: 760px) {
  .hero { padding: 18px 16px 22px; }
  .logo { width: 50px; height: 50px; font-size: 24px; border-radius: 14px; }
  .cart-btn .lbl { display: none; }
  .wrap { padding: 18px 14px 110px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .cover { aspect-ratio: 16 / 7; }
  .form .row2 { grid-template-columns: 1fr; }
}
@media (min-width: 520px) and (max-width: 760px) { .grid { grid-template-columns: 1fr 1fr; } .cover { aspect-ratio: 4 / 3; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
