:root {
  --ink: #14212b;
  --ink-soft: #4a5a66;
  --line: #e3e8ec;
  --bg: #f5f7f8;
  --card: #ffffff;
  --brand: #0f5c5c;
  --brand-dark: #0a4242;
  --accent: #ff7a45;
  --accent-dark: #e8622d;
  --good: #1f8a4c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 33, 43, .06), 0 4px 16px rgba(20, 33, 43, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--brand-dark); color: #fff; }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.logo-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 18px;
}
.search { flex: 1; display: flex; height: 44px; border-radius: 10px; overflow: hidden; background: #fff; }
.search select { border: 0; background: #eef2f3; padding: 0 10px; color: var(--ink); max-width: 140px; }
.search input { flex: 1; border: 0; padding: 0 14px; color: var(--ink); min-width: 0; }
.search input:focus, .search select:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 3px var(--accent); }
.search button { border: 0; background: var(--accent); color: #fff; font-weight: 700; padding: 0 20px; cursor: pointer; }
.search button:hover { background: var(--accent-dark); }
.topnav { display: flex; align-items: center; gap: 18px; font-weight: 600; font-size: 15px; }
.topnav a:hover { opacity: .8; }
.sell-link { border: 1.5px solid rgba(255,255,255,.5); padding: 6px 14px; border-radius: 8px; }
.cart-link { position: relative; display: inline-flex; }
.cart-count {
  position: absolute; top: -8px; right: -10px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--accent); font-size: 12px; font-weight: 800;
  display: grid; place-items: center;
}
.catbar { background: var(--brand); }
.catbar-inner { display: flex; gap: 6px; overflow-x: auto; height: 42px; align-items: center; scrollbar-width: none; }
.catbar-inner a { white-space: nowrap; font-size: 14px; font-weight: 600; padding: 5px 12px; border-radius: 999px; opacity: .9; }
.catbar-inner a:hover, .catbar-inner a.active { background: rgba(255,255,255,.15); opacity: 1; }

main { min-height: 60vh; padding-top: 24px; padding-bottom: 48px; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center;
  background: linear-gradient(120deg, #0f5c5c 0%, #137070 55%, #1c8a7d 100%);
  color: #fff; border-radius: 18px; padding: 44px; overflow: hidden; position: relative;
}
.hero h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 14px; }
.hero p { font-size: 17px; opacity: .9; margin: 0 0 24px; max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-tile {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 14px;
  padding: 18px; display: flex; flex-direction: column; gap: 6px; transition: background .2s;
}
.hero-tile:hover { background: rgba(255,255,255,.2); }
.hero-tile .emoji { font-size: 30px; }
.hero-tile strong { font-size: 15px; }
.hero-tile span { font-size: 13px; opacity: .8; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 10px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 15px; transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: inherit; border: 1.5px solid currentColor; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }

/* Trust strip */
.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 36px; }
.trust div { background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); font-size: 14px; }
.trust strong { display: block; font-size: 15px; }
.trust span { color: var(--ink-soft); }

