/**
 * pdp.css — Agora PDP (single product page).
 *
 * Scoped under .gp-pdp-template (body class set in woocommerce/single-product.php).
 * Layout: breadcrumb → hero (gallery + buy box) → info (desc + spec tabs) → related.
 * The related grid reuses the PLP product card, so plp.css is also enqueued on
 * the PDP (see includes/enqueue.php).
 *
 * @package woodmart-child
 */

/* ─── WoodMart wrapper resets ──────────────────────────────────────────────── */
.gp-pdp-template .wd-page-content,
.gp-pdp-template .wd-content-layout {
	max-width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* ─── Breadcrumb ───────────────────────────────────────────────────────────── */
.gp-pdp-breadcrumb {
	padding-top: 20px;
}
.gp-pdp-breadcrumb .woocommerce-breadcrumb {
	font-family: var(--gp-sans);
	font-size: var(--gp-small);
	color: var(--gp-text-soft);
	margin: 0;
}
.gp-pdp-breadcrumb .woocommerce-breadcrumb a {
	color: var(--gp-text-soft);
	text-decoration: none;
}
.gp-pdp-breadcrumb .woocommerce-breadcrumb a:hover { color: var(--gp-sea); }

/* ─── Hero: gallery (left) + buy box (480px, right) ────────────────────────── */
.gp-pdp-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 480px;
	gap: 48px;
	padding-top: 32px;
	padding-bottom: 60px;
	align-items: start;
}

/* ─── Gallery: vertical thumbs (left) + square main ────────────────────────── */
.gp-pdp-gallery {
	display: flex;
	gap: 14px;
	align-items: flex-start;
}
.gp-pdp-gallery__thumbs {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 76px;
	flex: none;
}
.gp-pdp-gallery__thumb {
	width: 76px;
	height: 76px;
	padding: 0;
	background: var(--gp-surface);
	border: 2px solid var(--gp-line);
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	flex: none;
	transition: border-color .15s var(--gp-ease);
}
.gp-pdp-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.gp-pdp-gallery__thumb:hover { border-color: var(--gp-sea-soft); }
.gp-pdp-gallery__thumb.is-active { border-color: var(--gp-sea); }

.gp-pdp-gallery__main-wrap {
	position: relative;
	flex: 1;
	min-width: 0;
	background: var(--gp-surface);
	border: 1px solid var(--gp-line);
	border-radius: 4px;
	overflow: hidden;
	aspect-ratio: 1;
	margin: 0;
}
.gp-pdp-gallery__zoom {
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
}
.gp-pdp-gallery__main {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	transition: transform .3s var(--gp-ease);
}
.gp-pdp-gallery__zoom:hover .gp-pdp-gallery__main { transform: scale(1.04); }

.gp-pdp-gallery__zoom-hint {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid var(--gp-line);
	border-radius: 4px;
	color: var(--gp-ink-soft);
	pointer-events: none;
}
.gp-pdp-gallery__badges {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
	display: flex;
	gap: 6px;
}

/* ─── Meta (eyebrow + title) ───────────────────────────────────────────────── */
.gp-pdp-meta { margin-bottom: 22px; }

.gp-pdp-meta__cats {
	font-size: var(--gp-small);
	color: var(--gp-sea);
	margin: 0 0 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}
.gp-pdp-meta__cats::before { display: none; }

.gp-pdp-meta__title {
	font-family: var(--gp-serif);
	font-size: clamp(28px, 3.4vw, 40px);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -.02em;
	color: var(--gp-ink);
	margin: 0;
}

/* ─── Buy box ──────────────────────────────────────────────────────────────── */
.gp-pdp-atc {
	display: flex;
	flex-direction: column;
}

/* Swatches */
.gp-pdp-atc__opts {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 22px;
}
.gp-pdp-atc__opts-label {
	display: block;
	font-family: var(--gp-mono);
	font-size: 11px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--gp-ink-soft);
	margin-bottom: 8px;
}
.gp-pdp-atc__opts-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.gp-pdp-atc__opt {
	padding: 10px 18px;
	font-family: var(--gp-sans);
	font-size: 13px;
	color: var(--gp-ink);
	background: var(--gp-surface);
	border: 2px solid var(--gp-line);
	border-radius: 4px;
	cursor: pointer;
	transition: border-color .15s var(--gp-ease), background .15s var(--gp-ease), color .15s var(--gp-ease);
}
.gp-pdp-atc__opt:hover { border-color: var(--gp-sea-soft); }
.gp-pdp-atc__opt.is-active {
	background: var(--gp-sea);
	border-color: var(--gp-sea);
	color: #fff;
	font-weight: 600;
}
.gp-pdp-atc__opt.is-oos {
	opacity: .45;
	text-decoration: line-through;
}

