/**
 * Page-specific styles. Add overrides or page layouts here.
 */

/* Homepage: no top padding on main so hero can sit flush under nav */
.page-home .main {
  padding-top: 0;
  padding-bottom: 0;
}

.page-content {
  max-width: var(--content-narrow);
  margin-left: auto;
  margin-right: auto;
}

.page-content p {
  font-size: var(--text-lg);
  line-height: var(--line-relaxed);
}

.page-content > * + * {
  margin-top: var(--space-5);
}

/* --- About page: section headings + lists (scoped; keeps typography aligned with site) --- */
.about-page .page-content {
  /* Editorial measure for comfortable long-form reading on large screens. */
  max-width: 42rem;
}

.about-hero {
  margin: 0 0 var(--space-12);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 26px rgba(37, 34, 32, 0.09);
  background: var(--color-bg-alt);
}

.about-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 30rem;
  object-fit: cover;
}

.about-section {
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-offwhite);
}

.about-section + .about-section {
  margin-top: var(--space-8);
}

.about-section__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-near-black);
  line-height: var(--line-tight);
  margin: 0 0 var(--space-4);
}

.about-section > * + * {
  margin-top: var(--space-4);
}

.about-section > .about-section__title + * {
  margin-top: 0;
}

.about-section__list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: var(--text-lg);
  line-height: var(--line-relaxed);
  color: var(--color-text);
}

.about-section__list li + li {
  margin-top: var(--space-2);
}

.about-section--values {
  background: linear-gradient(180deg, var(--color-cream) 0%, var(--color-offwhite) 100%);
}

/* Values section gets a subtle “principles list” treatment without becoming loud. */
.about-section--values .about-section__list {
  list-style: none;
  padding-left: 0;
}

.about-section--values .about-section__list li {
  position: relative;
  padding: var(--space-2) 0 var(--space-2) 1.5rem;
  border-bottom: 1px solid rgba(196, 190, 180, 0.45);
}

.about-section--values .about-section__list li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.9rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--color-accent);
  opacity: 0.85;
}

.about-section--values .about-section__list li:last-child {
  border-bottom: 0;
}

.about-quote {
  margin: var(--space-8) 0 0;
  padding: var(--space-5) var(--space-6);
  border-left: 3px solid var(--color-accent);
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, #f9f6f1 100%);
  border-radius: 0 8px 8px 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: var(--line-relaxed);
  color: var(--color-charcoal);
}

.about-closing {
  text-align: center;
  font-size: var(--text-lg);
  line-height: var(--line-relaxed);
  color: var(--color-warm-gray);
  margin: var(--space-10) auto 0;
  max-width: 32rem;
  padding-top: var(--space-6);
  border-top: 1px solid rgba(196, 190, 180, 0.55);
}

@media (max-width: 47.99em) {
  .about-hero {
    margin-bottom: var(--space-10);
  }

  .about-section {
    padding: var(--space-6);
  }

  .about-section + .about-section {
    margin-top: var(--space-6);
  }

  .about-section__title {
    font-size: var(--text-xl);
  }

  .about-section__list {
    font-size: var(--text-base);
  }

  .about-quote {
    font-size: var(--text-lg);
    padding: var(--space-4) var(--space-5);
  }

  .about-closing {
    margin-top: var(--space-8);
    padding-top: var(--space-5);
    font-size: var(--text-base);
  }
}

/* --- Shop: storefront filter bar — compact row 1 (search + sort), row 2 (category pills) --- */
.shop-filters {
  max-width: 100%;
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}

.shop-toolbar {
  margin: 0;
}

/* Row 1: capped width so search does not stretch edge-to-edge; aligned end-baseline with inputs */
.shop-toolbar__row {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(11rem, 14rem) auto;
  gap: var(--space-4) var(--space-5);
  align-items: end;
  justify-content: center;
  max-width: 48rem;
  margin: 0 auto var(--space-6);
}

.shop-toolbar__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.shop-toolbar__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  flex-shrink: 0;
}

.shop-toolbar__label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.shop-toolbar__label--ghost {
  visibility: hidden;
  user-select: none;
  pointer-events: none;
}

.shop-toolbar__input {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  min-height: 2.5rem;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
}

.shop-toolbar__input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(139, 115, 85, 0.18);
}

.shop-toolbar__select {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  min-height: 2.5rem;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
}

.shop-toolbar__select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(139, 115, 85, 0.18);
}

/* Lighter than primary — still clearly a button; matches boutique restraint */
.shop-toolbar__submit-btn {
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}

