@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,700&display=swap');

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.page {
  min-height: 100vh;
  padding-bottom: 88px;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.25rem, 2vw, 2rem);
  margin: 0;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  background: #fff;
}

.badge-safe {
  color: var(--safe-ink);
  background: var(--safe-bg);
  border-color: transparent;
}

.badge-unsafe {
  color: var(--danger-ink);
  background: var(--danger-bg);
  border-color: transparent;
}

.badge-warn {
  color: var(--warn-ink);
  background: var(--warn-bg);
  border-color: transparent;
}

.btn {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
}

.btn-secondary {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(15, 46, 53, 0.08);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(243, 250, 251, 0.88);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.search-wrap {
  position: relative;
}

.search-wrap::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: center/contain no-repeat url('../img/search.svg');
  opacity: 0.75;
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px 10px 34px;
  background: #fff;
}

.marketplace-page .search-wrap input {
  border-color: rgba(32, 195, 208, 0.55);
  box-shadow: inset 0 0 0 1px rgba(32, 195, 208, 0.12);
}

.marketplace-header {
  background:
    linear-gradient(115deg, rgba(32, 195, 208, 0.28), rgba(118, 223, 226, 0.22)),
    rgba(240, 252, 254, 0.95);
  border-bottom: 1px solid rgba(32, 195, 208, 0.45);
}

.marketplace-header .brand {
  color: #0a6b74;
}

.marketplace-header .btn-secondary {
  border-color: rgba(32, 195, 208, 0.45);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: min(620px, 94vw);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(17, 57, 66, 0.16);
  z-index: 25;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 8px 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.bottom-nav a::before {
  content: '';
  width: 16px;
  height: 16px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.8;
}

.bottom-nav a[data-nav='home']::before {
  background-image: url('../img/home.svg');
}

.bottom-nav a[data-nav='feed']::before {
  background-image: url('../img/picks.svg');
}

.bottom-nav a[data-nav='settings']::before {
  background-image: url('../img/settings.svg');
}

.bottom-nav a[data-nav='profile']::before {
  background-image: url('../img/profile.svg');
}

.bottom-nav a.active::before {
  opacity: 1;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-actions .btn::before {
  content: '';
  width: 14px;
  height: 14px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.8;
}

.header-actions a[href$='cart.html']::before {
  background-image: url('../img/cart.svg');
}

.header-actions [data-logout]::before,
.header-actions a[href$='marketplace.html']::before {
  background-image: url('../img/search.svg');
}

.bottom-nav a.active {
  color: var(--text);
  background: linear-gradient(120deg, rgba(32, 195, 208, 0.2), rgba(122, 224, 226, 0.26));
}

.skeleton {
  border-radius: 12px;
  background: linear-gradient(100deg, #eff7f8 35%, #e4f2f4 50%, #eff7f8 65%);
  background-size: 200% 100%;
  animation: pulse 1.2s linear infinite;
}

@keyframes pulse {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 780px) {
  .site-header .container {
    grid-template-columns: 1fr;
  }

  .site-header .container .header-actions {
    justify-self: end;
  }
}