/* Price + discount */
.gp-pdp-atc__price-row {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 8px;
}
.gp-pdp-atc__price {
	font-family: var(--gp-serif);
	font-size: 40px;
	font-weight: 400;
	line-height: 1;
	color: var(--gp-ink);
}
/* WoodMart's `.amount { color: var(--wd-primary-color); font-weight: 600 }`
   targets the amount span directly, so a colour set only on the wrapper doesn't
   reach it. Override colour + weight on the amount itself. */
.gp-pdp-atc__price .woocommerce-Price-amount,
.gp-pdp-atc__price .price .amount {
	font-size: inherit;
	font-weight: inherit;
	color: var(--gp-ink);
}
.gp-pdp-atc__price del {
	font-size: 20px;
	font-weight: 400;
	color: #9a9080;
	margin-right: 10px;
	text-decoration: line-through;
}
.gp-pdp-atc__price ins {
	text-decoration: none;
	color: var(--gp-sea-deep);
}
.gp-pdp-atc__price .price { color: inherit; }
.gp-pdp-atc__discount {
	font-family: var(--gp-mono);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	color: #fff;
	background: #e8453c;
	padding: 3px 9px;
	border-radius: 2px;
	align-self: center;
}
.gp-pdp-atc__discount.is-hidden { display: none; }

/* SKU */
.gp-pdp-atc__sku {
	font-family: var(--gp-mono);
	font-size: 12px;
	color: var(--gp-text-soft);
	margin: 0 0 20px;
	display: flex;
	gap: 6px;
}
.gp-pdp-atc__sku-label { font-weight: 500; }

