/* ===== Design tokens ===== */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --ink: #1a1d23;
  --ink-soft: #5b626e;
  --line: #e6e8ec;
  --brand: #059669;
  --brand-dark: #047857;
  --accent: #16a34a;
  --danger: #dc2626;
  --shadow: 0 6px 24px rgba(20, 23, 31, 0.08);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1180px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.muted { color: var(--ink-soft); }
.center { text-align: center; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--bg-soft); }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 26px; font-size: 1.02rem; }
.btn--sm { padding: 7px 13px; font-size: 0.85rem; }

/* ===== Product image tiles (real photo over emoji fallback) ===== */
.media-emoji {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.card__media, .pdp__media, .cart-row__media, .order-line .em { position: relative; overflow: hidden; }
.card__badge { z-index: 2; }

/* ===== Top promo bar ===== */
.topbar {
  background: var(--ink);
  color: #fff;
  font-size: 0.82rem;
  text-align: center;
  padding: 7px 0;
  font-weight: 500;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 68px;
}
.logo {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span { color: var(--brand); }
.nav {
  display: flex;
  gap: 22px;
}
.nav a {
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.95rem;
  transition: color 0.15s;
}
.nav a:hover { color: var(--ink); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
/* Search */
.search {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
}
.search button {
  border: none;
  background: transparent;
  padding: 0 14px;
  height: 40px;
  cursor: pointer;
  font-size: 1rem;
}
.search button:hover { color: var(--brand); }
/* Icon links (account / wishlist) */
.icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.icon-link:hover { color: var(--ink); }
.icon-link .ic { font-size: 1.1rem; }
.icon-link .pill {
  position: absolute;
  top: -7px;
  right: -10px;
  background: var(--danger);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.15s;
}
.cart-link:hover { background: var(--bg-soft); }
.cart-count {
  background: var(--brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #ecfdf5 0%, #f6f7f9 60%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 70px 0;
}
.hero h1 {
  font-size: 3rem;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.hero p {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 0 0 28px;
  max-width: 46ch;
}
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__art {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 30%, #6ee7b7, transparent 60%),
    radial-gradient(circle at 75% 70%, #5eead4, transparent 55%),
    linear-gradient(135deg, #059669, #0d9488);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero__art::after {
  content: "🛍️";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 7rem;
}

/* ===== Section heading ===== */
.section { padding: 60px 0; }
.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}
.section__head h2 {
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ===== Filters ===== */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ===== Product grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.card__media {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 4rem;
  position: relative;
}
.card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.card__cat {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 700;
}
.card__title {
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.3;
}
.card__rating { font-size: 0.85rem; color: #f59e0b; }
.card__rating span { color: var(--ink-soft); }
.card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
}
.price { font-weight: 800; font-size: 1.15rem; }
.price small {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: line-through;
  margin-right: 6px;
}

/* ===== Features strip ===== */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.feature { display: flex; gap: 12px; align-items: flex-start; }
.feature .ic { font-size: 1.6rem; }
.feature h4 { margin: 0 0 2px; font-size: 0.98rem; }
.feature p { margin: 0; font-size: 0.86rem; color: var(--ink-soft); }

/* ===== Product detail ===== */
.pdp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 50px 0;
}
.pdp__media {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 9rem;
  border: 1px solid var(--line);
}
.pdp h1 { font-size: 2.1rem; margin: 6px 0 10px; letter-spacing: -0.02em; }
.pdp .price { font-size: 1.9rem; display: block; margin: 14px 0; }
.pdp__desc { color: var(--ink-soft); margin: 14px 0 22px; }
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-right: 12px;
}
.qty button {
  border: none;
  background: #fff;
  width: 42px;
  height: 46px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--ink);
}
.qty button:hover { background: var(--bg-soft); }
.qty input {
  width: 50px;
  height: 46px;
  border: none;
  text-align: center;
  font-size: 1rem;
  font-family: inherit;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pdp__buy { display: flex; align-items: center; gap: 12px; margin: 8px 0 24px; flex-wrap: wrap; }
.pdp__meta { border-top: 1px solid var(--line); padding-top: 18px; }
.pdp__meta li { color: var(--ink-soft); margin-bottom: 6px; }
.breadcrumb { padding: 22px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--brand); }

/* ===== Cart ===== */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  padding: 40px 0 70px;
  align-items: start;
}
.cart-items { display: flex; flex-direction: column; gap: 14px; }
.cart-row {
  display: grid;
  grid-template-columns: 84px 1fr auto auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.cart-row__media {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 2.6rem;
}
.cart-row__title { font-weight: 600; }
.cart-row__cat { font-size: 0.8rem; color: var(--ink-soft); }
.cart-row .qty button { width: 34px; height: 38px; font-size: 1rem; }
.cart-row .qty input { width: 38px; height: 38px; }
.cart-row__price { font-weight: 800; min-width: 80px; text-align: right; }
.link-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  padding: 0;
  margin-top: 6px;
}
.link-remove:hover { text-decoration: underline; }

.summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 90px;
}
.summary h3 { margin: 0 0 16px; }
.summary__row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--ink-soft);
}
.summary__row strong { color: var(--ink); }
.summary__total {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: 800;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.empty {
  text-align: center;
  padding: 80px 20px;
}
.empty .ic { font-size: 4rem; }
.empty h2 { margin: 14px 0 8px; }
.empty p { color: var(--ink-soft); margin-bottom: 22px; }

/* ===== Checkout ===== */
.checkout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  padding: 40px 0 70px;
  align-items: start;
}
.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.form-card h3 { margin: 0 0 18px; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: #fff;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  margin-top: 40px;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 30px;
  padding: 50px 0 36px;
}
.site-footer h5 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0 0 14px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: var(--ink-soft); font-size: 0.92rem; }
.site-footer a:hover { color: var(--ink); }
.site-footer__bottom {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .pdp { grid-template-columns: 1fr; gap: 28px; }
  .cart-layout, .checkout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
}
/* ===== Wishlist heart button on cards ===== */
.wish-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, background 0.15s;
  line-height: 1;
}
.wish-btn:hover { transform: scale(1.12); }
.wish-btn.is-on { background: #fee2e2; border-color: #fecaca; }

/* ===== Auth pages ===== */
.auth-wrap {
  max-width: 420px;
  margin: 50px auto;
}
.auth-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}
.auth-card h2 { margin: 0 0 4px; }
.auth-card .muted { margin: 0 0 22px; }
.auth-tabs {
  display: flex;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tabs button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px;
  border-radius: 7px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink-soft);
}
.auth-tabs button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.form-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.account-box {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}
.avatar {
  width: 52px; height: 52px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 1.3rem;
}
/* OTP */
.otp-note {
  background: #eff6ff;
  border: 1px dashed #93c5fd;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  color: #1e3a8a;
}
.otp-note b { font-size: 1.15rem; letter-spacing: 0.18em; }
.otp-boxes {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 18px;
}
.otp-boxes input {
  width: 100%;
  aspect-ratio: 1 / 1;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
}
.otp-boxes input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}
.link-btn {
  background: none; border: none; color: var(--brand);
  font-weight: 600; cursor: pointer; font-family: inherit; padding: 0; font-size: 0.9rem;
}
.link-btn:hover { text-decoration: underline; }
/* Login-required gate */
.gate {
  max-width: 460px;
  margin: 40px auto;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 28px;
  box-shadow: var(--shadow);
}
.gate .ic { font-size: 3rem; }
.gate h2 { margin: 10px 0 6px; }
.gate p { color: var(--ink-soft); margin: 0 0 20px; }