/* Row 2: category pills — subtle separation from search row */
.shop-category-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  max-width: 100%;
  padding-top: var(--space-2);
}

.shop-category-filter .btn {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0.45rem 1rem;
  min-height: 2.5rem;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: 999px;
  line-height: 1.2;
}

@media (max-width: 47.99em) {
  .shop-filters {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
  }

  .shop-toolbar__row {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    max-width: none;
    margin-bottom: var(--space-5);
  }

  .shop-toolbar__actions {
    width: 100%;
  }

  .shop-toolbar__label--ghost {
    display: none;
  }

  .shop-toolbar__submit-btn {
    width: 100%;
  }

  .shop-category-filter {
    justify-content: flex-start;
    padding-top: var(--space-1);
  }
}

@media (min-width: 48em) and (max-width: 63.99em) {
  .shop-toolbar__row {
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 12rem) auto;
  }
}

/* --- Home: Hero --- */
.home-hero {
  background: linear-gradient(180deg, var(--color-cream) 0%, var(--color-bg) 100%);
  padding: 80px 20px;
  text-align: center;
}

.home-hero__inner {
  max-width: 42.5rem; /* ~680px — centered, balanced width */
  margin: 0 auto;
}

.home-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--color-near-black);
  line-height: var(--line-tight);
  margin-bottom: var(--space-4);
}

.home-hero__lead {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: var(--line-relaxed);
  margin-bottom: var(--space-8);
}

.home-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
  align-items: center;
}

@media (max-width: 47.99em) {
  .home-hero {
    padding: var(--space-12) var(--space-4);
  }

  .home-hero__title {
    font-size: var(--text-2xl);
  }

  .home-hero__lead {
    font-size: var(--text-base);
    margin-bottom: var(--space-6);
  }

  .home-hero__cta {
    gap: var(--space-3);
  }
}

@media (min-width: 48em) {
  .home-hero__title {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-5);
  }
  .home-hero__lead {
    font-size: var(--text-xl);
    margin-bottom: var(--space-10);
  }
}

/* --- Home: Brand story --- */
/* Story split: text + image, keeps existing typography palette and spacing language. */
.story-split {
  margin-top: 40px;
}

.story-split__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.story-split__content {
  max-width: 560px;
}

.story-split__content .section-title {
  text-align: left;
}

.story-split__content p {
  font-size: var(--text-lg);
  line-height: var(--line-relaxed);
  margin-bottom: var(--space-5);
}

.story-split__content .btn {
  margin-top: var(--space-4);
}

.story-split__image img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
}

@media (max-width: 47.99em) {
  .story-split__content p {
    font-size: var(--text-base);
    margin-bottom: var(--space-4);
  }
}

@media (max-width: 768px) {
  .story-split__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .story-split__image {
    order: -1;
  }

  .story-split__content {
    max-width: 100%;
  }
}

/* --- Home: Process preview (coming soon media) --- */
.home-process {
  /* Slight separation from the previous story section without introducing a new layout system. */
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
}

.home-process__lead {
  text-align: center;
  font-size: var(--text-lg);
  line-height: var(--line-relaxed);
  color: var(--color-text-muted);
  margin: 0 auto var(--space-8);
  max-width: 40rem;
}

.home-process__steps {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

.home-process__step {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-offwhite);
  padding: var(--space-6);
}

.home-process__step-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-near-black);
  margin: 0 0 var(--space-2);
}

.home-process__step-text {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--line-relaxed);
  color: var(--color-text);
}

.home-process__coming-soon {
  margin: var(--space-6) 0 0;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

@media (min-width: 36em) {
  .home-process__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64em) {
  .home-process__steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 47.99em) {
  .home-process__lead {
    font-size: var(--text-base);
    margin-bottom: var(--space-6);
  }

  .home-process__step {
    padding: var(--space-5);
  }
}

/* --- Home: Final CTA --- */
.home-cta {
  text-align: center;
}

.home-cta__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-near-black);
  margin-bottom: var(--space-3);
}

.home-cta__lead {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}

.home-cta__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
  align-items: center;
}

@media (max-width: 47.99em) {
  .home-cta__lead {
    font-size: var(--text-base);
    margin-bottom: var(--space-6);
  }
}

@media (min-width: 48em) {
  .home-cta__title {
    font-size: var(--text-3xl);
  }
}

/* --- Product detail page --- */
.product-detail {
  display: grid;
  gap: var(--space-10);
  padding-top: var(--space-8);
  padding-bottom: var(--space-12);
}

.product-detail__media {
  position: relative;
}

/* Multi-image only: prev/next are true overlays (position:absolute) on the hero; hidden until hover/focus-within on .product-detail__main-wrap. */
.product-detail__main-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
  vertical-align: top;
}