/* Qty + stock */
.gp-pdp-atc__qty-row {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
}
.gp-pdp-atc__qty {
	display: flex;
	align-items: center;
	border: 1px solid var(--gp-line);
	border-radius: 4px;
	overflow: hidden;
	background: var(--gp-surface);
	flex: none;
}
.gp-pdp-atc__qty-btn {
	width: 42px;
	height: 48px;
	background: none;
	border: 0;
	font-size: 20px;
	color: var(--gp-ink);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s var(--gp-ease);
	flex: none;
}
.gp-pdp-atc__qty-btn:hover { background: var(--gp-cream); }
.gp-pdp-atc__qty-input {
	width: 46px;
	text-align: center;
	border: 0;
	border-left: 1px solid var(--gp-line);
	border-right: 1px solid var(--gp-line);
	font-family: var(--gp-sans);
	font-size: 15px;
	font-weight: 600;
	color: var(--gp-ink);
	background: transparent;
	outline: none;
	height: 48px;
	-moz-appearance: textfield;
}
.gp-pdp-atc__qty-input::-webkit-outer-spin-button,
.gp-pdp-atc__qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.gp-pdp-atc__stock {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--gp-sans);
	font-size: var(--gp-small);
	font-weight: 600;
	color: #2a7a45;
}
.gp-pdp-atc__stock.is-out { color: #b0443c; }

/* CTA row.
   WoodMart's base.css styles :is(.button, button, [type="button"]) at (0,1,0)
   and loads after this file, so the CTA appearance is scoped under the row to
   win the cascade (0,2,0). */
.gp-pdp-atc__cta-row {
	display: flex;
	align-items: stretch;
	gap: 10px;
	margin-bottom: 18px;
}
.gp-pdp-atc__cta-row .gp-pdp-atc__submit {
	flex: 1;
	min-height: 52px;
	padding: 0 24px;
	font-size: 15px;
	font-weight: 600;
	border: 0;
	border-radius: 4px;
	background: var(--gp-sea);
	color: #fff;
}
.gp-pdp-atc__cta-row .gp-pdp-atc__submit:hover { background: var(--gp-sea-deep); color: #fff; }
.gp-pdp-atc__cta-row .gp-pdp-atc__buynow {
	flex: none;
	min-height: 52px;
	padding: 0 22px;
	font-size: 15px;
	font-weight: 600;
	border: 2px solid var(--gp-ink);
	border-radius: 4px;
	background: transparent;
	color: var(--gp-ink);
}
.gp-pdp-atc__cta-row .gp-pdp-atc__buynow:hover { background: var(--gp-ink); color: #fff; }
.gp-pdp-atc__cta-row .is-disabled {
	opacity: .5;
	pointer-events: none;
}
/* Buy-now spinner visible on the light outline button */
.gp-pdp-atc__buynow.is-loading::after {
	border-color: rgba(19, 41, 61, .25);
	border-top-color: var(--gp-ink);
}

/* Wishlist heart (WoodMart button, restyled to a square) */
.gp-pdp-atc__wishlist { flex: none; display: flex; }
.gp-pdp-atc__wishlist .wd-wishlist-btn { margin: 0; }
.gp-pdp-atc__wishlist .wd-wishlist-btn > a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	background: var(--gp-surface);
	border: 1px solid var(--gp-line);
	border-radius: 4px;
	color: var(--gp-ink);
	transition: border-color .15s var(--gp-ease), color .15s var(--gp-ease);
}
.gp-pdp-atc__wishlist .wd-wishlist-btn > a:hover { border-color: var(--gp-sea); color: var(--gp-sea); }
.gp-pdp-atc__wishlist .wd-wishlist-btn > a.added { color: var(--gp-sea); border-color: var(--gp-sea); }
/* Hide WoodMart's text label; WoodMart's own heart-icon CSS isn't loaded on our
   custom PDP, so draw the heart ourselves (outline; filled once added). */
.gp-pdp-atc__wishlist .wd-action-text { display: none !important; }
.gp-pdp-atc__wishlist .wd-action-icon,
.gp-pdp-atc__wishlist .wd-check-icon { display: inline-flex; }
.gp-pdp-atc__wishlist .wd-check-icon::before {
	content: "\2661";
	font-size: 22px;
	line-height: 1;
}
.gp-pdp-atc__wishlist .wd-wishlist-btn > a.added .wd-check-icon::before { content: "\2665"; }

/* Out of stock */
.gp-pdp-atc__outofstock {
	font-family: var(--gp-sans);
	font-size: var(--gp-body);
	color: #b0443c;
	padding: 8px 0 18px;
}

/* Delivery note */
.gp-pdp-atc__delivery {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--gp-paper-warm);
	border: 1px solid var(--gp-line);
	border-radius: 4px;
	padding: 12px 14px;
	font-family: var(--gp-sans);
	font-size: var(--gp-small);
	color: var(--gp-text-soft);
	margin-bottom: 16px;
}
.gp-pdp-atc__delivery .gp-icon { color: var(--gp-sea); flex: none; }

/* Share */
.gp-pdp-atc__share {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--gp-sans);
}
.gp-pdp-atc__share-label {
	font-size: var(--gp-small);
	color: var(--gp-text-soft);
	margin-right: 2px;
}
.gp-pdp-atc__share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 30px;
	padding: 0 10px;
	background: var(--gp-surface);
	border: 1px solid var(--gp-line);
	border-radius: 3px;
	font-family: var(--gp-mono);
	font-size: 11px;
	letter-spacing: .04em;
	color: var(--gp-ink);
	text-decoration: none;
	cursor: pointer;
	transition: border-color .15s var(--gp-ease), color .15s var(--gp-ease);
}
.gp-pdp-atc__share-btn:hover { border-color: var(--gp-sea); color: var(--gp-sea); }

/* ─── Info: description (left) + spec/nutrition tabs (right) ────────────────── */
.gp-pdp-info {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 480px;
	gap: 48px;
	align-items: start;
	margin-bottom: 64px;
	padding-top: 8px;
}
.gp-pdp-info--single { grid-template-columns: minmax(0, 1fr); }

.gp-pdp-info__heading {
	font-family: var(--gp-serif);
	font-style: italic;
	font-size: 26px;
	font-weight: 400;
	color: var(--gp-ink);
	margin: 0 0 18px;
}

