/**
 * Архів категорії товару (product_cat) — секції поверх спільної catalog.css.
 * Один універсальний вигляд для будь-якої категорії (дані з ACF/терміна).
 *
 * @package vizitka-child
 */

/* =========================================================================
   SURFACE OWNERSHIP / CASCADE CONTRACT
   =========================================================================
   The homepage also has a component historically named `.pp-templates`, and
   the shared calculator uses `.pp-calc`. Category presentation must never
   inherit layout-containment/card-shell properties from those surfaces.

   Homepage selectors are now scoped under `.pp-kt` in piuroprint.css. These
   defensive resets make the product-category contract explicit as well, so a
   future global component change cannot turn this full-width section back into
   a bordered flex card or alter the quote grid through inherited flex layout.
   ========================================================================= */
body.tax-product_cat .pp-templates {
	display: block;
	width: 100%;
	max-width: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	container-type: normal;
	container-name: none;
}
body.tax-product_cat .pp-quick-quote .pp-calc {
	align-items: stretch;
	flex-wrap: nowrap;
}

/* =========================================================================
   HERO — темний, універсальний для зображення праворуч або на весь фон
   ========================================================================= */
.pp-cat-hero--category {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	min-height: 440px;
	padding: 18px 0 82px;
	color: #fff;
	background:
		radial-gradient(circle at 78% 18%, rgba(249, 115, 22, .12), transparent 32%),
		linear-gradient(135deg, #0b111c, #151b26 64%, #0b1018);
}
.pp-cat-hero--category::after {
	content: "";
	position: absolute;
	z-index: 0;
	right: -210px;
	bottom: -360px;
	width: 660px;
	height: 660px;
	border: 1px solid rgba(249, 115, 22, .13);
	border-radius: 50%;
}
.pp-cat-hero--category > .pp-wrap { position: relative; z-index: 3; }
.pp-cat-hero--category .pp-cat-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
	align-items: center;
	gap: clamp(30px, 4vw, 58px);
	min-height: 330px;
	padding-block: 26px 20px;
}
.pp-cat-hero--category .pp-cat-hero__copy { position: relative; z-index: 2; max-width: 720px; padding-top: 28px; }
.pp-cat-hero--category .pp-cat-hero__title { max-width: 690px; color: #fff; font-size: clamp(34px, 3.2vw, 48px); line-height: 1.12; text-transform: uppercase; }
.pp-cat-hero--category .pp-cat-hero__title > span,
.pp-cat-hero--category .pp-cat-hero__title > em { display: block; }
.pp-cat-hero--category .pp-cat-hero__title > em { margin-top: 4px; color: var(--ppc-orange); }
.pp-cat-hero--category .pp-cat-hero__lead { max-width: 650px; margin: 16px 0 0; color: #d3dae5; font-size: var(--pp-fs-lg, 15px); line-height: 1.6; }
.pp-cat-hero__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px 22px; margin-top: 30px; }
.pp-cat-hero__fact { display: flex; min-width: 0; align-items: center; gap: 11px; }
.pp-cat-hero__fact-icon { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; color: var(--ppc-orange); border: 1px solid rgba(249, 115, 22, .72); border-radius: 12px; }
.pp-cat-hero__fact-icon svg { width: 23px; height: 23px; }
.pp-cat-hero__fact > span:last-child { min-width: 0; }
.pp-cat-hero__fact strong,
.pp-cat-hero__fact small { display: block; }
.pp-cat-hero__fact strong { color: #fff; font-size: var(--pp-fs-sm, 13px); line-height: 1.3; }
.pp-cat-hero__fact small { margin-top: 3px; color: #c6ced9; font-size: var(--pp-fs-xs, 12px); line-height: 1.35; }

/* Фонове зображення завжди обмежене висотою hero: absolute + overflow:hidden. */
.pp-cat-hero__backdrop,
.pp-cat-hero__overlay { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.pp-cat-hero__backdrop img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: var(--pp-cat-image-fit, cover);
	object-position: var(--pp-cat-image-x, right) var(--pp-cat-image-y, center);
}
.pp-cat-hero__overlay {
	z-index: 1;
	background: linear-gradient(90deg, rgba(8, 12, 19, .98) 0%, rgba(8, 12, 19, .86) 42%, rgba(8, 12, 19, var(--pp-cat-overlay, .55)) 100%);
}
.pp-cat-hero--image-background::after { z-index: 2; }
.pp-cat-hero--image-background .pp-cat-hero__grid { grid-template-columns: minmax(0, 760px); }

/* Медіа hero */
.pp-cat-hero__media {
	position: relative;
	min-width: 0;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}
.pp-cat-hero__photo {
	position: absolute;
	inset: 0;
	overflow: hidden;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, .035);
	border: 1px solid rgba(255, 255, 255, .08);
	border-radius: var(--ppc-radius-xl);
	box-shadow: 0 28px 60px rgba(0, 0, 0, .3);
}
.pp-cat-hero__photo img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: var(--pp-cat-image-fit, cover);
	object-position: var(--pp-cat-image-x, right) var(--pp-cat-image-y, center);
	padding: 0;
}
.pp-cat-hero__photo--placeholder { display: grid; place-items: center; background: linear-gradient(150deg, #fde68a, #f97316); }
.pp-cat-hero__ph-mark { color: #fff; font-size: var(--pp-fs-12xl, 64px); font-weight: 800; letter-spacing: -.04em; text-transform: uppercase; opacity: .9; }
.pp-cat-hero__dot { position: absolute; border-radius: 50%; }
.pp-cat-hero__dot--one { width: 90px; height: 90px; right: -20px; top: -20px; background: rgba(249, 115, 22, .18); }
.pp-cat-hero__dot--two { width: 60px; height: 60px; left: -18px; bottom: -14px; background: rgba(59, 130, 246, .16); }

/* =========================================================================
   Швидка конфігурація
   ========================================================================= */
.pp-quick-quote { position: relative; z-index: 6; padding: 1px 0 12px; background: var(--ppc-bg); }
.pp-quick-quote > .pp-wrap { display: flow-root; }
.pp-quick-quote .pp-calc {
	display: grid;
	grid-template-columns: minmax(210px, 1.3fr) minmax(130px, .7fr) minmax(170px, .9fr) minmax(190px, .75fr);
	grid-template-areas:
		"label label label summary"
		"product qty terms summary";
	gap: 12px 16px;
	margin-top: -88px;
	padding: 18px 20px;
	border: 1px solid var(--ppc-border);
	border-radius: var(--ppc-radius-xl);
	box-shadow: 0 24px 55px rgba(15, 23, 42, .16);
}
.pp-quick-quote .pp-calc__label { grid-area: label; max-width: none; }
.pp-quick-quote .pp-calc__label strong { color: var(--ppc-dark); }
.pp-quick-quote .pp-calc__step { min-width: 0; align-items: stretch; }
.pp-quick-quote .pp-calc__step--product { grid-area: product; }
.pp-quick-quote .pp-calc__step--qty { grid-area: qty; }
.pp-quick-quote .pp-calc__step--terms { grid-area: terms; }
.pp-quick-quote .pp-calc__step > div:not(.pp-calc__step-num) { min-width: 0; width: 100%; }
.pp-quick-quote .pp-calc__select { width: 100%; min-width: 0; max-width: none; height: 44px; }
.pp-quick-quote .pp-calc__summary { grid-area: summary; display: flex; min-width: 0; padding: 12px; flex-direction: column; justify-content: space-between; gap: 12px; background: #f8fafc; border: 1px solid var(--ppc-border); border-radius: 12px; }
.pp-quick-quote .pp-calc__result { min-width: 0; margin: 0; }
.pp-quick-quote .pp-calc__price { font-size: clamp(24px, 2.2vw, 34px); }
.pp-quick-quote .pp-calc__cta { width: 100%; min-width: 0; margin: 0; padding-inline: 16px; }

/* =========================================================================
   Переваги (trust-strip)
   ========================================================================= */
.pp-benefits { padding: 26px 0 40px; background: #fff; }
.pp-benefits__title { margin: 0 0 16px; color: var(--ppc-dark); font-size: clamp(20px, 2vw, 26px); font-weight: 800; text-align: center; text-transform: uppercase; }
.pp-benefits__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.pp-benefit { display: flex; min-width: 0; align-items: flex-start; gap: 12px; padding: 16px 13px; background: #fff; border: 1px solid var(--ppc-border); border-radius: var(--ppc-radius-lg); }
.pp-benefit__icon { display: grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; color: var(--ppc-orange); background: var(--pp-orange-light, #fff7ed); border-radius: 12px; }
.pp-benefit__icon svg { width: 22px; height: 22px; }
.pp-benefit p { min-width: 0; margin: 0; }
.pp-benefit strong { display: block; font-size: var(--pp-fs-md, 14px); line-height: 1.3; }
.pp-benefit small { display: block; margin-top: 4px; color: var(--ppc-muted); font-size: var(--pp-fs-xs, 12px); line-height: 1.4; }

/* =========================================================================
   Популярні шаблони (реальні)
   ========================================================================= */
.pp-templates { padding: 60px 0; background: var(--ppc-dark); color: #fff; }
.pp-templates__intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.pp-templates__intro h2 { margin: 0; font-size: clamp(24px, 2.4vw, 32px); }
.pp-templates__intro .pp-section-label { color: #fb923c; }
.pp-templates__intro p:not(.pp-section-label) { margin: 9px 0 0; color: #94a3b8; font-size: var(--pp-fs-lg, 15px); max-width: 560px; }
.pp-templates__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pp-template-card { display: flex; flex-direction: column; overflow: hidden; background: #1c2336; border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--ppc-radius-lg); text-decoration: none; color: #fff; transition: transform .2s, border-color .2s; }
.pp-template-card:hover { transform: translateY(-4px); border-color: rgba(249, 115, 22, .5); }
.pp-template-card__art { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: #0f172a; overflow: hidden; padding: 10px; box-sizing: border-box; }
.pp-template-card__art img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.pp-template-card__ph { color: rgba(255, 255, 255, .25); }
.pp-template-card__ph svg { width: 40px; height: 40px; }
.pp-template-card__body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pp-template-card__body h3 { margin: 0; font-size: var(--pp-fs-lg, 15px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Товар + формат під назвою шаблону: у категорії лежать товари різної геометрії,
   тож саме розмір каже, під що шаблон. Однаково з галереєю (gallery.css). */
.pp-template-card__product { margin: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
	color: var(--pp-text-muted); font-size: var(--pp-fs-sm, 13px); line-height: 1.3; }
.pp-template-card__product-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-weight: 600; }
.pp-template-card__size { flex-shrink: 0; font-size: var(--pp-fs-2xs, 11px); font-weight: 700; color: var(--pp-text-light);
	background: var(--pp-bg); border-radius: 999px; padding: 1px 8px; letter-spacing: .02em; }
.pp-template-card__link { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; color: #fb923c; font-size: var(--pp-fs-sm, 13px); font-weight: 700; }
.pp-template-card__link svg { width: 16px; height: 16px; }
.pp-templates__cta-fallback { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 30px; background: #1c2336; border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--ppc-radius-lg); }
.pp-templates__cta-fallback p { margin: 0; color: #cbd5e1; font-size: var(--pp-fs-lg, 15px); max-width: 620px; }

/* =========================================================================
   Design CTA
   ========================================================================= */
.pp-design-cta { padding: 60px 0; background: var(--ppc-bg); }
.pp-design-cta__card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 28px; padding: 34px; background: #fff; border: 1px solid var(--ppc-border); border-radius: var(--ppc-radius-xl); box-shadow: var(--ppc-shadow); }
.pp-design-cta__icon { display: grid; place-items: center; width: 62px; height: 62px; color: var(--ppc-orange); background: var(--pp-orange-light, #fff7ed); border-radius: 16px; }
.pp-design-cta__icon svg { width: 30px; height: 30px; }
.pp-design-cta__copy h2 { margin: 4px 0 6px; font-size: clamp(21px, 2.1vw, 27px); }
.pp-design-cta__copy p:not(.pp-section-label) { margin: 0; color: var(--ppc-text-2); font-size: var(--pp-fs-lg, 15px); }
.pp-design-cta__actions { display: flex; flex-direction: column; gap: 10px; }

/* =========================================================================
   Матеріали
   ========================================================================= */
.pp-materials { padding: 60px 0; background: #fff; }
.pp-materials__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.pp-material { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--ppc-bg); border: 1px solid var(--ppc-border); border-radius: var(--ppc-radius-lg); }
.pp-material__swatch { width: 48px; height: 48px; border-radius: 12px; border: 1px solid rgba(0, 0, 0, .06); }
.pp-material__swatch--paper { background: #f5f0e6; }
.pp-material__swatch--gloss { background: linear-gradient(135deg, #e2e8f0, #cbd5e1); }
.pp-material__swatch--clear { background: repeating-linear-gradient(45deg, #e2e8f0 0 6px, #f8fafc 6px 12px); }
.pp-material__swatch--kraft { background: #cbb08a; }
.pp-material h3 { margin: 0 0 6px; font-size: var(--pp-fs-xl, 16px); }
.pp-material p { margin: 0; color: var(--ppc-text-2); font-size: var(--pp-fs-md, 14px); line-height: 1.6; }

/* =========================================================================
   FAQ
   ========================================================================= */
.pp-faq { padding: 60px 0; background: var(--ppc-bg); }
.pp-faq__layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 44px; align-items: start; }
.pp-faq__copy h2 { margin: 0 0 12px; font-size: clamp(24px, 2.4vw, 30px); }
.pp-faq__copy p { color: var(--ppc-text-2); font-size: var(--pp-fs-lg, 15px); }
.pp-faq__copy .pp-section-link { margin-top: 8px; }
.pp-faq__item { background: #fff; border: 1px solid var(--ppc-border); border-radius: var(--ppc-radius); margin-bottom: 12px; overflow: hidden; }
.pp-faq__q { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 18px 20px; background: none; border: 0; text-align: left; font-size: var(--pp-fs-xl, 16px); font-weight: 650; color: var(--ppc-dark); cursor: pointer; }
.pp-faq__q svg { width: 20px; height: 20px; flex: 0 0 auto; transition: transform .2s; }
.pp-faq__item.is-open .pp-faq__q svg { transform: rotate(180deg); }
.pp-faq__a { padding: 0 20px 18px; color: var(--ppc-text-2); font-size: var(--pp-fs-lg, 15px); line-height: 1.7; }
.pp-faq__a p { margin: 0 0 10px; }
.pp-faq__a p:last-child { margin-bottom: 0; }

/* =========================================================================
   SEO (category) + фінальний CTA
   ========================================================================= */
.pp-seo--category { padding: 56px 0; background: #fff; }
.pp-seo--category .pp-prose { max-width: 900px; margin-inline: auto; color: var(--ppc-text-2); font-size: var(--pp-fs-lg, 15px); line-height: 1.8; }
.pp-seo--category .pp-prose h2 { color: var(--ppc-dark); font-size: clamp(22px, 2.2vw, 28px); }

.pp-final-cta { padding: 0 0 70px; background: #fff; }
.pp-final-cta__card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 30px;
	padding: 40px;
	color: #fff;
	background: linear-gradient(135deg, #111827, #1c2336);
	border-radius: var(--ppc-radius-xl);
}
.pp-final-cta__copy h2 { margin: 4px 0 8px; font-size: clamp(22px, 2.3vw, 30px); }
.pp-final-cta__copy .pp-section-label { color: #fb923c; }
.pp-final-cta__copy p:not(.pp-section-label) { margin: 0; color: #94a3b8; font-size: var(--pp-fs-lg, 15px); }
.pp-final-cta__rating { display: flex; min-width: 160px; padding-left: 26px; flex-direction: column; border-left: 1px solid #334155; }
.pp-final-cta__rating strong { font-size: var(--pp-fs-4xl, 22px); line-height: 1; }
.pp-final-cta__rating span { margin-top: 5px; color: #f59e0b; letter-spacing: 2px; }
.pp-final-cta__rating small { margin-top: 4px; color: #94a3b8; font-size: var(--pp-fs-2xs, 11px); }

/* =========================================================================
   Адаптив
   ========================================================================= */
@media (max-width: 1180px) {
	.pp-benefits__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.pp-materials__grid { grid-template-columns: repeat(2, 1fr); }
	.pp-templates__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.pp-quick-quote .pp-calc {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-template-areas:
			"label label label"
			"product qty terms"
			"summary summary summary";
		gap: 14px;
	}
	.pp-quick-quote .pp-calc__summary { flex-direction: row; align-items: center; }
	.pp-quick-quote .pp-calc__cta { width: auto; min-width: 180px; }
}

@media (max-width: 900px) {
	.pp-cat-hero--category { min-height: 0; padding-bottom: 72px; }
	.pp-cat-hero--category .pp-cat-hero__grid { grid-template-columns: 1fr; gap: 26px; }
	.pp-cat-hero__facts { width: 100%; max-width: 700px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
	.pp-cat-hero__media { width: min(100%, 620px); height: auto; margin-inline: auto; aspect-ratio: 4 / 3; }
	.pp-cat-hero--image-background .pp-cat-hero__grid { grid-template-columns: minmax(0, 680px); }
	.pp-design-cta__card { grid-template-columns: 1fr; text-align: center; }
	.pp-design-cta__icon { margin-inline: auto; }
	.pp-design-cta__actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
	.pp-faq__layout { grid-template-columns: 1fr; gap: 24px; }
	.pp-templates__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pp-templates__intro { flex-direction: column; align-items: flex-start; gap: 12px; }
	.pp-final-cta__card { grid-template-columns: minmax(0, 1fr) auto; }
	.pp-final-cta__rating { grid-column: 1 / -1; padding: 18px 0 0; border-top: 1px solid #334155; border-left: 0; }
}

@media (max-width: 620px) {
	.pp-cat-hero--category { padding: 12px 0 62px; }
	.pp-cat-hero--category .pp-cat-hero__grid { min-height: 0; padding-block: 22px 12px; }
	.pp-cat-hero--category .pp-cat-hero__title { font-size: clamp(32px, 10vw, 44px); }
	.pp-cat-hero__facts { grid-template-columns: 1fr; gap: 12px; margin-top: 24px; }
	.pp-cat-hero__fact-icon { width: 38px; height: 38px; }
	.pp-cat-hero__media { width: 100%; height: auto; aspect-ratio: 4 / 3; }
	.pp-quick-quote .pp-calc {
		grid-template-columns: 1fr;
		grid-template-areas: "label" "product" "qty" "terms" "summary";
		margin-top: -42px;
		gap: 13px;
		padding: 17px;
	}
	.pp-quick-quote .pp-calc__step { width: 100%; min-width: 0; }
	.pp-quick-quote .pp-calc__select { max-width: none; }
	.pp-quick-quote .pp-calc__summary { flex-direction: column; align-items: stretch; }
	.pp-quick-quote .pp-calc__result { display: flex; width: 100%; align-items: baseline; gap: 10px; }
	.pp-quick-quote .pp-calc__cta { width: 100%; min-width: 0; }
	.pp-materials__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.pp-material { padding: 16px; }
	.pp-benefits__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.pp-benefit:nth-child(n + 5) { display: none; }
	.pp-benefit { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
	.pp-final-cta__card { grid-template-columns: 1fr; text-align: center; padding: 30px 22px; }
	.pp-final-cta__card .pp-btn-primary { justify-content: center; }
	.pp-final-cta__rating { align-items: center; }
}

@media (max-width: 400px) {
	.pp-templates__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.pp-template-card,
	.pp-faq__q svg { transition: none; }
}