.product-detail__main-wrap .product-detail__img {
  display: block;
  width: 100%;
  height: auto;
}

.product-detail__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.product-detail__nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.56);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 5;
  cursor: pointer;
}

.product-detail__nav-btn--prev {
  left: 12px;
}

.product-detail__nav-btn--next {
  right: 12px;
}

.product-detail__main-wrap:hover .product-detail__nav-btn,
.product-detail__main-wrap:focus-within .product-detail__nav-btn {
  opacity: 1;
  pointer-events: auto;
}

.product-detail__nav-btn:hover,
.product-detail__nav-btn:focus-visible {
  background: rgba(0, 0, 0, 0.72);
}

.product-detail__nav-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  opacity: 1;
  pointer-events: auto;
}

.product-detail__nav-icon {
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
  pointer-events: none;
}

.product-detail__placeholder {
  aspect-ratio: 1;
  max-width: 28rem;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--color-sand) 0%, var(--color-stone) 100%);
  border-radius: 8px;
}

.product-detail__gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* Thumbnail buttons switch the main image (see main.js); keyboard-friendly native <button>. */
.product-detail__gallery-thumb {
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  border-radius: 6px;
  transition: box-shadow var(--duration-normal), opacity var(--duration-normal);
}

.product-detail__gallery-thumb:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.product-detail__gallery-thumb:not(.product-detail__gallery-thumb--active) {
  opacity: 0.82;
}

.product-detail__gallery-thumb--active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--color-accent), 0 4px 12px rgba(0, 0, 0, 0.12);
}

.product-detail__gallery-img {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  display: block;
  pointer-events: none;
}

.product-detail__body {
  max-width: var(--content-narrow);
}

.product-detail__category {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.product-detail__category a:hover {
  color: var(--color-accent);
}

.product-detail__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--color-near-black);
  margin-bottom: var(--space-3);
}

.product-detail__price {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-charcoal);
  margin-bottom: var(--space-6);
}

.product-detail__description {
  font-size: var(--text-lg);
  line-height: var(--line-relaxed);
  color: var(--color-text);
  margin-bottom: var(--space-8);
}

.product-detail__cta {
  margin: 0;
}

.product-detail__cta--sold {
  font-weight: 600;
  color: var(--color-charcoal);
}

.product-detail__cta-secondary {
  margin: var(--space-4) 0 0;
}

.product-detail__cta-secondary .btn {
  margin-top: 0;
}

@media (min-width: 48em) {
  .product-detail {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: start;
  }
  .product-detail__body {
    max-width: none;
  }
}

@media (max-width: 47.99em) {
  .product-detail {
    gap: var(--space-8);
    padding-top: var(--space-4);
    padding-bottom: var(--space-8);
  }

  .product-detail__title {
    font-size: var(--text-2xl);
  }

  .product-detail__description {
    font-size: var(--text-base);
    margin-bottom: var(--space-6);
  }

  .product-detail__gallery {
    gap: var(--space-3);
  }

  .product-detail__gallery-img {
    width: 4.5rem;
    height: 4.5rem;
  }

  .product-detail__nav-btn {
    width: 52px;
    height: 52px;
  }

  .product-detail__nav-icon {
    font-size: 32px;
  }
}

/* Touch devices do not have hover; keep image nav arrows visible/usable. */
@media (hover: none) and (pointer: coarse) {
  .product-detail__nav-btn {
    opacity: 0.96;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.64);
  }
}

/* Product not found (graceful handling) */
.product-not-found {
  text-align: center;
  padding: var(--space-12) 0;
}

.product-not-found .page-header__title {
  margin-bottom: var(--space-4);
}

.product-not-found p {
  margin-bottom: var(--space-6);
}

/* Placeholder content blocks for Phase 1 */
.placeholder-block {
  background: var(--color-bg-alt);
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  padding: var(--space-8);
  text-align: center;
  color: var(--color-text-muted);
  margin-top: var(--space-6);
}

@media (max-width: 47.99em) {
  .placeholder-block {
    padding: var(--space-6);
    margin-top: var(--space-4);
  }

  .page-content p {
    font-size: var(--text-base);
  }
}

.placeholder-block p {
  margin-bottom: var(--space-2);
}

.placeholder-block p:last-child {
  margin-bottom: 0;
}

/* Keep form controls and grouped actions consistent on content pages. */
.page-content form,
.page-content .form-group {
  display: grid;
  gap: var(--space-4);
}

.page-content form + form {
  margin-top: var(--space-6);
}