/* ─── Content tabs (aside) ─────────────────────────────────────────────────── */
.gp-tabs__nav {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
	display: flex;
	border-bottom: 1px solid var(--gp-line);
}
.gp-tabs__btn {
	display: block;
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	padding: 12px 22px;
	font-family: var(--gp-sans);
	font-size: var(--gp-body);
	font-weight: 600;
	color: var(--gp-text-soft);
	cursor: pointer;
	transition: color .15s var(--gp-ease), border-color .15s var(--gp-ease);
	white-space: nowrap;
}
.gp-tabs__btn:hover { color: var(--gp-ink); }
.gp-tabs__btn.is-active {
	color: var(--gp-sea);
	border-bottom-color: var(--gp-sea);
}
.gp-tabs__panel { display: none; }
.gp-tabs__panel.is-active { display: block; }

/* ─── Description ──────────────────────────────────────────────────────────── */
.gp-pdp-description {
	font-family: var(--gp-sans);
	font-size: var(--gp-body);
	line-height: 1.75;
	color: var(--gp-text);
}
.gp-pdp-description__short {
	font-size: 16px;
	font-weight: 500;
	color: var(--gp-ink);
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--gp-line);
}
.gp-pdp-description p,
.gp-pdp-description ul,
.gp-pdp-description ol { margin: 0 0 16px; }
.gp-pdp-description ul,
.gp-pdp-description ol { padding-left: 22px; }

/* ─── Specs / nutrition table ──────────────────────────────────────────────── */
.gp-specs-table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--gp-sans);
	font-size: var(--gp-body);
}
.gp-specs-table th,
.gp-specs-table td {
	padding: 11px 16px;
	text-align: left;
	border-bottom: 1px solid var(--gp-line);
	vertical-align: top;
}
.gp-specs-table tbody tr:nth-child(odd) { background: var(--gp-paper); }
.gp-specs-table tbody th {
	font-weight: 600;
	color: var(--gp-text);
	width: 45%;
}
.gp-specs-table tbody td { color: var(--gp-text-soft); }
.gp-specs-table thead th {
	background: var(--gp-ink);
	color: #fff;
	font-weight: 600;
}
.gp-specs-table tbody tr:last-child th,
.gp-specs-table tbody tr:last-child td { border-bottom: 0; }

.gp-nutrition__table tbody td { font-variant-numeric: tabular-nums; }

/* ─── Related products: "З цим купують" ────────────────────────────────────── */
.gp-pdp-related { padding-bottom: 80px; }
.gp-pdp-related__head { margin-bottom: 24px; }
.gp-pdp-related__head h2 {
	font-family: var(--gp-serif);
	font-style: italic;
	font-size: 36px;
	font-weight: 400;
	letter-spacing: -.01em;
	color: var(--gp-ink);
	margin: 0;
}
.gp-pdp-related__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	align-items: stretch;
}
/* Let each <li> stretch to its row height and pass that height to the card
   inside (which is height:100%), so every card ends up equally tall. */
.gp-pdp-related__grid .gp-plp-grid__item {
	display: flex;
	height: 100%;
}
.gp-pdp-related__grid .gp-plp-grid__item > * {
	width: 100%;
}

/* ─── WC notices (add-to-cart success / error) ─────────────────────────────── */
.gp-pdp-template .woocommerce-notices-wrapper {
	max-width: var(--gp-container-width, 1320px);
	margin: 0 auto;
	padding: 0 clamp(16px, 4vw, 60px);
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
	.gp-pdp-hero { grid-template-columns: minmax(0, 1fr) 420px; gap: 40px; }
	.gp-pdp-info { grid-template-columns: minmax(0, 1fr) 420px; gap: 40px; }
	.gp-pdp-related__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
	.gp-pdp-hero {
		grid-template-columns: 1fr;
		gap: 28px;
		padding-top: 20px;
		padding-bottom: 40px;
	}
	.gp-pdp-info {
		grid-template-columns: 1fr;
		gap: 32px;
	}
	.gp-pdp-related__grid { grid-template-columns: repeat(2, 1fr); }
	.gp-pdp-related__head h2 { font-size: 28px; }
}

@media (max-width: 560px) {
	.gp-pdp-gallery { flex-direction: column-reverse; }
	.gp-pdp-gallery__thumbs {
		flex-direction: row;
		width: 100%;
		overflow-x: auto;
	}
	.gp-pdp-atc__price { font-size: 34px; }
	.gp-pdp-atc__cta-row { flex-wrap: wrap; }
	.gp-pdp-atc__submit { flex: 1 1 100%; }
	.gp-pdp-related__grid { gap: 14px; }
	.gp-tabs__btn { font-size: var(--gp-small); padding: 10px 14px; }
}
