/* styles.css */
:root {
  --bg: #e9edf2;
  --panel: #fff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #d1d5db;

  --nav: #131921;
  --nav2: #232f3e;
  --accent: #f59e0b;
  --accent2: #fbbf24;

  --shadow: 0 8px 24px rgba(0, 0, 0, .08);
  --radius: 14px;
  --radius2: 10px;

  --max: 1200px;
  --gap: 14px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
}

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

a:hover {
  text-decoration: underline;
}

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

/* Header (mobile-first stacked) */
.topbar {
  background: var(--nav);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__row {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand cart"
    "loc   loc"
    "search search"
    "acct  acct";
  gap: 10px;
  align-items: center;
}

.brand {
  grid-area: brand;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
}

.brand:hover {
  background: rgba(255, 255, 255, .08);
  text-decoration: none;
}

.brand__logo {
  font-weight: 900;
  letter-spacing: .2px;
}

.brand__tag {
  font-size: 12px;
  color: rgba(255, 255, 255, .75);
}

.cart {
  grid-area: cart;
  justify-self: end;
  position: relative;
  padding: 8px 10px;
  border-radius: 10px;
}

.cart:hover {
  background: rgba(255, 255, 255, .08);
  text-decoration: none;
}

.cart__count {
  position: absolute;
  top: 4px;
  left: 16px;
  background: var(--accent);
  color: #111;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
}

.pill {
  grid-area: loc;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .2);
  background: transparent;
  color: #fff;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  text-align: center;
}

.pill:hover {
  background: rgba(255, 255, 255, .08);
}

.search {
  grid-area: search;
  display: grid;
  grid-template-columns: 110px 1fr 44px;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  border: 2px solid transparent;
}

.search:focus-within {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .25);
}

.search__select {
  border: 0;
  padding: 10px 10px;
  background: #f3f4f6;
  color: #111;
}

.search__input {
  border: 0;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  min-width: 0;
}

.search__btn {
  border: 0;
  background: var(--accent);
  cursor: pointer;
  font-size: 16px;
}

.search__btn:hover {
  filter: brightness(1.05);
}

.account {
  grid-area: acct;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.account__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  border-radius: 10px;
}

.account__item:hover {
  background: rgba(255, 255, 255, .08);
  text-decoration: none;
}

.small {
  font-size: 12px;
  color: rgba(255, 255, 255, .75);
}

.account__item strong {
  font-size: 13px;
}

.topbar__strip {
  background: var(--nav2);
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.topbar__strip>* {
  white-space: nowrap;
}

.stripLink {
  color: rgba(255, 255, 255, .92);
  padding: 6px 8px;
  border-radius: 10px;
}

.stripLink:hover {
  background: rgba(255, 255, 255, .08);
  text-decoration: none;
}

/* Real hamburger menu (dropdown) */
.navMenu {
  position: relative;
}

.hamburger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: rgba(255, 255, 255, .10);
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.hamburger:hover {
  background: rgba(255, 255, 255, .14);
}

.hamburger__icon {
  width: 18px;
  height: 14px;
  display: grid;
  align-content: space-between;
}

.hamburger__icon span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 999px;
  transition: transform .18s ease, opacity .18s ease;
}

/* “X” animation when open */
.navMenu.is-open .hamburger__icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.navMenu.is-open .hamburger__icon span:nth-child(2) {
  opacity: 0;
}

.navMenu.is-open .hamburger__icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.hamburger__text {
  font-weight: 800;
}

.navMenu__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  max-width: min(360px, calc(100vw - 24px));
  background: #0b1220;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  padding: 8px;
  display: none;
  z-index: 200;
}

.navMenu.is-open .navMenu__panel {
  display: block;
}

.navMenu__panel a {
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  color: rgba(255, 255, 255, .95);
}

.navMenu__panel a:hover {
  background: rgba(255, 255, 255, .10);
  text-decoration: none;
}

@media (max-width: 420px) {
  .navMenu__panel {
    left: 0;
    right: 0;
    min-width: auto;
  }
}

/* Hero */
.hero {
  background: linear-gradient(180deg, #c7d2fe 0%, var(--bg) 72%);
}

.hero__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 12px 12px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -.2px;
}

.hero p {
  margin: 0 0 12px;
}

.hero__cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero__fineprint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.btn--primary {
  background: var(--accent);
  border-color: rgba(0, 0, 0, .08);
}

.btn--primary:hover {
  filter: brightness(1.03);
}

.btn--ghost {
  background: transparent;
}

.btn--ghost:hover {
  background: rgba(17, 24, 39, .06);
}

.btn--small {
  padding: 8px 10px;
  font-weight: 800;
}

.btn--add {
  width: 100%;
  background: var(--accent);
  border: 1px solid rgba(0, 0, 0, .08);
}

.btn--add:hover {
  filter: brightness(1.04);
}

/* Layout (mobile-first: single column) */
.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  align-items: start;
}

/* Filters drawer/desktop sidebar */
.filtersShell {
  margin: 0;
}

.filtersShell__summary {
  width: 100%;
}

.filtersShell summary {
  list-style: none;
}

.filtersShell summary::-webkit-details-marker {
  display: none;
}

.filters {
  margin-top: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.filters__title {
  margin: 0 0 10px;
  font-size: 16px;
}

.filters__hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.filter {
  border-top: 1px solid #eef2f7;
  padding-top: 12px;
  margin-top: 12px;
}

.filter__heading {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: .2px;
}

.check,
.radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin: 6px 0;
}

.price {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.price__input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* Results */
.results__bar {
  background: rgba(255, 255, 255, .75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.results__bar em {
  color: #374151;
}

.sort select {
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

/* Product grid */
.grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .08s ease;
}

.card:hover {
  transform: translateY(-1px);
}

.card.is-hidden {
  display: none !important;
}

.card__img {
  height: 110px;
  border-radius: var(--radius2);
  background: linear-gradient(180deg, #f3f4f6 0%, #fff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}

.card__title {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.card__meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.card__rating {
  font-size: 13px;
}

.card__rating span {
  color: var(--muted);
}

.card__price {
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.currency {
  font-size: 14px;
  font-weight: 800;
}

.card__prime {
  font-size: 12px;
  font-weight: 900;
  color: #111;
  background: #fde68a;
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 4px;
}

.card__note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* No results */
.noResults {
  margin-top: 12px;
  background: rgba(255, 255, 255, .75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.noResults small {
  color: var(--muted);
}

.footer {
  margin: 18px 0 30px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

/* Breakpoints */
@media (min-width: 700px) {
  .results__bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .sort select {
    width: auto;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .topbar__row {
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas: "brand loc search acct";
    gap: 12px;
  }

  .cart {
    display: none;
  }

  .account {
    justify-content: flex-end;
  }

  .layout {
    grid-template-columns: 280px 1fr;
  }

  .filtersShell__summary {
    display: none;
  }

  .filtersShell[open] .filters {
    margin-top: 0;
  }

  .filters {
    margin-top: 0;
    position: sticky;
    top: 110px;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}