/* Shared foundation: theme variables, top bar, page frame, buttons, forms, footer.
   Loaded by every page. Store-only rules live in store.css. */

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  /* Inspired green/gold luxury palette (no trademark branding). */
  color-scheme: light;
  --bg: #faf9f6;
  --surface: #f3f1ea;
  --surface-strong: #ffffff;
  --text: #1a1f1c;
  --muted: #5c635e;
  --border: #e4e0d6;
  --border-strong: #cfc8b8;
  --accent: #006039;
  --accent-contrast: #ffffff;
  --gold: #a37e2c;
  --gold-soft: #b99b4e;
  --chip: #ebe8df;
  --shadow: rgba(0, 96, 57, 0.1);
  --topbar-bg: #006039;
  --topbar-fg: #f5f2ea;
  --topbar-muted: rgba(245, 242, 234, 0.82);
  --topbar-border: color-mix(in srgb, #a37e2c 40%, #006039);
  --topbar-control-bg: rgba(255, 255, 255, 0.12);
  --topbar-control-border: rgba(255, 255, 255, 0.3);
  --font: Inter, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1410;
  --surface: #101c16;
  --surface-strong: #0d1813;
  --text: #f3efe6;
  --muted: #a8b5aa;
  --border: #1c2e24;
  --border-strong: #2a4034;
  --accent: #a37e2c;
  --accent-contrast: #0a1410;
  --gold: #b99b4e;
  --gold-soft: #c9b06a;
  --chip: #15241c;
  --shadow: rgba(0, 0, 0, 0.55);
  --topbar-bg: var(--surface-strong);
  --topbar-fg: var(--text);
  --topbar-muted: var(--muted);
  --topbar-border: var(--border);
  --topbar-control-bg: var(--surface);
  --topbar-control-border: var(--border);
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4,
button,
input,
select,
textarea,
.btn {
  font-family: inherit;
  font-weight: 700;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
}

/* Top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--topbar-border);
  background: var(--topbar-bg);
  color: var(--topbar-fg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  text-decoration: none;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
  color: var(--topbar-fg);
}

.logo span {
  display: block;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.top-nav a {
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--topbar-muted);
}

.top-nav a:hover,
.top-nav a.is-active {
  color: var(--gold-soft);
  background: rgba(255, 255, 255, 0.1);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-link,
.account-link,
.theme-btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.85rem;
  background: var(--topbar-control-bg);
  border: 1px solid var(--topbar-control-border);
  border-radius: 10px;
  color: var(--topbar-fg);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.theme-btn {
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}

.cart-link:hover,
.account-link:hover,
.theme-btn:hover {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
  background: rgba(163, 126, 44, 0.16);
}

.cart-count {
  display: none;
  margin-left: 0.35rem;
  min-width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: var(--gold);
  color: #0a1410;
  place-items: center;
  font-size: 0.7rem;
}

.cart-count.is-on {
  display: inline-grid;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--topbar-control-border);
  border-radius: 10px;
  background: var(--topbar-control-bg);
  padding: 0;
  align-content: center;
  justify-items: center;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--topbar-fg);
  border-radius: 2px;
}


[data-theme="dark"] .top-nav a:hover,
[data-theme="dark"] .top-nav a.is-active {
  color: var(--gold-soft);
  background: color-mix(in srgb, var(--gold) 16%, transparent);
}

[data-theme="dark"] .cart-link:hover,
[data-theme="dark"] .account-link:hover,
[data-theme="dark"] .theme-btn:hover {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
  background: color-mix(in srgb, var(--gold) 14%, transparent);
}

/* Page frame */

.page {
  flex: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3.5rem;
}

.page-heading {
  margin-bottom: 1.5rem;
}

.page-heading h1 {
  font-size: 2.1rem;
}

.brand-pill {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.7rem;
  margin-bottom: 1rem;
}

.page-heading h1,
.section-heading h2,
.panel h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.panel h1 {
  margin: 0.35rem 0 0.75rem;
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.9rem;
}

.lede,
.section-lede {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.panel {
  background: var(--surface);
  border-radius: 16px;
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px var(--shadow);
  margin-bottom: 1.5rem;
}

.section-heading {
  margin-bottom: 1.25rem;
}

.product-price {
  margin: 0;
  font-weight: 700;
  color: var(--gold);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:not(.btn-outline):hover {
  background: color-mix(in srgb, var(--accent) 82%, var(--gold));
}

.btn.is-disabled,
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--chip);
  border-color: color-mix(in srgb, var(--gold) 45%, var(--border-strong));
  color: var(--accent);
}

.remove-btn,
.clear-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
}

