/**
 * Dabi — reusable components.
 * Buttons, product card, brand tile, category tile, carousel, brand wall, editorial, brand-moment.
 */

/* --------------------------------------------------------------------------
   Buttons — default = outline pill (restrained shop)
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 2.75rem; /* 44px touch */
  padding: var(--s-3) var(--s-6);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition:
    opacity var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  opacity: 1;
}

.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Explicit outline (same as default) */
.btn--outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn--outline:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Weighty shop action — filled ink */
.btn--solid,
.btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn--solid:hover,
.btn--primary:hover {
  background: color-mix(in srgb, var(--ink) 88%, white);
  border-color: color-mix(in srgb, var(--ink) 88%, white);
  color: var(--paper);
  opacity: 1;
}

/* Brand-moment only — blue field pair */
.btn--accent {
  background: var(--blue);
  color: var(--on-blue);
  border-color: var(--blue);
}

.btn--accent:hover {
  opacity: 0.9;
}

/* Packaging / story / спец-CTA */
.btn--coral {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
}

.btn--coral:hover {
  opacity: 0.9;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  padding-inline: var(--s-2);
  font-weight: 500;
}

.btn--ghost:hover {
  background: transparent;
  color: var(--ink);
  opacity: 0.6;
}

/* Outline on dark photo fields (statement banner) */
.btn--on-dark {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.95);
}

.btn--on-dark:hover {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
  opacity: 1;
}

.btn--block {
  width: 100%;
}

/* Story / tag pill */
.pill-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding: var(--s-1) var(--s-3);
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  line-height: 1;
  border-radius: var(--radius-pill);
  background: var(--coral-soft);
  color: var(--coral);
  border: none;
}

/* Brand story — human sentence, stays prominent */
.pill-tag--story {
  display: inline-block;
  max-width: min(42rem, 100%);
  min-height: 0;
  padding: var(--s-3) var(--s-6);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  line-height: var(--lh-body);
  text-align: left;
  text-wrap: balance;
}

@media (max-width: 767px) {
  .btn {
    min-height: 2.75rem;
  }
}

/* --------------------------------------------------------------------------
   Catalog pagination — round number pills
   -------------------------------------------------------------------------- */

.catalog-pagination {
  display: flex;
  justify-content: center;
}

.catalog-pagination .page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.catalog-pagination .page-numbers a,
.catalog-pagination .page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-pill);
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.catalog-pagination .page-numbers .prev,
.catalog-pagination .page-numbers .next {
  width: auto;
  padding-inline: var(--s-4);
}

.catalog-pagination .page-numbers .current {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.catalog-pagination .page-numbers a:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Product card — Clay maket (single source: content-product.php)
   -------------------------------------------------------------------------- */

.product-card {
  --product-card-aspect: 1 / 1;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: transparent;
  margin: 0;
  list-style: none;
}

.product-card__link {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.product-card__link:hover {
  opacity: 1;
}

.product-card__media {
  position: relative;
  display: block;
  aspect-ratio: var(--product-card-aspect);
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
}

.product-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur) var(--ease);
}

.product-card__img--empty {
  background: var(--surface);
}

.product-card__wish {
  position: absolute;
  top: var(--stack-y);
  right: var(--stack-y);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(28, 24, 21, 0.18));
  transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.product-card__wish .icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
}

.product-card__wish:hover,
.product-card__wish:focus-visible {
  color: var(--coral);
}

.product-card__wish.is-active {
  color: var(--coral);
}

.product-card__wish.is-active .icon {
  fill: currentColor;
}

.product-card__wish:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  @media (min-width: 1024px) {
    .product-card__wish {
      opacity: 0;
    }

    .product-card:hover .product-card__wish,
    .product-card__wish.is-active,
    .product-card__wish:focus-visible {
      opacity: 1;
    }

    .product-card:hover .product-card__img {
      transform: scale(1.03);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card__img,
  .product-card__wish {
    transition: none;
  }

  .product-card:hover .product-card__img {
    transform: none;
  }
}

.product-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--stack-y);
  margin-top: var(--stack-y);
}