/* ===== Payment options ===== */
.pay-opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.pay-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pay-opt:hover { border-color: var(--brand); }
.pay-opt input { accent-color: var(--brand); width: 18px; height: 18px; }
.pay-opt .label { font-weight: 600; }
.pay-opt .sub { font-size: 0.82rem; color: var(--ink-soft); }
.pay-opt:has(input:checked) { border-color: var(--brand); background: #ecfdf5; }

/* ===== Orders / tracking ===== */
.order-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}
.order-card__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-items: center;
  background: var(--bg-soft);
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.order-card__head .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.order-card__head .v { font-weight: 700; }
.status-tag {
  margin-left: auto;
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 999px;
}
.order-card__body { padding: 16px 20px; }
.order-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.order-line .em {
  width: 44px; height: 44px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 1.5rem;
  background: var(--bg-soft);
}
.order-line .nm { font-weight: 600; font-size: 0.95rem; }
.order-line .qt { color: var(--ink-soft); font-size: 0.84rem; }
.order-line .pr { margin-left: auto; font-weight: 700; }
/* progress tracker */
.track {
  display: flex;
  margin: 14px 0 4px;
}
.track__step {
  flex: 1;
  text-align: center;
  position: relative;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.track__step::before {
  content: "";
  position: absolute;
  top: 11px; left: -50%;
  width: 100%; height: 3px;
  background: var(--line);
  z-index: 0;
}
.track__step:first-child::before { display: none; }
.track__dot {
  width: 24px; height: 24px;
  border-radius: 999px;
  background: #fff;
  border: 3px solid var(--line);
  margin: 0 auto 6px;
  position: relative; z-index: 1;
}
.track__step.done .track__dot { background: var(--accent); border-color: var(--accent); }
.track__step.done::before { background: var(--accent); }
.track__step.done { color: var(--ink); font-weight: 600; }

@media (max-width: 960px) {
  .search { order: 3; flex-basis: 100%; max-width: none; margin-top: 4px; }
  .site-header__inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
}
@media (max-width: 560px) {
  .nav { display: none; }
  .icon-link span:not(.ic):not(.pill) { display: none; }
  .hero h1 { font-size: 2.2rem; }
  .grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .cart-row { grid-template-columns: 64px 1fr; }
  .cart-row__media { width: 64px; height: 64px; }
  .cart-row .qty, .cart-row__price { grid-column: 2; justify-self: start; }
  .cart-row__price { text-align: left; }
  .field-row { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
}