/* Sections + grid */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 14px; }
.section-head h2 { font-size: 22px; letter-spacing: -.02em; margin: 0; }
.section-head a { color: var(--brand); font-weight: 700; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 36px; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(20,33,43,.08), 0 10px 28px rgba(20,33,43,.1); }
.thumb { aspect-ratio: 1 / 1; display: grid; place-items: center; font-size: 72px; position: relative; }
.thumb-lg { font-size: 160px; border-radius: 16px; }
.badge {
  position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: #fff; color: var(--ink);
}
.badge-deal { background: var(--accent); color: #fff; }

/* Real product photos: whole product visible on white, never cropped */
.thumb-photo { background: #fff; padding: 10px; }
.thumb-photo img { width: 100%; height: 100%; object-fit: contain; }
.thumb-lg.thumb-photo { padding: 24px; border: 1px solid var(--line); }
.gallery { display: flex; flex-direction: column; gap: 10px; }
.gallery-strip { display: flex; gap: 8px; overflow-x: auto; }
.gallery-pick { flex: none; width: 64px; height: 64px; padding: 4px; border: 2px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.gallery-pick.active { border-color: var(--brand); }
.gallery-pick img { width: 100%; height: 100%; object-fit: contain; }

/* Three-step bar: home page + top of cart / checkout / confirmation */
.how { margin: 28px 0 32px; }
.how h2 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 12px; }
.steps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border: 2px solid transparent; }
.steps small { display: block; color: var(--ink-soft); font-size: 13px; }
.step-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #e8eef0; color: var(--ink-soft); }
.steps li.current { border-color: var(--accent); }
.steps li.current .step-num { background: var(--accent); color: #fff; }
.steps li.done .step-num { background: var(--good); color: #fff; }

/* Delivery choice */
.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid #cfd8de; border-radius: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand); background: #f0f7f7; }
.choice input { accent-color: var(--brand); width: 18px; height: 18px; }
.choice small { display: block; color: var(--ink-soft); font-size: 13px; }
.choice-fee { margin-left: auto; font-weight: 700; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.price s { font-weight: 500; font-size: 14px; color: var(--ink-soft); margin-left: 6px; }
.meta { font-size: 13px; color: var(--ink-soft); }
.stars { color: #f2a300; letter-spacing: 1px; }
.card .btn { margin-top: auto; }

/* Product page */
.crumbs { font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; }
.crumbs a { color: var(--brand); font-weight: 600; }
.product { display: grid; grid-template-columns: 1.1fr 1fr 320px; gap: 28px; align-items: start; }
.product h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 8px; }
.product .price { font-size: 30px; margin: 12px 0; }
.spec { list-style: none; padding: 0; margin: 16px 0; border-top: 1px solid var(--line); }
.spec li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec li span:first-child { color: var(--ink-soft); }
.buybox { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 130px; }
.buybox .in-stock { color: var(--good); font-weight: 700; }
.qty { display: flex; align-items: center; gap: 10px; }
.qty select { height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; }
.seller { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.seller small { color: var(--ink-soft); display: block; }

/* Cart */
.layout-2 { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel h2 { margin: 0 0 12px; font-size: 20px; }
.cart-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-row:last-child { border-bottom: 0; }
.cart-row .thumb { font-size: 40px; border-radius: 10px; }
.cart-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cart-actions select { height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; background: #fff; }
.link-btn { background: none; border: 0; color: var(--brand); font-weight: 700; cursor: pointer; padding: 0; font-size: 14px; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 15px; }
.sum-total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 19px; }

/* Forms */
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field select, .field textarea {
  height: 44px; border: 1px solid #cfd8de; border-radius: 9px; padding: 0 12px; background: #fff;
}
.field textarea { height: 110px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,92,92,.15); }
.hint { font-size: 13px; color: var(--ink-soft); }

.empty { text-align: center; padding: 60px 20px; }
.empty .emoji { font-size: 56px; }
.spinner { width: 40px; height: 40px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty h2 { margin: 10px 0 6px; }
.empty p { color: var(--ink-soft); margin: 0 0 20px; }

.page-title { font-size: 26px; letter-spacing: -.02em; margin: 0 0 18px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; color: var(--ink-soft); font-size: 14px; }
.toolbar select { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 16px; font-weight: 600; cursor: pointer; }
.tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--ink-soft); font-weight: 600; }
.status { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #e6f4ec; color: var(--good); }

/* Footer */
.footer { background: var(--ink); color: #c9d3da; padding: 40px 0 20px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.footer h4 { color: #fff; margin: 0 0 10px; font-size: 15px; }
.footer a { display: block; font-size: 14px; padding: 3px 0; }
.footer a:hover { color: #fff; }
.logo-light { color: #fff; }
.footer p { font-size: 14px; max-width: 32ch; }
.footer-note { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 600;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
  .product { grid-template-columns: 1fr 1fr; }
  .buybox { grid-column: 1 / -1; position: static; }
  .hero { grid-template-columns: 1fr; padding: 32px; }
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; }
  .topnav { margin-left: auto; }
  .search select { display: none; }
  .trust { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .product, .layout-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .thumb { font-size: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
