:root {
  --brand: #ff6a00;
  --brand-dark: #e45c00;
  --brand-soft: #fff3ea;
  --new: #e5183c;
  --ink: #1f2329;
  --muted: #6b7280;
  --line: #e7e8eb;
  --bg: #f4f5f7;
  --card: #fff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.45; font-size: 15px;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.3px; white-space: nowrap; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 9px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 19px; font-weight: 800;
}
.logo b { color: var(--brand); }
/* "Install app" button under the logo (shop + admin); pwa.js hides it inside the installed app */
.logo-col { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: none; }
.install-btn {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap;
  border: 0; border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em; line-height: 1.5;
  background: linear-gradient(135deg, #ffd600, #ffe94d); color: #1f2329; box-shadow: 0 2px 8px rgba(230,180,0,.45);
  transition: transform .15s, box-shadow .15s;
}
.install-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(230,180,0,.6); }
.install-btn[hidden] { display: none; }
.install-btn span { font-size: 12px; }
.install-tip { position: fixed; inset: 0; z-index: 1000; background: rgba(15,17,21,.45); display: grid; place-items: center; padding: 20px; }
.it-box { position: relative; background: #fff; color: #16181d; border-radius: 16px; padding: 24px 22px 20px; max-width: 340px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.it-box b { display: block; font-size: 18px; margin-bottom: 6px; }
.it-box p { margin: 0; color: #444; line-height: 1.6; font-size: 15px; }
.it-ico { width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 50%; background: #fff1e6; color: #ff6a00; display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.it-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #f2f2f2; cursor: pointer; font-size: 20px; line-height: 1; }
.search { flex: 1; display: flex; max-width: 640px; border: 2px solid var(--brand); border-radius: 999px; overflow: hidden; background: #fff; }
.search input { flex: 1; border: 0; padding: 10px 18px; outline: none; min-width: 0; }
.search button { border: 0; background: var(--brand); color: #fff; padding: 0 22px; font-weight: 600; cursor: pointer; }
.search button:hover { background: var(--brand-dark); }
.top-link { color: var(--muted); font-size: 14px; white-space: nowrap; }
.top-link:hover { color: var(--brand); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 999px; padding: 9px 20px;
  font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.danger { background: #fff; color: #c62828; border-color: #f3c7c7; }
.btn.danger:hover { background: #fdecec; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: #fff; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { min-height: 120px; resize: vertical; }

/* ---------- badges ---------- */
.new-badge {
  display: inline-flex; align-items: center; background: var(--new); color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: .6px; padding: 3px 8px; border-radius: 5px; line-height: 1.1;
  box-shadow: 0 2px 6px rgba(229,24,60,.35); animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .new-badge { animation: none; } }

/* ---------- sections ---------- */
main { padding: 24px 0 60px; }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 21px; }
.section-head a { color: var(--brand); font-size: 14px; font-weight: 600; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a:hover { color: var(--brand); }
.empty {
  background: #fff; border: 1px dashed #d4d6db; border-radius: var(--radius); padding: 50px 20px;
  text-align: center; color: var(--muted);
}

/* ---------- slideshow ---------- */
.slider { position: relative; border-radius: 14px; overflow: hidden; background: #1d1f24; height: 360px; box-shadow: var(--shadow); }
.slide {
  position: absolute; inset: 0; display: grid; grid-template-columns: 1.05fr 1fr; opacity: 0;
  transition: opacity .6s ease; pointer-events: none;
}
.slide.active { opacity: 1; pointer-events: auto; }
.slide-text {
  padding: 46px 48px; color: #fff; display: flex; flex-direction: column; justify-content: center; gap: 12px;
  background: linear-gradient(120deg, #ff6a00 0%, #ff8a3d 55%, #ffb07a 100%);
}
.slide-text .kicker { display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; opacity: .95; }
.slide-text h3 { margin: 0; font-size: 34px; line-height: 1.15; letter-spacing: -.5px; }
.slide-text .price { font-size: 24px; font-weight: 800; }
.slide-text .btn { align-self: flex-start; background: #fff; color: var(--brand); margin-top: 6px; }
.slide-text .btn:hover { background: #fff6ef; }
.slide-img { background: #fff; display: grid; place-items: center; overflow: hidden; }
.slide-img img { width: 100%; height: 100%; object-fit: cover; }
.slide-img .noimg { color: #bbb; font-size: 60px; }
.slider .arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.9); cursor: pointer; font-size: 20px; z-index: 3; box-shadow: var(--shadow);
}
.slider .arrow.prev { left: 14px; } .slider .arrow.next { right: 14px; }
.dots { position: absolute; bottom: 14px; left: 48px; display: flex; gap: 7px; z-index: 3; }
.dots button { width: 9px; height: 9px; border-radius: 99px; border: 0; background: rgba(255,255,255,.55); cursor: pointer; padding: 0; transition: width .25s; }
.dots button.on { background: #fff; width: 26px; }

.hero-empty {
  border-radius: 14px; padding: 48px; color: #fff; box-shadow: var(--shadow);
  background: linear-gradient(120deg, #ff6a00 0%, #ff8a3d 55%, #ffb07a 100%);
}
.hero-empty h1 { margin: 0 0 6px; font-size: 32px; }
.hero-empty p { margin: 0; opacity: .92; }

/* ---------- categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.cat-card {
  position: relative; background: var(--card); border-radius: var(--radius); padding: 14px; text-align: center;
  box-shadow: var(--shadow); border: 1px solid transparent; transition: border-color .15s, transform .15s;
}
.cat-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.cat-card .thumb { width: 96px; height: 96px; margin: 4px auto 10px; border-radius: 50%; overflow: hidden; background: var(--brand-soft); display: grid; place-items: center; }
.cat-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cat-card .thumb span { font-size: 36px; font-weight: 800; color: var(--brand); }
.cat-card .name { font-weight: 600; }
.cat-card .count { font-size: 12px; color: var(--muted); }
.cat-card .new-badge { position: absolute; top: 10px; right: 10px; }

/* ---------- product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }
.card {
  position: relative; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; border: 1px solid transparent; transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: #ffc59c; box-shadow: 0 6px 22px rgba(0,0,0,.09); }
.card .img { aspect-ratio: 1; background: #fafafa; overflow: hidden; }
.card .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .img img { transform: scale(1.04); }
.card .img .noimg { height: 100%; display: grid; place-items: center; color: #ccc; font-size: 42px; }
.card .body { padding: 11px 13px 14px; display: flex; flex-direction: column; gap: 5px; }
.card .title { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.card .price { font-size: 18px; font-weight: 800; }
.card .moq { font-size: 12px; color: var(--muted); }
.card .new-badge { position: absolute; top: 10px; left: 10px; z-index: 2; }

/* ---------- product page ---------- */
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; background: #fff; border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.gallery { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start; }
.thumbs { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.thumbs button { padding: 0; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: #fff; aspect-ratio: 1; }
.thumbs button.on, .thumbs button:hover { border-color: var(--brand); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.main-img { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #fafafa; border: 1px solid var(--line); }
.main-img img { width: 100%; height: 100%; object-fit: contain; }
.main-img .noimg { height: 100%; display: grid; place-items: center; color: #ccc; font-size: 70px; }
.info h1 { font-size: 23px; line-height: 1.3; margin: 0 0 10px; }
.info .meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.price-now { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 20px; }
.price-now b { font-size: 30px; font-weight: 800; color: var(--brand); }
.price-now span { color: var(--muted); font-size: 14px; }
.tiers { display: flex; background: var(--brand-soft); border-radius: 10px; margin: 18px 0; overflow: hidden; }
.tier { flex: 1; padding: 14px 16px; border-right: 1px solid #ffdcc2; }
.tier:last-child { border-right: 0; }
.tier .q { font-size: 12px; color: var(--muted); }
.tier .p { font-size: 24px; font-weight: 800; color: var(--ink); }
.tier.on .p { color: var(--brand); }
.facts { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; font-size: 14px; margin-bottom: 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.qty { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qty-box { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty-box button { border: 0; width: 36px; background: #f6f6f6; cursor: pointer; font-size: 18px; }
.qty-box input { width: 80px; border: 0; text-align: center; outline: none; padding: 8px 0; }
.total { font-size: 15px; } .total b { color: var(--brand); font-size: 20px; }
.details { background: #fff; border-radius: 14px; padding: 24px; box-shadow: var(--shadow); margin-top: 18px; }
.details h2 { font-size: 18px; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--brand); display: inline-block; }
.specs { width: 100%; border-collapse: collapse; margin-bottom: 22px; font-size: 14px; }
.specs td { border: 1px solid var(--line); padding: 9px 14px; }
.specs td:first-child { background: #fafafa; color: var(--muted); width: 30%; }
.desc { white-space: pre-wrap; font-size: 15px; }

/* soft page change */
#app > * { animation: page-in .55s cubic-bezier(.2,.7,.2,1) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #app > * { animation: none; } }

/* ---------- ordering ---------- */
.btn.big { padding: 12px 28px; font-size: 16px; }
.order-row { display: flex; align-items: center; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.order-note { color: var(--muted); font-size: 13px; }
.modal-back { position: fixed; inset: 0; background: rgba(17,19,24,.55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { position: relative; background: #fff; border-radius: 16px; width: min(560px, 100%); padding: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.3); max-height: 92vh; overflow-y: auto; }
.modal h2 { margin: 0 0 16px; font-size: 21px; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #f2f3f5; font-size: 20px; cursor: pointer; }
.om-item { display: flex; gap: 14px; align-items: center; background: var(--bg); border-radius: 10px; padding: 10px; margin-bottom: 16px; }
.om-item img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.om-sub { color: var(--brand); font-weight: 700; margin-top: 2px; }
.om-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.om-loc { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; background: var(--bg); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.om-loc #om-maplink { grid-column: 1 / -1; }
.om-loc-st { font-size: 13px; color: var(--muted); }
.om-loc-st.ok { color: #2e7d32; font-weight: 600; }
.om-loc-st.ok a { color: var(--brand); }
.om-loc-st.err { color: #b3261e; }
select.input { appearance: auto; }
.om-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.om-err { background: #fdecec; color: #b3261e; padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.om-done { text-align: center; padding: 10px 0; }
.om-check { width: 64px; height: 64px; border-radius: 50%; background: #e8f5e9; color: #2e7d32; font-size: 34px; display: grid; place-items: center; margin: 0 auto 12px; }
.om-done p { color: var(--muted); line-height: 1.6; }
@media (max-width: 560px) { .om-grid { grid-template-columns: 1fr; } }

/* ---------- order tracking ---------- */
.om-track { font-size: 13px; }
.track-wrap { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.track-form, .track-card { background: #fff; border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.track-form h1 { margin: 0 0 6px; font-size: 24px; }
.track-form p { margin: 0 0 18px; color: var(--muted); }
.tf-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.tc-head { display: flex; gap: 14px; align-items: center; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tc-head img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.tc-no { color: var(--brand); font-weight: 700; font-size: 13px; }
.tc-sub { color: var(--muted); font-size: 13px; }
.tc-cancel, .tc-err { color: #b3261e; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; display: flex; gap: 14px; padding-bottom: 22px; color: var(--muted); }
.tl li:last-child { padding-bottom: 0; }
.tl li::before { content: ''; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl li.done::before { background: var(--brand); }
.tl-dot { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; }
.tl li.done .tl-dot, .tl li.current .tl-dot { background: var(--brand); border-color: var(--brand); }
.tl li.current .tl-dot { box-shadow: 0 0 0 5px var(--brand-soft); }
.tl li.done, .tl li.current { color: var(--ink); }
.tl-text { font-size: 13px; color: var(--muted); }
@media (max-width: 600px) { .tf-row { grid-template-columns: 1fr; } }

footer { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 13px; padding: 22px 0; text-align: center; }

@media (max-width: 820px) {
  .topbar .wrap { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; }
  .slider { height: 460px; }
  .slide { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .slide-text { padding: 24px 24px 40px; order: 2; }
  .slide-text h3 { font-size: 24px; }
  .dots { left: 24px; }
  .product { grid-template-columns: 1fr; padding: 16px; }
  .gallery { grid-template-columns: 1fr; }
  .thumbs { flex-direction: row; order: 2; max-height: none; overflow-x: auto; }
  .thumbs button { width: 64px; flex: none; }
  .tier .p { font-size: 19px; }
}

/* payment-in-advance note in the order form */
.om-pay { display: grid; gap: 4px; margin: 4px 0 14px; padding: 12px 14px; border-radius: 10px; background: #fff7e6; border: 1px solid #f3d08a; color: #6b4a00; font-size: 14px; }
.om-pay b { font-size: 15px; }
