/* ===== TripTea — Набори block ============================================= */

/* Outer wrapper — break out of bootstrap .container so the BG spans full viewport.
   Inner content stays max 1704px wide (matching slideshow & other blocks). */
.tt-sets {
  position: relative;
  background: #FAF7F2;
  padding: 32px 0 40px;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "case", "cpsp";
  color: #2B2B2B;
}

.tt-sets--breakout {
  width: 100vw;
  max-width: 100vw;
  left: 50%;
  transform: translateX(-50%);
}

.tt-sets__inner {
  width: min(1704px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

.tt-sets *,
.tt-sets *::before,
.tt-sets *::after {
  box-sizing: border-box;
}

.tt-sets__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 24px;
  padding: 0;
  gap: 16px;
}

.tt-sets__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 36px;
  line-height: 120%;
  letter-spacing: 0;
  margin: 0;
  color: #4A3426;
  vertical-align: middle;
}

.tt-sets__head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Nav buttons — same as Хіти block (.tt-bestsellers__nav-btn) */
.tt-sets__nav-btn {
  width: 56px;
  height: 56px;
  border: 1px solid #4A3426;
  border-radius: 16px;
  background: transparent;
  color: #4A3426;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.tt-sets__nav-btn:hover {
  background: #FAF7F2;
}

.tt-sets__nav-btn--disabled,
.tt-sets__nav-btn:disabled {
  background: #FFFFFF;
  border-color: #F5EFE7;
  color: #E7D7C8;
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* "Всі набори" CTA — Secondary Button per Figma (Tea Brown outline pill).
   Same height as prev/next nav buttons (56) so they line up. */
.tt-sets__view-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  height: 56px;
  border: 1px solid #8B5E3C;
  border-radius: 16px;
  background: transparent;
  color: #8B5E3C;
  font-family: 'Chivo', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tt-sets__view-all:hover,
.tt-sets__view-all:focus,
.tt-sets__view-all:active {
  background: #8B5E3C;
  color: #FFFFFF;
  text-decoration: none;
}

.tt-sets__view-all svg {
  flex: 0 0 auto;
}

/* ===== Strip (carousel) ================================================== */

.tt-sets__viewport {
  position: relative;
}

.tt-sets__strip {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 8px;
  /* Fade-out applied as a mask on the strip itself — no separate overlay element,
     so no sub-pixel gap can appear between strip and overlay at any viewport width. */
  --fade-width: 108px;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - var(--fade-width)), transparent 100%);
          mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - var(--fade-width)), transparent 100%);
  transition: --fade-width 0.2s ease;
}

/* When strip is scrolled to the end there is no further content to hint at — drop the mask. */
.tt-sets__strip.is-at-end {
  --fade-width: 0px;
}

.tt-sets__strip::-webkit-scrollbar { display: none; }

.tt-sets__strip > .tt-set-card {
  flex: 0 0 370px;
  scroll-snap-align: start;
}

/* ===== Card ============================================================== */

.tt-set-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 370px;
  /* min-height instead of height — strip uses align-items: stretch (flex default),
     so all cards grow to the tallest one. Long composition lists no longer overflow. */
  min-height: 636px;
  padding: 8px;
  gap: 16px;
  background: #FFFFFF;
  border: 1px solid #EAEAEA;
  border-radius: 24px;
  font-family: 'Poppins', sans-serif;
  color: #2B2B2B;
  isolation: isolate;
  transition: box-shadow 0.2s ease, color 0.15s ease;
}

.tt-set-card:hover {
  box-shadow: 0 4px 24px 0 rgba(63, 28, 4, 0.16);
}

.tt-set-card:hover .tt-set-card__title {
  color: #8B5E3C;
}

.tt-set-card__media {
  position: relative;
  display: block;
  width: 100%;
  height: 270px;
  border-radius: 16px;
  overflow: hidden;
  background-color: #FAF7F2;
  background-size: cover;
  background-position: center;
  text-decoration: none;
  padding: 16px;
  flex: 0 0 auto;
}

/* ----- Badge (top-left of media) ------------------------------------------- */
.tt-set-card__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 150%;
  white-space: nowrap;
}

.tt-set-card__badge--popular {
  background: #E7D7C8;
  color: #8B5E3C;
}

.tt-set-card__badge--new {
  background: #8B5E3C;
  color: #FAF7F2;
}

.tt-set-card__badge--triptea_choice {
  background: #2B2B2B;
  color: #FAF7F2;
}

/* ----- Heart (top-right of media) ----------------------------------------- */
.tt-set-card__heart {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  padding: 0;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease;
}

.tt-set-card__heart:hover {
  color: #FAF7F2;
}

.tt-set-card__heart--active,
.tt-set-card__heart--active:hover {
  color: #8B5E3C;
}

.tt-set-card__heart--active svg path {
  fill: #8B5E3C !important;
  stroke: #8B5E3C !important;
}

/* ===== Body ============================================================== */

.tt-set-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 8px 8px;
  flex: 1 1 auto;
  min-height: 0;
}

