/* ===== TripTea — Product page (desktop) ==================================
   Figma nodes:
     541:9150 (Product page root, 1920-Main)
     541:9152 (top card: gallery + body)
     541:9202 (brewing-method block)
     705:29444 (related products carousel)

   Desktop-only: mobile layout will be added in a separate pass once Figma
   delivers the 390-main variant.
*/

/* Stock product.twig used to live inside Bootstrap's #content wrapper which
   capped width to col-sm-12 (~1140). Our new layout is full-bleed white card +
   coloured section bands, so we neutralise that ancestor here. */
#content:has(.tt-product) {
	width: 100% !important;
	max-width: none !important;
	padding: 0 !important;
}

/* ===== Section bands (full-bleed background) ============================= */

.tt-product,
.tt-brewing {
	font-family: 'DM Sans', sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-feature-settings: "case", "cpsp";
	color: #2B2B2B;
}

.tt-product--breakout,
.tt-brewing--breakout {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	left: 50%;
	transform: translateX(-50%);
	box-sizing: border-box;
}

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

/* ===== Top product card (Figma 541:9152) ================================= */

.tt-product {
	background: #FFFFFF;
	border-top: 1px solid #EAEAEA;
}

/* Outer wrapper carries the asymmetric Figma padding (left 192 / right 305).
   Breadcrumbs sit above the main flex row, both aligned to this padded box. */
.tt-product__inner {
	padding: 64px 305px 103px 192px;
	display: flex;
	flex-direction: column;
	gap: 24px;
	max-width: 1920px;
	margin: 0 auto;
}

/* Breadcrumbs — DM Sans 14/150, Tea Brown crumb links, Medium Gray current item.
   Separator is a 4×4 SVG circle filled with Warm Sand (Figma assets/sep). */