.product-card__title {
  display: -webkit-box;
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: var(--lh-head);
  letter-spacing: var(--tracking-product);
  text-transform: uppercase;
  color: var(--ink);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__price {
  display: block;
  margin: 0;
  color: var(--price);
  font-weight: 600;
  font-size: var(--fs-body);
}

.product-card__price del {
  color: var(--ink-2);
  text-decoration: line-through;
  font-weight: 500;
  margin-inline-end: var(--s-2);
}

.product-card__price ins {
  color: var(--coral);
  text-decoration: none;
  font-weight: 600;
}

.product-card__price .amount {
  color: inherit;
}

/* Shared product grids — 2 / 2 / 3 / 4 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1440px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Product carousel
   -------------------------------------------------------------------------- */

.carousel {
  display: flex;
  flex-direction: column;
  gap: var(--block-y);
}

.carousel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
}

.carousel__head .eyebrow {
  margin: 0;
}

.carousel__all {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.carousel__all:hover {
  opacity: 0.6;
}

.carousel__viewport {
  position: relative;
}

.carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--gap) * 0)) / 1.2);
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}

.carousel__track::-webkit-scrollbar {
  display: none;
}

.carousel__track.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.carousel__slide {
  scroll-snap-align: start;
  min-width: 0;
}

@media (min-width: 768px) {
  .carousel__track {
    grid-auto-columns: calc((100% - (var(--gap) * 2)) / 3);
  }
}

@media (min-width: 1024px) {
  .carousel__track {
    grid-auto-columns: calc((100% - (var(--gap) * 3)) / 4);
  }
}

.carousel__nav {
  display: none;
  position: absolute;
  top: 40%;
  z-index: 5;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity var(--dur) var(--ease);
}

.carousel__nav:hover {
  opacity: 0.7;
}

.carousel__nav--prev {
  left: calc(var(--gutter) * -0.25);
}

.carousel__nav--next {
  right: calc(var(--gutter) * -0.25);
}

@media (min-width: 1024px) {
  .carousel__nav {
    display: inline-flex;
  }
}

/* --------------------------------------------------------------------------
   Brand wall
   -------------------------------------------------------------------------- */

.brand-wall {
  display: flex;
  flex-direction: column;
  gap: var(--block-y);
}

.brand-wall__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
}

.brand-wall__head .eyebrow {
  margin: 0;
}

.brand-wall__all {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand-wall__all:hover {
  opacity: 0.6;
}

.brand-wall__grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 42%;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.brand-wall__grid::-webkit-scrollbar {
  display: none;
}

.brand-wall__tile {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 2;
  padding: var(--pad-card);
  background: var(--surface);
  border-radius: var(--radius);
  text-decoration: none;
  opacity: 0.75;
  scroll-snap-align: start;
  transition: opacity var(--dur) var(--ease);
}

.brand-wall__tile:hover {
  opacity: 1;
}

.brand-wall__logo {
  max-width: 70%;
  max-height: 2.5rem;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(1);
}

.brand-wall__name {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink);
  text-align: center;
}

@media (min-width: 768px) {
  .brand-wall__grid {
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    scroll-snap-type: none;
  }
}

@media (min-width: 1024px) {
  .brand-wall__grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Brand feature tile (home / masonry) — photo expressive, name below
   -------------------------------------------------------------------------- */

.brand-tile {
  min-width: 0;
}

.brand-tile__link {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  color: inherit;
  text-decoration: none;
  transition: transform var(--dur) var(--ease);
}

.brand-tile__link:hover {
  opacity: 1;
}

.brand-tile__media {
  display: block;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
}

.brand-tile--portrait .brand-tile__media {
  aspect-ratio: 4 / 5;
}

.brand-tile--tall .brand-tile__media {
  aspect-ratio: 3 / 5;
}

.brand-tile--square .brand-tile__media {
  aspect-ratio: 1 / 1;
}

.brand-tile--landscape .brand-tile__media {
  aspect-ratio: 4 / 3;
}

.brand-tile--wide .brand-tile__media {
  aspect-ratio: 16 / 9;
}

.brand-tile__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur) var(--ease);
}

.brand-tile__img--empty {
  background:
    linear-gradient(145deg, var(--cream) 0%, var(--surface) 45%, color-mix(in srgb, var(--blue) 28%, var(--surface)) 100%);
}

.brand-tile__name {
  font-family: var(--font-sans);
  font-size: var(--fs-small); /* ~14px */
  font-weight: 500;
  line-height: var(--lh-head);
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
  text-align: left;
}

