/* The product pages: home (hero and category sections), shop (sidebar
   filters and results) and product (gallery and details), plus the product
   cards they share. Load after site.css. */

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  align-items: center;
  gap: 18px;
  max-width: var(--page-width);
  min-height: 360px;
  margin: 0 auto;
  padding: calc(28px + var(--logo-clearance)) var(--gutter) 34px;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 20px 0 20px 16px;
}

.hero h1 {
  margin: 12px 0 18px;
  font-size: clamp(2.8rem, 5.2vw, 4.65rem);
  font-weight: 850;
  line-height: 0.99;
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: var(--brand);
}

.hero-copy p {
  max-width: 390px;
  margin: 0 0 24px;
  font-size: 1.12rem;
  font-weight: 550;
}

.hero-image {
  height: 100%;
  min-height: 330px;
  overflow: hidden;
  border-radius: 26px;
}

.hero-image img {
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
}

/* Home: a section per featured category */

.home-category-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}

.home-category-heading h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  letter-spacing: -0.035em;
}

.home-category-heading h2 a:hover,
.see-all:hover {
  color: var(--brand-dark);
}

.see-all {
  color: var(--brand);
  font-weight: 750;
  white-space: nowrap;
}

.home-shop-all {
  margin: 8px 0 0;
  text-align: center;
}

/* Product cards */

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

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

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.product-link {
  display: block;
}

.product-photo {
  position: relative;
  display: block;
  aspect-ratio: 1.12 / 1;
  overflow: hidden;
  background: #f4e9df;
}

.product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}

.product-link:hover .product-photo img {
  transform: scale(1.035);
}

.product-link:hover .product-name {
  color: var(--brand);
}

.product-photo .status {
  position: absolute;
  top: 12px;
  left: 12px;
}

.product-name {
  display: block;
  padding: 13px 14px 0;
  font-size: 1rem;
  font-weight: 700;
}

.product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 3px 14px 15px;
}

.spec {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.price {
  margin: 0 0 12px;
  font-size: 1.08rem;
  font-weight: 850;
}

.product-info .button {
  width: 100%;
  margin-top: auto;
  padding: 10px 12px;
  font-size: 0.88rem;
}

.status {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--status-color);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
}

.status--in-stock {
  --status-color: var(--in-stock);
}

.status--made-to-order {
  --status-color: var(--made-to-order);
}

.status--sold-out {
  --status-color: var(--sold-out);
}

/* Shop: sidebar filters and results */

.shop-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 32px;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: calc(32px + var(--logo-clearance)) var(--gutter) 48px;
}

.shop-filters {
  position: sticky;
  /* Sticks below the hanging logo, which stays over the page. */
  top: calc(var(--logo-size) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--logo-size) - 44px);
  overflow: auto;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.shop-filters fieldset {
  margin: 0 0 16px;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.shop-filters legend {
  margin-bottom: 8px;
  padding: 0;
  font-weight: 800;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 0.92rem;
  cursor: pointer;
}

.option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand);
}

.option small {
  margin-left: auto;
  color: var(--muted);
}

.price-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-range input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
}

.clear-filters {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 750;
  cursor: pointer;
}

.shop-results h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  letter-spacing: -0.04em;
}

.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.result-count {
  margin: 0;
  color: var(--muted);
}

.toolbar-controls {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.sort select {
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  outline-color: var(--brand);
}

.filters-toggle {
  display: none;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-weight: 750;
  cursor: pointer;
}

.empty-message {
  padding: 35px;
  color: var(--muted);
  text-align: center;
}

/* Product page */

.product-page {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: calc(24px + var(--logo-clearance)) var(--gutter) 56px;
}

.breadcrumbs {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.breadcrumbs a:hover {
  color: var(--brand);
}

.breadcrumbs [aria-current="page"] {
  color: var(--ink);
  font-weight: 650;
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.gallery-stage {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background: #f4e9df;
}

.gallery-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.9);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.15);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-arrow--previous {
  left: 12px;
}

.gallery-arrow--next {
  right: 12px;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
}

.gallery-thumb {
  flex: none;
  width: 68px;
  height: 68px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: none;
  opacity: 0.65;
  cursor: pointer;
}

.gallery-thumb[aria-current="true"] {
  border-color: var(--brand);
  opacity: 1;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-details {
  padding-top: 8px;
}

.product-category {
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.product-title {
  margin: 6px 0 8px;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.product-price {
  margin: 0 0 12px;
  font-size: 1.6rem;
  font-weight: 850;
}

.product-description {
  margin: 16px 0 0;
  color: #514943;
}

.product-specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  margin: 20px 0 24px;
  padding: 16px 0;
  border-block: 1px solid var(--line);
}

.product-specs dt {
  color: var(--muted);
}

.product-specs dd {
  margin: 0;
  font-weight: 600;
}

.swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.2);
  vertical-align: middle;
}

.product-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.product-note a {
  color: var(--brand);
  font-weight: 650;
}

.product-missing {
  padding: 48px 0;
  text-align: center;
}

.product-missing h1 {
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}

.product-missing p {
  margin: 0 0 20px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1fr;
  }

  .shop-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .shop-filters {
    position: static;
    display: none;
    max-height: none;
    margin-bottom: 20px;
  }

  .shop-filters.is-open {
    display: block;
  }

  .filters-toggle {
    display: inline-block;
  }

  .product-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 18px;
  }
}

@media (max-width: 620px) {
  .hero {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-block: calc(22px + var(--logo-clearance)) 28px;
  }

  .hero-copy {
    width: 100%;
    padding: 8px 4px 0;
  }

  .hero h1 {
    font-size: 3.15rem;
  }

  .hero-copy p {
    font-size: 1rem;
  }

  .hero-image,
  .hero-image img {
    width: 100%;
    min-height: 220px;
  }

  .product-grid,
  .product-grid--home {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* Two columns: a third card would sit alone, and "See all" covers it. */
  .product-grid--home .product-card:nth-child(n + 3) {
    display: none;
  }

  .product-name {
    padding: 10px 10px 0;
    font-size: 0.9rem;
  }

  .product-info {
    padding: 3px 10px 10px;
  }

  .product-info .button {
    padding: 9px 5px;
    font-size: 0.78rem;
  }

  .results-bar {
    align-items: stretch;
  }

  .toolbar-controls {
    width: 100%;
    margin-left: 0;
  }

  .sort select {
    max-width: 8.5rem;
  }
}
