/* Small overrides on top of Pico.css */

.product-grid,
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.product-card,
.category-card {
  margin: 0;
}

.product-card a,
.category-card a {
  text-decoration: none;
  color: inherit;
}

.product-card img,
.category-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-background-color);
}

.product-card h3,
.category-card h3 {
  margin: 0.5rem 0 0.25rem;
  font-size: 1.1rem;
}

.hero {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--pico-border-radius);
  margin-bottom: 1rem;
}

/* Product gallery */
.gallery #gallery-main {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: var(--pico-card-background-color);
  border-radius: var(--pico-border-radius);
  display: block;
}

.thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.thumb {
  width: 90px;
  height: 68px;
  object-fit: cover;
  cursor: pointer;
  border-radius: var(--pico-border-radius);
  border: 2px solid transparent;
  flex: 0 0 auto;
}

.thumb:hover,
.thumb.is-active {
  border-color: var(--pico-primary);
}

/* Videos */
.videos video {
  width: 100%;
  margin-top: 1rem;
  border-radius: var(--pico-border-radius);
  background: #000;
}

/* Filters on the all-products page */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  background: var(--pico-card-background-color);
  border-radius: var(--pico-border-radius);
}

.filters input[type="search"] {
  flex: 1 1 240px;
  margin: 0;
}

.filters fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filters fieldset legend {
  font-weight: bold;
  padding: 0;
  margin-right: 0.5rem;
}

.filters label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  cursor: pointer;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--pico-muted-color);
}

/* Prose adjustments inside descriptions */
.prose {
  margin: 1.5rem 0;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--pico-border-radius);
}

/* ---- Category-first home ---- */
.home-hero { margin: 1rem 0 2rem; }

.category-grid.tiles {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.cat-tile {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: var(--pico-border-radius);
  overflow: hidden;
  text-decoration: none;
}
.cat-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.cat-tile:hover img { transform: scale(1.05); }
.cat-tile-label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.25rem 1rem 0.9rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
}

/* ---- Featured spotlight ---- */
.featured-spotlight .spotlight {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  background: var(--pico-card-background-color);
  border-radius: var(--pico-border-radius);
  overflow: hidden;
}
.featured-spotlight img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.featured-spotlight .spotlight-body { padding: 1rem 1.75rem 1.5rem 0; }
.featured-spotlight h3 { font-size: 1.8rem; margin: 0.2rem 0; }
.featured-spotlight .price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--pico-primary);
  margin: 0.4rem 0;
}
.featured-spotlight .spotlight-cta { color: var(--pico-primary); font-weight: 600; }
@media (max-width: 700px) {
  .featured-spotlight .spotlight { grid-template-columns: 1fr; }
  .featured-spotlight .spotlight-body { padding: 0 1.25rem 1.25rem; }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  color: var(--pico-muted-color);
  margin: 0 0 0.25rem;
}
.eyebrow a { color: var(--pico-primary); text-decoration: none; }

/* ---- Product card badges + price ---- */
.card-media { position: relative; }
.card-price { margin: 0.25rem 0 0; }

.badge {
  position: absolute;
  top: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
}
.badge-sale { left: 0.5rem; background: #e23b3b; color: #fff; }
.badge-stock { right: 0.5rem; background: #f0a500; color: #1a1a1a; }
.badge-out { right: 0.5rem; background: #555; color: #fff; }

/* ---- Product detail: stock + price table ---- */
.cat-header .lede { color: var(--pico-muted-color); font-size: 1.05rem; }

.stock-notice { font-weight: 600; margin: 1rem 0 0.5rem; }
.stock-notice.low { color: #d98a00; }
.stock-notice.out { color: #e23b3b; }
.stock-notice.in { color: var(--pico-primary); }

.price-table { width: 100%; max-width: 420px; margin: 1rem 0 1.5rem; }
.price-table th { text-align: left; }
.price-table .price-cell { text-align: right; }
.price-table .was { opacity: 0.55; margin-right: 0.45rem; }
.price-table .now { color: #e23b3b; }

/* ---- Sidebar layout ---- */
.topbar { display: none; }
.nav-burger { cursor: pointer; font-size: 1.6rem; line-height: 1; user-select: none; }

.layout { display: flex; align-items: flex-start; }

.sidebar {
  flex: 0 0 240px;
  width: 240px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1.5rem 1.25rem;
  border-right: 1px solid var(--pico-muted-border-color);
  background: var(--pico-card-background-color);
}
.sidebar-brand {
  display: block;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--pico-primary);
  text-decoration: none;
  margin-bottom: 1.5rem;
}
.sidebar nav ul { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.sidebar nav li { margin: 0; }
.sidebar nav a {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  color: var(--pico-color);
  text-decoration: none;
  font-weight: 500;
}
.sidebar nav a:hover {
  background: color-mix(in srgb, var(--pico-primary) 14%, transparent);
  color: var(--pico-primary);
}
.nav-heading {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: var(--pico-muted-color);
  margin: 1.25rem 0 0.4rem 0.6rem;
}
.sidebar-close { display: none; }
.nav-backdrop { display: none; }

.content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1100px;
  padding: 1.5rem 2rem 3rem;
}

@media (max-width: 768px) {
  .topbar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 0.6rem 1rem;
    background: var(--pico-card-background-color);
    border-bottom: 1px solid var(--pico-muted-border-color);
  }
  .topbar strong a { color: var(--pico-primary); text-decoration: none; }

  .layout { display: block; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    height: 100%;
    width: 260px;
    flex-basis: 260px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.5);
  }
  .nav-toggle:checked ~ .layout .sidebar { transform: translateX(0); }

  .nav-toggle:checked ~ .layout .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.5);
  }

  .sidebar-close {
    display: block;
    margin-top: 1.25rem;
    cursor: pointer;
    color: var(--pico-muted-color);
  }

  .content { padding: 1.25rem 1rem 2.5rem; }
}