.remove-btn:hover,
.clear-btn:hover {
  background: var(--chip);
}

/* Forms */

.form-field {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.form-field input,
.form-field textarea,
.form-field select {
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  color: var(--text);
  font-family: inherit;
}

.form-field textarea {
  resize: vertical;
}

.password-control {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
}

.password-control input {
  min-width: 0;
  flex: 1;
}

.password-toggle {
  flex: 0 0 auto;
  padding: 0 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.8rem;
}

.password-toggle:hover {
  border-color: var(--gold);
  color: var(--accent);
  background: var(--chip);
}

.password-match-note {
  margin: 0.35rem 0 0;
  color: #b42318;
  font-size: 0.8rem;
}

[data-theme="dark"] .password-match-note {
  color: #ff8f86;
}

.form-note {
  margin: 0;
  color: var(--accent);
  font-size: 0.9rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  color: var(--muted);
}

.footer-links {
  margin-top: 0.6rem;
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

@media (max-width: 900px) {
  .menu-toggle {
    display: grid;
  }

  .top-nav {
    display: none;
    position: absolute;
    top: 64px;
    right: 1.5rem;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    min-width: 180px;
    box-shadow: 0 18px 40px var(--shadow);
    flex-direction: column;
    align-items: stretch;
  }

  .top-nav a {
    color: var(--muted);
  }

  .top-nav a:hover,
  .top-nav a.is-active {
    color: var(--accent);
    background: var(--chip);
  }

  .topbar.is-open .top-nav {
    display: flex;
  }
}

/* The hamburger menu contains every option except the always-visible cart. */
.site-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 1.5rem;
  z-index: 20;
  min-width: 210px;
  padding: 0.75rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 40px var(--shadow);
}

.topbar.is-open .site-menu {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.site-menu .top-nav {
  display: flex;
  position: static;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.site-menu .top-nav a {
  color: var(--muted);
  white-space: nowrap;
}

.site-menu .top-nav a:hover,
.site-menu .top-nav a.is-active {
  color: var(--accent);
  background: var(--chip);
}

.menu-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.site-menu .theme-btn,
.site-menu .account-link {
  width: 100%;
  justify-content: flex-start;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.site-menu .theme-btn:hover,
.site-menu .account-link:hover {
  color: var(--accent);
  background: var(--chip);
  border-color: var(--border);
}

.menu-toggle {
  display: grid;
  cursor: pointer;
}

/* Signup-only password guidance. */
.password-guidance {
  margin: -0.25rem 0 0.35rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-strong);
}

.password-meter-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.password-meter-head strong {
  color: var(--gold);
  text-transform: capitalize;
}

.password-meter {
  height: 0.45rem;
  margin: 0.45rem 0 0.85rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.password-meter-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 160ms ease, background-color 160ms ease;
}

.password-meter-fill[data-strength="strong"] {
  background: var(--accent);
}

.password-tips-title {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.password-requirements {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
  font-size: 0.8rem;
}

.password-requirements li::before {
  content: "○";
  display: inline-block;
  width: 1.1rem;
  color: var(--muted);
}

.password-requirements li.is-met {
  color: var(--accent);
}

.password-requirements li.is-met::before {
  content: "✓";
  font-weight: 700;
}