.tt-set-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tt-set-card__sku {
  font-size: 12px;
  font-weight: 400;
  line-height: 140%;
  color: #6B6B6B;
}

.tt-set-card__stock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 140%;
}

.tt-set-card__stock--in_stock     { color: #8B5E3C; }
.tt-set-card__stock--pre_order    { color: #6B6B6B; opacity: 0.7; }
.tt-set-card__stock--out_of_stock { color: #B7A695; }

.tt-set-card__title {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 140%;
  letter-spacing: 0;
  color: #4A3426;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.tt-set-card__title a {
  color: inherit;
  text-decoration: none;
}

.tt-set-card__title:hover,
.tt-set-card__title a:hover {
  color: #8B5E3C;
  text-decoration: none;
}

/* ----- Composition list --------------------------------------------------- */
.tt-set-card__composition {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}

.tt-set-card__composition-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 140%;
  letter-spacing: 0;
  color: #4A3426;
}

.tt-set-card__composition-head svg {
  color: #4A3426;
  flex: 0 0 auto;
}

.tt-set-card__composition-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tt-set-card__composition-list li {
  position: relative;
  padding-left: 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 150%;
  letter-spacing: 0;
  color: #6B6B6B;
}

.tt-set-card__composition-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 9px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8B5E3C;
}

/* ----- Footer (prices + cart / waiting button) ---------------------------- */

.tt-set-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.tt-set-card__prices {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tt-set-card__old-price {
  font-size: 14px;
  font-weight: 400;
  line-height: 150%;
  color: #8B5E3C;
  text-decoration: line-through;
}

.tt-set-card__price {
  font-size: 22px;
  font-weight: 700;
  line-height: 130%;
  color: #2B2B2B;
}

/* Active cart button — same as Хіти block (.tt-product-card__cart) */
.tt-set-card__cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 56px;
  width: 56px;
  height: 48px;
  background: #8B5E3C;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.tt-set-card__cart:hover { background: #4A3426; }
.tt-set-card__cart:active { transform: scale(0.97); }

/* Waiting (pre-order) pill — replaces cart button; per design spec */
.tt-set-card__waiting {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 148px;
  height: 40px;
  padding: 8px 12px;
  background: #EAEAEA;
  border: none;
  border-radius: 8px;
  color: #FFFFFF;
  font-family: 'Poppins', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 16px;
  line-height: 140%;
  letter-spacing: 0;
  font-feature-settings: 'case' on, 'cpsp' on;
  cursor: not-allowed;
  white-space: nowrap;
}

.tt-set-card__waiting svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

/* Disabled card visuals */
.tt-set-card--disabled .tt-set-card__title { color: #4A3426; }
.tt-set-card--disabled .tt-set-card__price { color: #2B2B2B; }

/* Default: bottom nav hidden on desktop, shown only on mobile */
.tt-sets__nav--bottom {
  display: none;
}

/* ===== Mobile (Figma frame 744:48676 — Sets) ==============================
   Same metric as tt_bestsellers mobile so both blocks line up:
     - __inner: padding 0
     - __head, __strip, __nav--bottom: padding 0 24px (= Figma left:24)
*/
@media (max-width: 768px) {
  .tt-sets {
    padding: 24px 0 24px;
  }

  .tt-sets__inner {
    padding: 0;
  }
  .tt-sets__head {
    margin-bottom: 24px;
    padding: 0 24px;
  }
  .tt-sets__title {
    font-size: 28px;
    font-weight: 800;
    line-height: 120%;
    color: #4A3426;
  }
  /* Hide top arrows + CTA on mobile (move to bottom nav) */
  .tt-sets__nav--top {
    display: none;
  }

  /* No fade on mobile — design uses bottom nav for indication */
  .tt-sets__strip {
    --fade-width: 0px;
    -webkit-mask-image: none;
            mask-image: none;
  }

  /* Strip: card-to-card gap 16, side padding 24, card width 320 */
  .tt-sets__strip {
    gap: 16px;
    padding: 0 24px 8px;
    scroll-padding: 0 24px;
  }
  .tt-sets__strip > .tt-set-card {
    flex: 0 0 320px;
    width: 320px;
    min-height: 586px;
  }

  /* Card photo height tightens slightly to fit overall card 586 */
  .tt-set-card__media {
    height: 270px;
  }

  /* Bottom nav: CTA on left, prev/next arrows on right (per Figma + user screenshot) */
  .tt-sets__nav--bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 0;
    gap: 16px;
  }
  .tt-sets__nav-arrows {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  /* Mobile spec per Figma: button 48×48 (smaller than desktop 56×56), arrow 32×32 */
  .tt-sets__nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }
  /* "Всі набори" CTA on mobile: 48 height to align with arrow buttons (Figma layout_R3X6OJ) */
  .tt-sets__view-all {
    height: 48px;
    padding: 8px 24px;
  }
}

/* Very narrow phones (<360) — keep peek visible */
@media (max-width: 359px) {
  .tt-sets__strip > .tt-set-card {
    flex: 0 0 280px;
    width: 280px;
  }
}
