/* PCPartDeals interface foundation. Page stylesheets own page-specific layouts. */
:root {
  color-scheme: light;
  --page: #f7faff;
  --surface: #ffffff;
  --surface-soft: #eef6ff;
  --surface-tint: #f8fbff;
  --surface-accent: #f3f8ff;
  --surface-hover: #f4f9ff;
  --header-bg: rgb(255 255 255 / 97%);
  --ink: #152238;
  --muted: #5e6d83;
  --ink-soft: #44536a;
  --line: #dce6f3;
  --line-strong: #bacce3;
  --line-accent: #d1e3fa;
  --blue: #1568d8;
  --blue-dark: #0b4caa;
  --link: #0b4caa;
  --blue-light: #6bb8ff;
  --green: #218549;
  --green-fill: #218549;
  --green-soft: #eaf8ee;
  --red: #b03b3b;
  --red-soft: #fff7f7;
  --red-line: #f3d5d5;
  --orange: #a1581e;
  --orange-soft: #fff2e7;
  --neutral-soft: #eef3f8;
  --switch-thumb: #ffffff;
  --illustration-well: #f8fbff;
  --shadow: 0 8px 28px rgb(22 49 84 / 6%);
  --content-width: 1240px;
  --radius: 10px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d1726;
  --surface: #152338;
  --surface-soft: #1c3048;
  --surface-tint: #1a2a3e;
  --surface-accent: #1c314b;
  --surface-hover: #243b55;
  --header-bg: rgb(21 35 56 / 97%);
  --ink: #edf4ff;
  --muted: #afbed2;
  --ink-soft: #c4d0df;
  --line: #354960;
  --line-strong: #536b88;
  --line-accent: #45658c;
  --blue: #2c75dc;
  --blue-dark: #1558bc;
  --link: #91c4ff;
  --blue-light: #91c4ff;
  --green: #84e3a6;
  --green-fill: #197746;
  --green-soft: #193e2b;
  --red: #ff9d9d;
  --red-soft: #3b252d;
  --red-line: #80515d;
  --orange: #f7b77b;
  --orange-soft: #473224;
  --neutral-soft: #27384b;
  --switch-thumb: #ffffff;
  --illustration-well: #eef4fc;
  --shadow: 0 8px 28px rgb(0 0 0 / 22%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

body:has(.home-marketplace),
body:has(.marketplace-main) {
  background: var(--surface);
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--link);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
img,
svg,
video,
iframe {
  max-width: 100%;
}
img {
  height: auto;
}
[hidden],
.hidden {
  display: none !important;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid rgb(21 104 216 / 32%);
  outline-offset: 2px;
}

.container {
  width: min(var(--content-width), calc(100% - 48px));
  margin-inline: auto;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: -60px;
  left: 16px;
  padding: 9px 14px;
  color: #fff;
  background: var(--blue-dark);
}
.skip-link:focus {
  top: 12px;
}

.site-announcement {
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 11px;
}
.site-announcement .container {
  display: flex;
  min-height: 29px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.site-announcement a {
  color: var(--link);
  font-weight: 700;
}

.header,
.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}
.nav-container,
.header > .container,
.site-header-inner {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 28px;
}
.site-header-inner {
  width: min(var(--content-width), calc(100% - 48px));
  margin-inline: auto;
}
.logo {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.065em;
  line-height: 1;
  white-space: nowrap;
}
.logo span {
  color: var(--blue);
}
.logo:hover {
  color: var(--ink);
}
.nav,
.nav-links,
.auth-nav {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 26px;
  margin-left: 26px;
}

.theme-toggle {
  display: inline-flex;
  min-height: 35px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.theme-toggle:hover {
  border-color: var(--blue);
  color: var(--link);
}
:root[data-theme="dark"]
  img[src*="icons/"]:not([src*="marketplaces/"]):not([src*="pc-parts/"]) {
  filter: brightness(0) invert(1);
}
:root[data-theme="dark"] .home-category-grid img {
  background: var(--illustration-well);
}
.nav a,
.nav-links a,
.auth-nav a {
  display: inline-flex;
  min-height: 64px;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.nav a:hover,
.nav-links a:hover,
.auth-nav a:hover,
.nav a.active,
.nav-links a.active {
  color: var(--link);
}
.nav a.active,
.nav-links a.active {
  border-bottom-color: var(--blue);
}
.header .container.nav {
  position: static;
  display: flex;
  width: min(var(--content-width), calc(100% - 48px));
  height: 100%;
  flex: initial;
  align-items: center;
  gap: 28px;
  margin-inline: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.header .container.nav > .logo {
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.065em;
}
.header .container.nav > .nav-links {
  flex: 1;
}
.nav-sign-in,
.header-signup,
.header-auth-button {
  margin-left: auto;
}
.desktop-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.desktop-buttons .header-login-link {
  display: none;
}
.mobile-buttons {
  display: none;
}
.auth-icon-button,
.nav-sign-in,
.auth-nav .header-signup {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  background: var(--blue);
  color: #fff !important;
  font-size: 12px;
  font-weight: 750;
}
.nav a.nav-sign-in,
.auth-nav a.header-signup,
.auth-nav a.header-signin,
.nav a.nav-account,
.nav-links a.nav-account {
  min-height: 36px;
  margin-left: auto;
  padding: 0 13px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
}
.auth-icon-button img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}
.hamburger,
.nav-toggle {
  display: none;
}

.btn,
.button,
.view-btn,
.profile-btn,
.login-link,
.submit-btn,
.login-btn,
.signup-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  font-weight: 750;
  text-align: center;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
:where(
  .btn,
  .button,
  .view-btn,
  .profile-btn,
  .login-link,
  .submit-btn,
  .login-btn,
  .signup-btn
):hover {
  border-color: var(--link);
  background: var(--blue-dark);
  color: #fff;
}
.btn-secondary,
.button.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--link);
}
.btn-secondary:hover,
.button.secondary:hover {
  background: var(--surface-soft);
  color: var(--link);
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-height: 42px;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
}
:where(input, select, textarea)::placeholder {
  color: var(--muted);
}
:where(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea
):focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(21 104 216 / 12%);
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--blue);
}

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) repeat(3, minmax(120px, 1fr));
  gap: 20px;
  padding-block: 25px 15px;
}
.footer .logo {
  display: inline-block;
  font-size: 19px;
}
.footer-brand p {
  max-width: 340px;
  margin: 7px 0;
  font-size: 11px;
}
.footer-disclosure,
.footer-credit {
  font-size: 10px !important;
}
.footer-column {
  display: grid;
  align-content: start;
  gap: 4px;
}
.footer-column h2 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 12px;
}
.footer-grid:has(.footer-mobile-links) {
  grid-template-columns: minmax(210px, 0.95fr) minmax(0, 2fr);
}
.footer-mobile-links > summary {
  display: none;
}
.footer-mobile-links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.footer-mobile-links-grid .footer-column {
  min-width: 0;
}
.footer-column a,
.footer-links a {
  color: var(--muted);
  font-size: 11px;
}
.footer-bottom,
.footer-row,
.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 12px;
  border-top: 1px solid var(--line);
  font-size: 10px;
}
.footer-row,
.footer-content {
  border-top: 0;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.footer-bottom p,
.footer-row p,
.footer-content p {
  margin: 0;
}
.footer a:hover {
  color: var(--link);
}

.mobile-tabbar {
  display: none;
}

@media (max-width: 900px) {
  .nav,
  .nav-links,
  .auth-nav {
    gap: 16px;
    margin-left: 0;
  }
  .nav a,
  .nav-links a,
  .auth-nav a {
    font-size: 12px;
  }
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .container {
    width: min(var(--content-width), calc(100% - 28px));
  }
  .site-header-inner {
    width: min(var(--content-width), calc(100% - 28px));
  }
  .site-announcement {
    display: none;
    gap: 2px;
  }
  .header,
  .site-header {
    height: 58px;
  }
  .header .container.nav {
    width: min(var(--content-width), calc(100% - 28px));
  }
  .header .container.nav > .logo {
    font-size: 21px;
  }
  .header > .container,
  .nav-container,
  .site-header-inner {
    gap: 12px;
  }
  .logo {
    font-size: 21px;
  }
  .nav,
  .nav-links,
  .auth-nav {
    position: absolute;
    z-index: 51;
    top: 58px;
    right: 0;
    left: 0;
    display: none;
    gap: 3px;
    margin: 0;
    padding: 8px 16px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .nav.open,
  .nav.active,
  .nav-links.open,
  .auth-nav.open {
    display: grid;
  }
  .nav a,
  .nav-links a,
  .auth-nav a {
    min-height: 40px;
    padding-inline: 7px;
    border-bottom: 0;
  }
  .desktop-buttons {
    margin-left: auto;
  }
  .desktop-buttons .header-auth-button {
    display: none;
  }
  .mobile-buttons {
    display: grid;
  }
  .hamburger,
  .nav-toggle {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    align-content: center;
    justify-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
  }
  .hamburger span,
  .nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    padding-block: 18px 8px;
  }
  .footer-grid:has(.footer-mobile-links) {
    display: block;
  }
  .footer-mobile-links {
    margin-top: 10px;
    border-top: 1px solid var(--line);
  }
  .footer-mobile-links > summary {
    display: block;
    padding: 10px 0;
    color: var(--link);
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
  }
  .footer-mobile-links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-bottom: 10px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-bottom,
  .footer-row,
  .footer-content {
    flex-wrap: wrap;
    gap: 5px 15px;
  }
  body:has(.mobile-tabbar) {
    padding-bottom: 62px;
  }
  .mobile-tabbar {
    position: fixed;
    z-index: 49;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 58px;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 -5px 20px rgb(20 50 80 / 6%);
  }
  .mobile-tabbar a {
    display: grid;
    min-height: 57px;
    align-content: center;
    justify-items: center;
    gap: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
  }
  .mobile-tabbar a[aria-current="page"] {
    color: var(--link);
  }
  .mobile-tabbar img {
    width: 20px;
    height: 20px;
  }
  .mobile-tabbar a[aria-current="page"] img {
    filter: invert(30%) sepia(95%) saturate(1700%) hue-rotate(199deg);
  }
  :root[data-theme="dark"] .mobile-tabbar a[aria-current="page"] img {
    filter: brightness(0) saturate(100%) invert(72%) sepia(29%) saturate(1655%)
      hue-rotate(177deg);
  }
}