@media (hover: hover) and (pointer: fine) {
  .brand-tile__link:hover {
    transform: translateY(-2px);
  }

  .brand-tile__link:hover .brand-tile__img {
    transform: scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-tile__link,
  .brand-tile__img {
    transition: none;
  }

  .brand-tile__link:hover {
    transform: none;
  }

  .brand-tile__link:hover .brand-tile__img {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Category tile — photo + centered white title
   -------------------------------------------------------------------------- */

.category-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(22.5rem, 42vw, 35rem); /* 360 → 560 */
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--brown);
  text-decoration: none;
  color: #fff;
}

.category-tile:hover {
  opacity: 1;
}

.category-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur) var(--ease);
}

.category-tile__img--empty {
  background:
    linear-gradient(160deg, var(--coral) 0%, var(--rust) 40%, var(--brown) 100%);
}

.category-tile__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(28, 24, 21, 0.35) 0%, rgba(28, 24, 21, 0.15) 45%, transparent 70%),
    linear-gradient(to top, rgba(28, 24, 21, 0.4) 0%, transparent 42%);
}

.category-tile__label {
  position: relative;
  z-index: 2;
  margin: 0;
  padding-inline: var(--s-4);
  font-family: var(--font-sans);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: var(--lh-head);
  letter-spacing: -0.01em;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 12px rgba(28, 24, 21, 0.25);
}

@media (hover: hover) and (pointer: fine) {
  .category-tile:hover .category-tile__img {
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-tile__img {
    transition: none;
  }

  .category-tile:hover .category-tile__img {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Room / category strip
   -------------------------------------------------------------------------- */

.room-tiles {
  display: flex;
  flex-direction: column;
  gap: var(--block-y);
}

.room-tiles__head .eyebrow {
  margin: 0;
}

.room-tiles__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.room-tiles__grid .category-tile {
  min-height: 0;
  height: 100%;
}

@media (min-width: 768px) {
  .room-tiles__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .room-tiles__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Editorial banner
   -------------------------------------------------------------------------- */

.editorial {
  display: grid;
  gap: var(--block-y);
  align-items: center;
}

.editorial--surface {
  padding: var(--pad-panel);
  background: var(--surface);
  border-radius: var(--radius);
}

.editorial__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 35rem;
}

.editorial__copy .eyebrow {
  margin: 0 0 var(--s-3);
}

.editorial__copy h2 {
  margin: 0 0 var(--s-6);
}

.editorial__text {
  margin: 0 0 var(--s-8);
  color: var(--ink-2);
  max-width: 42ch;
}

.editorial__media {
  min-width: 0;
}

.editorial__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--surface);
  border-radius: var(--radius);
}

.editorial--surface .editorial__img {
  background: var(--paper);
}

@media (max-width: 1023px) {
  .editorial__media {
    order: -1;
  }
}

@media (min-width: 1024px) {
  .editorial {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--gap);
  }

  .editorial--reverse .editorial__media {
    order: -1;
  }

  .editorial__img {
    aspect-ratio: 1 / 1;
    height: 100%;
    min-height: 28rem;
  }
}

/* --------------------------------------------------------------------------
   Brand-moment banner (full-bleed)
   -------------------------------------------------------------------------- */

.brand-moment {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(22.5rem, 40vw, 40rem); /* 360 → 640 */
  overflow: hidden;
  background: var(--brand-moment-bg, var(--brown));
  color: var(--brand-moment-fg, var(--on-brown));
}

.brand-moment__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-moment__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(58, 35, 24, 0.55), rgba(58, 35, 24, 0.15) 55%, transparent);
  pointer-events: none;
}

.brand-moment__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 35rem;
  padding-block: var(--pad-panel);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand-moment__brand {
  margin: 0 0 var(--s-3);
  font-family: var(--font-sans);
  font-size: var(--fs-h3);
  font-weight: 600;
  color: inherit;
}

.brand-moment__text {
  margin: 0 0 var(--s-8);
  font-size: var(--fs-body-lg);
  color: inherit;
  max-width: 36ch;
}

.brand-moment .btn--solid,
.brand-moment .btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.brand-moment .btn--solid:hover,
.brand-moment .btn--primary:hover {
  background: color-mix(in srgb, var(--ink) 88%, white);
  border-color: color-mix(in srgb, var(--ink) 88%, white);
  color: var(--paper);
}

.brand-moment .btn,
.brand-moment .btn--outline {
  color: var(--ink);
  border-color: var(--ink);
  background: transparent;
}

.brand-moment .btn:hover,
.brand-moment .btn--outline:hover {
  background: var(--ink);
  color: var(--paper);
}
