:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #0a0a0a;
  --muted: #6b7280;
  --line: #ececec;
  --accent: #0a0a0a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.05);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

/* ---- Header ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.12em;
}
.brand span { font-weight: 300; }
.nav-actions { display: flex; align-items: center; gap: 20px; }
.nav-link { font-size: 14px; color: var(--muted); }
.nav-link:hover { color: var(--ink); }
.cart-btn {
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}
.cart-btn:hover { border-color: #cfcfcf; }
.cart-count {
  margin-left: 6px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  padding: 1px 7px;
}
.auth-link {
  border: none;
  background: none;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  padding: 6px 4px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-link:hover { color: var(--ink); }

/* ---- Account avatar + dropdown ---- */
.user-menu { position: relative; }
.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.15s, transform 0.1s;
}
.avatar-btn:hover { box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08); }
.avatar-btn:active { transform: scale(0.95); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-fallback {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
  z-index: 25;
}
.user-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.user-info { padding: 12px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-item {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
}
.dropdown-item:hover { background: #f5f5f5; }

/* ---- Auth modal ---- */
.auth-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.98);
  width: min(380px, 92vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 28px 28px;
  z-index: 45;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.auth-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.auth-modal .close-x { position: absolute; top: 16px; right: 18px; }
.auth-modal h3 { margin: 0 0 6px; font-size: 22px; }
.auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.auth-modal input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 10px;
  background: #fff;
  color: var(--ink);
}
.auth-modal input:focus { outline: 2px solid #0a0a0a18; border-color: #bdbdbd; }
.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 13px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.google-btn:hover { border-color: #cfcfcf; background: #fafafa; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.save-btn {
  width: 100%;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 2px;
}
.ghost-btn {
  width: 100%;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 12px;
  margin-top: 4px;
}
.ghost-btn:hover { color: var(--ink); }
.auth-err { color: #b42318; font-size: 13px; text-align: center; min-height: 18px; margin-top: 8px; }

/* ---- Hero ---- */
.hero {
  position: relative;
  text-align: center;
  padding: 110px 24px 72px;
  max-width: 760px;
  margin: 0 auto;
}
.hero::before {
  content: "";
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  height: 640px;
  max-width: 120vw;
  background: radial-gradient(circle at center, rgba(10, 10, 10, 0.05), transparent 62%);
  z-index: -1;
  pointer-events: none;
}
.hero .eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(44px, 7.5vw, 82px);
  line-height: 1.0;
  margin: 0 0 20px;
  font-weight: 800;
  background: linear-gradient(180deg, #0a0a0a 0%, #3a3a3a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--muted); font-size: 18px; margin: 0; }

/* ---- Grid ---- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px 96px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-img {
  aspect-ratio: 1 / 1;
  background: #f6f6f6 center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4c4c4;
  font-size: 13px;
}
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-weight: 600; font-size: 16px; }
.card-desc { color: var(--muted); font-size: 14px; line-height: 1.4; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.price { font-weight: 700; font-size: 17px; }
.add-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.add-btn:hover { opacity: 0.85; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 64px 0;
  font-size: 15px;
}

/* ---- Cart drawer ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 30;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(400px, 92vw);
  background: #fff;
  z-index: 40;
  transform: translateX(100%);
  transition: transform 0.24s ease;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { margin: 0; font-size: 18px; }
.close-x { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.drawer-items { flex: 1; overflow-y: auto; padding: 8px 24px; }
.line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.line img, .line .noimg {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
  background: #f4f4f4; flex-shrink: 0;
}
.line-info { flex: 1; }
.line-name { font-size: 14px; font-weight: 600; }
.line-price { font-size: 13px; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button {
  width: 26px; height: 26px; border: 1px solid var(--line);
  background: #fff; border-radius: 8px; cursor: pointer; font-size: 15px;
}
.drawer-foot { padding: 20px 24px; border-top: 1px solid var(--line); }
.cart-note {
  font-size: 12.5px;
  color: var(--muted);
  background: #f7f7f7;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  line-height: 1.4;
  text-align: center;
}
.cart-note:empty { display: none; }
.total-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 18px; margin-bottom: 16px; }
.checkout-btn {
  width: 100%;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 15px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.checkout-btn:disabled { opacity: 0.4; cursor: default; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

footer { border-top: 1px solid var(--line); padding: 32px 24px; text-align: center; color: var(--muted); font-size: 13px; }