.tt-product__crumbs {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 8px;
	/* Pin the row to body width — parent uses align-items: flex-start so
	   nav otherwise grows to content width and the ellipsis never engages. */
	width: 100%;
	min-width: 0;
	font-family: 'DM Sans', sans-serif;
	font-weight: 400;
	font-size: 14px;
	line-height: 150%;
}
.tt-product__crumb {
	flex: 0 0 auto;
	color: #8B5E3C;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease;
}
.tt-product__crumb:hover { color: #4A3426; text-decoration: underline; }
/* Last crumb (the product name) takes remaining space and truncates with "…"
   when the row would otherwise wrap. Full name is still visible in the H1 below. */
.tt-product__crumb:last-of-type {
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #6B6B6B;
	pointer-events: none;
	text-decoration: none;
}
.tt-product__crumb-sep {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4px;
	height: 4px;
}

/* Top row — gallery on left, body on right. Figma column gap = 83px. */
.tt-product__top {
	display: flex;
	gap: 83px;
	align-items: flex-start;
	align-self: stretch;
}

/* ===== Gallery (4 thumbs vertical + main image) ========================== */

.tt-product__gallery {
	display: flex;
	gap: 24px; /* Figma: column of thumbs + main image. Thumbs internal gap = 16. */
	flex: 0 0 auto;
}

.tt-product__thumbs {
	display: flex;
	flex-direction: column;
	gap: 16px;
	flex: 0 0 120px;
	width: 120px;
}

/* Figma: 120×120, 1.5px Dark Tea border on every thumb, 8px radius.
   Active state currently differentiated only by the border thickness — there's
   no separate hover/active style in Figma yet. Keep a subtle hover for affordance. */
.tt-product__thumb {
	appearance: none;
	-webkit-appearance: none;
	border: 1.5px solid #4A3426;
	padding: 0;
	margin: 0;
	background: #D9D9D9;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	width: 120px;
	height: 120px;
	display: block;
	transition: opacity 0.15s ease;
}
.tt-product__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.tt-product__thumb:hover { opacity: 0.85; }
.tt-product__thumb--active { opacity: 1; }

.tt-product__main-img {
	width: 553px;
	height: 555px;
	border-radius: 8px;
	overflow: hidden;
	background: #D9D9D9;
	flex: 0 0 auto;
}
.tt-product__main-img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ===== Body (info column) ================================================ */

/* Figma body column: fixed width 643. Per-element gaps differ (21 / 21 / 15 / 25 /
   24 / 32 / 32), so we drop the parent `gap` and set explicit margin-bottoms on
   each direct child below instead of a single uniform value. */
.tt-product__body {
	flex: 0 0 643px;
	width: 643px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}
.tt-product__body > * { margin-bottom: 0; }
.tt-product__crumbs        { margin-bottom: 21px; }
.tt-product__title         { margin-bottom: 21px; }
.tt-product__rating        { margin-bottom: 15px; }
.tt-product__meta          { margin-bottom: 25px; }
.tt-product__description   { margin-bottom: 24px; }
.tt-product__gramming-row  { margin-bottom: 32px; }
.tt-product__price-row     { margin-bottom: 32px; }
.tt-product__cart-row      { margin-bottom: 0; }

/* Title — Tea Brown H2 (DM Sans ExtraBold 36 / 120). margin-bottom is set in
   the body-spacing block above so we don't reset it here. */
.tt-product__title {
	margin-top: 0;
	margin-left: 0;
	margin-right: 0;
	font-weight: 800;
	font-size: 36px;
	line-height: 120%;
	color: #8B5E3C;
}

.tt-product__rating {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}
.tt-product__star { display: block; }

/* Meta row: Артикул label+value + tick-circle + В наявності. DM Sans 12/140.
   Figma: 34px between the SKU group and the stock badge, 8px inside the badge
   between icon and text, baseline-centred so the SVG aligns with the cap height. */
.tt-product__meta {
	display: flex;
	align-items: center;
	gap: 34px;
	font-family: 'DM Sans', sans-serif;
	font-weight: 400;
	font-size: 12px;
	line-height: 140%;
}
.tt-product__sku-label { color: #6B6B6B; }
.tt-product__sku-value { color: #2B2B2B; }

.tt-product__stock {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #4A3426;
	line-height: 1; /* drop the 140% line-box so icon + text sit on the same baseline */
}
.tt-product__stock svg { color: #8B5E3C; display: block; flex: 0 0 16px; }
/* Pre-order state — text + alarm-clock icon both Medium Gray. Override the
   default svg color above so it matches the parent. */
.tt-product__stock--pre_order { color: #6B6B6B; }
.tt-product__stock--pre_order svg { color: #6B6B6B; }
.tt-product__stock--out_of_stock { color: #C62828; }
.tt-product__stock--out_of_stock svg { color: #C62828; }

/* Description — DM Sans 14/150 Medium Gray. */
.tt-product__description {
	font-weight: 400;
	font-size: 14px;
	line-height: 150%;
	color: #6B6B6B;
	margin-top: 0;
	margin-left: 0;
	margin-right: 0;
	align-self: stretch;
}
.tt-product__description p { margin: 0 0 8px; }
.tt-product__description p:last-child { margin-bottom: 0; }

/* Gramming: label ON TOP, chip list BELOW (column, gap 16). Figma. */
.tt-product__gramming-row {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	align-self: stretch;
}
.tt-product__gramming-label {
	font-family: 'DM Sans', sans-serif;
	font-weight: 700;
	font-size: 16px;
	line-height: 140%;
	color: #4A3426;
}

/* Chip list — 72×48, padding 8 12, radius 8. Active = solid Tea Brown bg + white text.
   Inactive = white bg + 1px Light Gray border + Medium Gray text. Both DM Sans 18 Bold. */
.tt-product__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 15px; /* Figma: 15 between adjacent chips. */
	margin: 0;
	padding: 0;
	list-style: none;
}
.tt-product__chip {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 72px;
	height: 48px;
	padding: 8px 12px;
	border-radius: 8px;
	border: 1px solid #EAEAEA;
	background: #FFFFFF;
	color: #6B6B6B;
	font-family: 'DM Sans', sans-serif;
	font-weight: 700;
	font-size: 18px;
	line-height: 130%;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
	user-select: none;
}
.tt-product__chip:hover { border-color: #8B5E3C; color: #8B5E3C; }
.tt-product__chip--active {
	background: #8B5E3C;
	border-color: #8B5E3C;
	color: #FFFFFF;
}
.tt-product__chip--active:hover { color: #FFFFFF; }

/* Headline price — Dark Text H2 (DM Sans ExtraBold 36 / 120). margin-bottom
   is set in the body-spacing block; don't reset it here. */
.tt-product__price-row {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 0;
	margin-left: 0;
	margin-right: 0;
}
/* "Was-price" — rendered only when the product has an active special and no
   gramming. Same brown line-through pattern as the tt_sets cards on home. */
.tt-product__old-price {
	font-family: 'DM Sans', sans-serif;
	font-weight: 400;
	font-size: 18px;
	line-height: 150%;
	color: #8B5E3C;
	text-decoration: line-through;
}
.tt-product__price {
	font-family: 'DM Sans', sans-serif;
	font-weight: 800;
	font-size: 36px;
	line-height: 120%;
	color: #2B2B2B;
}

/* Cart row: counter | add-to-cart | wishlist. Add-to-cart takes remaining width. */
.tt-product__cart-row {
	display: flex;
	align-items: center;
	gap: 16px;
	align-self: stretch;
}

/* Counter: 140×48, 1px Light Gray border, 8 radius. */
.tt-product__counter {
	display: flex;
	width: 140px;
	height: 48px;
	padding: 8px 12px;
	justify-content: center;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	border-radius: 8px;
	border: 1px solid #EAEAEA;
	background: #FFFFFF;
}
.tt-product__counter-btn {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	padding: 0;
	margin: 0;
	width: 24px;
	height: 24px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #4A3426;
	cursor: pointer;
	transition: color 0.15s ease;
}
.tt-product__counter-btn:hover { color: #8B5E3C; }
.tt-product__counter-input {
	flex: 1 0 0;
	min-width: 0;
	height: 32px;
	border: 0;
	padding: 0;
	text-align: center;
	font-family: 'DM Sans', sans-serif;
	font-weight: 500;
	font-size: 16px;
	line-height: 150%;
	color: #4A3426;
	background: transparent;
	outline: none;
}

/* Add-to-cart — 48 tall, flex:1 0 0, Tea Brown bg, white text. Hover #6F472B. */
.tt-product__add-to-cart {
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	height: 48px;
	padding: 8px 12px;
	justify-content: center;
	align-items: center;
	gap: 8px;
	flex: 1 0 0;
	border: 0;
	border-radius: 8px;
	background: #8B5E3C;
	color: #FFFFFF;
	font-family: 'DM Sans', sans-serif;
	font-weight: 700;
	font-size: 18px;
	line-height: 130%;
	cursor: pointer;
	transition: background 0.15s ease;
}
.tt-product__add-to-cart:hover { background: #6F472B; }
.tt-product__add-to-cart svg {
	width: 24px;
	height: 24px;
	flex: 0 0 24px;
}
/* Disabled state — pre-order or out-of-stock. Mirrors tt_bestsellers card:
   light-gray bg, white icon+text, not-allowed cursor, hover is a no-op. */
.tt-product__add-to-cart:disabled {
	background: #EAEAEA;
	color: #FFFFFF;
	cursor: not-allowed;
}
.tt-product__add-to-cart:disabled:hover { background: #EAEAEA; }

/* Wishlist heart — 48×48 button with 1px Light Gray border, gray heart inside. */
.tt-product__wishlist {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid #EAEAEA;
	border-radius: 8px;
	background: #FFFFFF;
	color: #6B6B6B;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
	flex-shrink: 0;
}
.tt-product__wishlist:hover { color: #8B5E3C; border-color: #8B5E3C; }
.tt-product__wishlist--active { color: #8B5E3C; }
.tt-product__wishlist--active svg path { fill: #8B5E3C; }

/* ===== Brewing method block (Figma 541:9202) ============================== */

.tt-brewing {
	position: relative;
	background: #FAF7F2; /* Secondary Colors/Soft Cream */
	min-height: 628px;
	padding: 64px 192px;
	box-sizing: border-box;
	overflow: hidden; /* clip the dragon watermark that bleeds past the right edge */
}

/* Decorative dragon watermark — same asset the home-page "Корисні статті"
   block uses (image/articles/dragon-watermark.png). Anchored to the right
   edge with a small negative top offset so it peeks above the section and
   sinks just below the tips block, like the Figma frame. Pointer-events
   disabled so it never traps clicks aimed at cards behind it. */
.tt-brewing::before {
	content: "";
	position: absolute;
	/* Figma Inspect: x=1039, y=-126 inside the 1920-wide section frame. Anchor
	   by right edge (1920 − 1039 − 881 = 0) so the dragon stays glued to the
	   right side at any viewport ≥ 1920; narrower viewports just clip more of
	   it via overflow:hidden on the section. */
	top: -126px;
	right: 0;
	width: 881px;
	height: 940px;
	background-image: url('../image/articles/dragon-watermark.png');
	background-size: cover;
	background-repeat: no-repeat;
	background-position: 50% 50%;
	pointer-events: none;
	z-index: 0;
	/* Figma: layer opacity 100% but the image fill itself is set to 5% — same
	   net effect as opacity 0.05 here. Blend mode is Normal. */
	opacity: 0.05;
}

/* Content sits above the watermark via positive z-index. Width hugs naturally
   since the section padding (192 each side) already crops to 1536 at 1920vw. */
.tt-brewing__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

/* Title — H2 DM Sans ExtraBold 36 / 120 / Dark Tea. 47px gap to the cards grid. */
.tt-brewing__title {
	margin: 0 0 47px;
	font-family: 'DM Sans', sans-serif;
	font-weight: 800;
	font-size: 36px;
	line-height: 120%;
	color: #4A3426;
}

/* Card row — exactly 4 equal columns. Figma spec says 366px per card but at any
   viewport less than 1920 a hardcoded 366 forces the 4th card to wrap. Grid
   with 1fr columns + 24 gap = 366px each at 1920 (math: (1536 − 3×24) ÷ 4)
   and gracefully shrinks at narrower desktop widths. */
.tt-brewing__cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	margin-bottom: 24px;
}

/* Card — width comes from the grid track; padding 24/16, 1px Warm Sand border,
   radius 16. Centred content via flex column. */
.tt-brewing__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 24px 16px;
	background: #FFFFFF;
	border-radius: 16px;
	border: 1px solid #E7D7C8;
	text-align: center;
}

/* Icon box — 48×48, Light Beige bg, 8 radius. Padding 12 (slight asymmetric
   in Figma — 12 13 12 12 — too small to perceive, normalised to 12). */
.tt-brewing__card-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 12px;
	background: #F5EFE7;
	border-radius: 8px;
}
.tt-brewing__card-icon svg {
	width: 24px;
	height: 24px;
	display: block;
}

/* Label — Body Large DM Sans 18 / 150 / Dark Tea, centred. */
.tt-brewing__card-label {
	font-family: 'DM Sans', sans-serif;
	font-weight: 400;
	font-size: 18px;
	line-height: 150%;
	color: #4A3426;
	text-align: center;
}
/* Value — H4 DM Sans Bold 22 / 130 / Dark Tea, centred. */
.tt-brewing__card-value {
	font-family: 'DM Sans', sans-serif;
	font-weight: 700;
	font-size: 22px;
	line-height: 130%;
	color: #4A3426;
	text-align: center;
}
/* Subtitle — Small Text DM Sans 14 / 150 / Medium Gray, centred. */
.tt-brewing__card-subtitle {
	font-family: 'DM Sans', sans-serif;
	font-weight: 400;
	font-size: 14px;
	line-height: 150%;
	color: #6B6B6B;
	text-align: center;
}

/* Tips block — full-width pill, Light Beige bg, 24px padding (right side flush
   with content edge per Figma's asymmetric 24/0/24/24 padding). */
.tt-brewing__tips {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 24px 24px 24px 24px;
	background: #F5EFE7;
	border-radius: 16px;
}
/* Title — H4 DM Sans Bold 22 / 130 / Dark Tea. 16px gap to the list below. */
.tt-brewing__tips-title {
	margin: 0 0 16px;
	font-family: 'DM Sans', sans-serif;
	font-weight: 700;
	font-size: 22px;
	line-height: 130%;
	color: #4A3426;
}
.tt-brewing__tips-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	/* No extra gap — Figma relies on the 150% line-height (24px) for spacing
	   between consecutive bullets. */
}
/* Tip text — Body Regular DM Sans 16 / 150 / Dark Text. Bullet is rendered by
   CSS pseudo (admin only types the line, no leading "•" needed). */
.tt-brewing__tips-list li {
	font-family: 'DM Sans', sans-serif;
	font-weight: 400;
	font-size: 16px;
	line-height: 150%;
	color: #2B2B2B;
	padding-left: 16px;
	position: relative;
}
.tt-brewing__tips-list li::before {
	content: "•";
	position: absolute;
	left: 0;
	color: #2B2B2B;
}

/* ===== Related products (Figma 705:29444) ================================
   Custom section wrapper to match the Figma block (1920×807, asymmetric
   padding 48 top / 192 sides / 79 bottom, title→arrows gap 656 px). Cards
   inside re-use the .tt-product-card markup so internal layout/hover come
   from bestsellers_block.css — only the wrapper, header, and slider are local. */

.tt-related {
	background: #FFFFFF;
	font-family: 'DM Sans', sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-feature-settings: "case", "cpsp";
	color: #2B2B2B;
	box-sizing: border-box;
}
.tt-related *, .tt-related *::before, .tt-related *::after { box-sizing: border-box; }
.tt-related--breakout {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	left: 50%;
	transform: translateX(-50%);
}

/* Inner width = min(1536, viewport − 32). At 1920 with a vertical scrollbar the
   "100vw" outer breakout is 1920 but only ~1903 is visible — using `100%` (which
   IS the visible width) avoids the 4th card clipping that fixed `padding:48 192`
   would cause. Vertical padding stays per Figma spec. */
.tt-related__inner {
	width: min(1536px, 100% - 32px);
	margin: 0 auto;
	padding: 48px 0 79px;
}

/* Header — title left, nav right. justify-content: space-between adapts the
   656 px gap naturally across viewport widths instead of hard-coding it. */
.tt-related__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 656px;
	margin-bottom: 48px;
}
.tt-related__title {
	margin: 0;
	font-family: 'DM Sans', sans-serif;
	font-weight: 800;
	font-size: 36px;
	line-height: 120%;
	color: #4A3426;
}

/* Nav buttons — IDENTICAL to .tt-bestsellers__nav-btn (56×56, radius 16, 1px Dark
   Tea border, transparent bg). Inactive variant identical too (opacity 0.5 +
   pointer-events: none). Hover lightens the bg to Soft Cream. */
.tt-related__nav {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	flex-shrink: 0;
}
.tt-related__nav-btn {
	appearance: none;
	-webkit-appearance: none;
	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, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.tt-related__nav-btn:hover { background: #FAF7F2; }
.tt-related__nav-btn svg { width: 32px; height: 32px; }
.tt-related__nav-btn--disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* Carousel viewport hides overflow; strip scrolls horizontally with native momentum.
   The 24 px gap matches Figma; scrollbar hidden so the arrows are the only affordance. */
.tt-related__viewport { overflow: hidden; }
.tt-related__strip {
	display: flex;
	gap: 24px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.tt-related__strip::-webkit-scrollbar { display: none; }
.tt-related__strip > .tt-product-card {
	flex: 0 0 366px;
	scroll-snap-align: start;
}

/* "Was-price" inside related cards. Only emitted for products without
   gramming and with an active special (controller decides). Scoped under
   .tt-related so it doesn't leak into the homepage bestsellers carousel,
   which shares .tt-product-card__* classes but keeps the single-price layout. */
.tt-related .tt-product-card__prices {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.tt-related .tt-product-card__old-price {
	font-family: 'DM Sans', sans-serif;
	font-weight: 400;
	font-size: 14px;
	line-height: 150%;
	color: #8B5E3C;
	text-decoration: line-through;
}
