/* Shared product theme — storefront + admin.
   Hard black/white surfaces, 1px borders, Inter. Layout stays in page CSS. */

:root {
  --page-bg: #FFFFFF;
  --panel-bg: #FFFFFF;
  --panel-solid: #FFFFFF;
  --panel-border: #000000;
  --text-primary: #000000;
  --text-soft: #4A4A4A;
  --text-muted: #4A4A4A;
  --pill-bg: #FFFFFF;
  --pill-border: #000000;
  --checkout-bg: #000000;
  --checkout-text: #FFFFFF;
  --collection-bg: #FFFFFF;
  --collection-border: #000000;
  --cta-bg: #000000;
  --cta-text: #FFFFFF;
  --hover-bg: #F8F8F8;
  --border: #000000;
  --muted: #4A4A4A;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  transition: background .2s ease, color .2s ease;
}

/* html selector lets the head bootstrap paint dark before <body> exists. */
html[data-theme="dark"],
body[data-theme="dark"] {
  --page-bg: #000000;
  --panel-bg: #000000;
  --panel-solid: #000000;
  --panel-border: #E5E5E5;
  --text-primary: #FFFFFF;
  --text-soft: #A0A0A0;
  --text-muted: #A0A0A0;
  --pill-bg: #000000;
  --pill-border: #E5E5E5;
  --checkout-bg: #FFFFFF;
  --checkout-text: #000000;
  --collection-bg: #000000;
  --collection-border: #E5E5E5;
  --cta-bg: #FFFFFF;
  --cta-text: #000000;
  --hover-bg: #1A1A1A;
  --border: #E5E5E5;
  --muted: #A0A0A0;
}

body[data-theme="dark"] {
  background: var(--page-bg);
  color: var(--text-primary);
}

html[data-theme="dark"] {
  background: var(--page-bg);
  color: var(--text-primary);
}

.home-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(1.25rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    max(2rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
  background: var(--page-bg);
}

.home-header {
  max-width: 1100px;
  margin: 0 auto;
  position: sticky;
  top: 0.8rem;
  z-index: 30;
}

.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  max-width: 1024px;
  margin: 0 auto;
  min-height: 64px;
  padding: 0.7rem 1.2rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--text-primary);
}

.home-nav-brand {
  color: var(--text-primary);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  line-height: 1;
  padding: 0 0.35rem;
}

.home-nav-links,
.home-nav-actions {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.home-nav-links {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.home-nav-links a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}

.home-nav-links a:hover {
  color: var(--text-primary);
}

.home-nav-actions {
  justify-content: flex-end;
}

.theme-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  flex: 0 0 38px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.theme-toggle-button .theme-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: currentColor;
}

.theme-toggle-button:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  transform: none;
  filter: none;
}

.theme-toggle-button.is-refreshing .theme-icon {
  animation: page-refresh-spin 0.7s linear infinite;
}

@keyframes page-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.theme-icon {
  width: 1rem;
  height: 1rem;
}

.account-signin-link,
.profile-pill-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 32px;
  height: 38px;
  padding: 0 1rem;
  border: 1px solid var(--cta-bg);
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  transition: background .15s ease, color .15s ease;
}

.account-signin-link:hover,
.profile-pill-link:hover {
  background: #1A1A1A;
  color: #FFFFFF;
  border-color: #000000;
}

body[data-theme="dark"] .account-signin-link:hover,
body[data-theme="dark"] .profile-pill-link:hover {
  background: #E5E5E5;
  color: #000000;
  border-color: #FFFFFF;
}

.home-nav .profile-pill-link {
  height: 38px;
  padding: 0 1rem;
  border: 1px solid var(--cta-bg);
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 0.9rem;
  font-weight: 600;
}

.home-nav .profile-pill-link:hover {
  background: #1A1A1A;
  color: #FFFFFF;
  border-color: #000000;
}

body[data-theme="dark"] .home-nav .profile-pill-link:hover {
  background: #E5E5E5;
  color: #000000;
  border-color: #FFFFFF;
}

/* Shared mobile menu (storefront + admin) — hard B/W chrome */
.storefront-mobile-menu {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 0.55rem;
  padding: 0.75rem;
  background: #FFFFFF;
  border: 1px solid #000000;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.storefront-mobile-menu[hidden] {
  display: none !important;
}

.storefront-mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0 0.15rem 0.75rem;
  border-bottom: 1px solid #000000;
}

.storefront-mobile-menu-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.storefront-mobile-menu-header-actions .theme-toggle-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

.storefront-mobile-menu-header-actions .profile-pill-link {
  height: 36px;
  min-height: 36px;
  padding: 0 0.85rem;
  font-size: 0.85rem;
}

.storefront-mobile-menu-brand {
  margin-right: auto;
  color: #000000;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storefront-mobile-menu-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000000;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}

.storefront-mobile-menu-close:hover {
  background: #F8F8F8;
  color: #000000;
}

.storefront-mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 0;
  background: transparent;
  color: #000000;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}

.storefront-mobile-link:hover {
  background: #F8F8F8;
  color: #000000;
}

.storefront-mobile-accent {
  color: #4A4A4A;
}

body[data-theme="dark"] .storefront-mobile-menu {
  background: #000000;
  border-color: #E5E5E5;
}

body[data-theme="dark"] .storefront-mobile-menu-header {
  border-bottom-color: #E5E5E5;
}

body[data-theme="dark"] .storefront-mobile-menu-brand {
  color: #FFFFFF;
}

body[data-theme="dark"] .storefront-mobile-menu-close {
  color: #FFFFFF;
}

body[data-theme="dark"] .storefront-mobile-menu-close:hover {
  background: #1A1A1A;
  color: #FFFFFF;
}

body[data-theme="dark"] .storefront-mobile-link {
  color: #FFFFFF;
}

body[data-theme="dark"] .storefront-mobile-link:hover {
  background: #1A1A1A;
  color: #FFFFFF;
}

body[data-theme="dark"] .storefront-mobile-accent {
  color: #A0A0A0;
}

/* Flat corners everywhere theme is loaded */
*,
*::before,
*::after {
  border-radius: 0 !important;
}
