/* ==========================================================================
   Deercoffe — single product page ("Karta produktu")
   Loaded only on is_product(). Scoped under .deercoffe-product except for
   the bleed helper, which needs to escape the theme's .container (see
   assets/css/shop.css for the same pattern on the category archive).
   ========================================================================== */

.site-content {
	overflow-x: hidden;
}

.shop-bleed {
	width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
}

.deercoffe-product {
	font-family: var(--deercoffe-font-body);
	color: var(--deercoffe-color-text);
	font-size: 15px;
}

.deercoffe-product h1,
.deercoffe-product h2,
.deercoffe-product h3 {
	font-family: var(--deercoffe-font-heading);
	font-weight: 400;
	color: var(--deercoffe-color-text);
	margin: 0;
}

.product-container {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 40px;
}

/* Breadcrumb ------------------------------------------------------------- */

.product-breadcrumb-row {
	padding-top: 32px;
	padding-bottom: 16px;
}

.product-breadcrumb {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--deercoffe-color-muted);
}

.product-breadcrumb a {
	color: var(--deercoffe-color-muted);
}

.product-breadcrumb a:hover,
.product-breadcrumb a:focus {
	color: var(--deercoffe-color-primary);
}

.product-breadcrumb span[aria-hidden] {
	margin: 0 6px;
}

/* Hero: gallery + configurator -------------------------------------------- */

.product-hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 620px) minmax(0, 1fr);
	gap: 72px;
	padding-bottom: 90px;
}

.product-gallery-main {
	position: relative;
	background: var(--deercoffe-color-bg);
	aspect-ratio: 620 / 680;
	overflow: hidden;
}

.product-gallery-main .product-gallery-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.product-gallery-main .product-gallery-image.is-active {
	opacity: 1;
}

.product-gallery-badge {
	position: absolute;
	top: 18px;
	left: 18px;
	background: var(--deercoffe-color-terracotta);
	color: #fff;
	font-family: var(--deercoffe-font-heading);
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 9px 14px;
}

.product-gallery-thumbs {
	display: flex;
	gap: 16px;
	margin-top: 24px;
}

.product-gallery-thumb {
	display: block;
	width: 114px;
	aspect-ratio: 114 / 102;
	padding: 0;
	background: var(--deercoffe-color-bg);
	border: 1px solid transparent;
	overflow: hidden;
	cursor: pointer;
}

.product-gallery-thumb.is-active {
	border-color: var(--deercoffe-color-accent);
}

.product-gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Configurator ------------------------------------------------------------ */

.product-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
	max-width: 548px;
}

.product-status {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--deercoffe-color-primary);
	margin: 0;
}

.product-status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	flex-shrink: 0;
}

.product-status.is-out-of-stock {
	color: var(--deercoffe-color-error);
}

.product-title {
	font-size: clamp(2rem, 3.5vw, 3.75rem);
	letter-spacing: 0.02em;
}

.product-lead {
	color: var(--deercoffe-color-muted);
	line-height: 1.6;
	margin: -8px 0 0;
}

.product-lead p {
	margin: 0;
}

.product-price {
	font-family: var(--deercoffe-font-heading);
	font-size: 1.5rem;
}

.product-price ins {
	text-decoration: none;
	font-weight: 700;
	margin-right: 10px;
}

.product-price del {
	color: #9c9b9b;
	font-size: 0.9rem;
	font-weight: 400;
}

.product-field {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.product-field-label {
	font-family: var(--deercoffe-font-heading);
	font-weight: 700;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.product-weights {
	display: flex;
	gap: 10px;
}

.product-weight {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
	align-items: flex-start;
	min-height: 64px;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid #bbb;
	font-family: var(--deercoffe-font-body);
	text-align: left;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.product-weight:hover:not(:disabled) {
	background-color: #fff;
	border-color: var(--deercoffe-color-primary);
}

.product-weight.is-active {
	background: var(--deercoffe-color-cream-light);
	border-color: var(--deercoffe-color-primary);
}

.product-weight.is-active:hover:not(:disabled) {
	background-color: var(--deercoffe-color-cream-light);
}

.product-weight:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.product-weight-label {
	font-weight: 700;
	color: var(--deercoffe-color-text);
}

.product-weight-price {
	color: #525252;
	font-size: 0.9rem;
}

.product-select-wrap {
	position: relative;
}

.product-select-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	height: 50px;
	padding: 0 14px 0 16px;
	background: #fff;
	border: 1px solid var(--deercoffe-color-accent);
	border-radius: 0;
	font-family: var(--deercoffe-font-body);
	font-size: 0.9rem;
	font-weight: 400;
	color: var(--deercoffe-color-text) !important;
	text-align: left;
	cursor: pointer;
}

.product-select-trigger:hover {
	background-color: #fff;
	border-color: var(--deercoffe-color-primary);
}

.product-select-trigger svg {
	flex-shrink: 0;
	color: var(--deercoffe-color-text);
	transition: transform 0.2s ease;
}

.product-select-trigger[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

.product-select-panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 20;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--deercoffe-color-accent);
	max-height: 280px;
	overflow-y: auto;
	box-shadow: 0 12px 24px rgba(29, 29, 27, 0.08);
}

.product-select-panel[hidden] {
	display: none;
}

.product-select-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 12px;
	font-family: var(--deercoffe-font-body);
	font-size: 0.9rem;
	color: var(--deercoffe-color-text);
	cursor: pointer;
}

.product-select-option svg {
	flex-shrink: 0;
	visibility: hidden;
	color: var(--deercoffe-color-primary);
}

.product-select-option.is-selected svg {
	visibility: visible;
}

.product-select-option.is-selected {
	font-weight: 700;
}

.product-select-option:hover,
.product-select-option.is-active {
	background: var(--deercoffe-color-cream-light);
}

.product-purchase-row {
	display: flex;
	align-items: stretch;
	gap: 10px;
}

.product-quantity {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 130px;
	flex-shrink: 0;
	border: 1px solid #bbb;
	border-radius: 4px;
}

.product-quantity-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 100%;
	padding: 0;
	background: none !important;
	border: 0;
	color: var(--deercoffe-color-text) !important;
	cursor: pointer;
}

.product-quantity-btn:hover {
	color: var(--deercoffe-color-primary) !important;
	background: none !important;
}

.product-quantity-input {
	width: 100%;
	border: 0;
	background: none;
	text-align: center;
	font-family: var(--deercoffe-font-body);
	font-size: 0.95rem;
	color: var(--deercoffe-color-text);
	-moz-appearance: textfield;
}

.product-quantity-input::-webkit-outer-spin-button,
.product-quantity-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.product-add-to-cart {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 56px;
	padding: 0 20px;
	background: var(--deercoffe-color-primary);
	color: #fff;
	font-family: var(--deercoffe-font-heading);
	font-weight: 700;
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border: 2px solid transparent;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color 0.2s ease;
}

.product-add-to-cart:hover {
	background: var(--deercoffe-color-primary);
	border-color: var(--deercoffe-color-primary-dark);
}

.product-add-to-cart:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.product-add-to-cart .woocommerce-Price-amount {
	font-weight: 700;
}

.product-benefits {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 10px 20px;
	list-style: none;
	margin: 0;
	padding: 14px 0 0;
	border-top: 1px solid var(--deercoffe-color-cream);
	color: #525252;
	font-size: 0.85rem;
}

.product-benefits li::before {
	content: "✓ ";
}

.product-form-feedback {
	margin: 0;
	font-size: 0.85rem;
	color: var(--deercoffe-color-error);
	display: none;
}

.product-form-feedback.is-visible {
	display: block;
}

/* Profil kawy -------------------------------------------------------------- */

.product-profile-section {
	background: var(--deercoffe-color-cream-light);
	padding: 60px 0;
}

.product-profile-head {
	margin-bottom: 40px;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}

.product-profile-head h2 {
	font-size: clamp(1.4rem, 2.5vw, 1.9rem);
	letter-spacing: 0.02em;
}

.product-profile-tagline {
	max-width: 420px;
	margin: 0;
	color: var(--deercoffe-color-muted);
	line-height: 1.6;
}

.product-profile-grid {
	display: grid;
	grid-template-columns: minmax(0, 570px) minmax(0, 1fr);
	gap: 70px;
}

.product-origin-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px;
	padding: 17px 0;
	border-bottom: 1px solid var(--deercoffe-color-cream);
}

.product-origin-row:first-child {
	padding-top: 0;
}

.product-origin-label {
	font-family: var(--deercoffe-font-heading);
	font-weight: 700;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	flex-shrink: 0;
}

.product-origin-value {
	color: var(--deercoffe-color-text);
	text-align: right;
}

.product-sensory {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.product-sensory-row {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.product-sensory-row-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	font-size: 0.9rem;
}

.product-sensory-scale {
	height: 7px;
	background: var(--deercoffe-color-cream);
	border-radius: 4px;
	overflow: hidden;
}

.product-sensory-scale-fill {
	display: block;
	height: 100%;
	background: var(--deercoffe-color-accent);
	border-radius: 4px;
}

.product-tasting-notes {
	margin: 0;
	font-size: 0.9rem;
	color: var(--deercoffe-color-muted);
}

.product-tasting-notes span {
	color: var(--deercoffe-color-brown);
	font-weight: 700;
	margin-left: 6px;
}

.product-accordion {
	margin-top: 12px;
	border-top: 1px solid var(--deercoffe-color-cream);
}

.product-accordion-heading {
	margin: 0;
}

.product-accordion-trigger,
.product-accordion-trigger:hover {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 16px 0;
	background: none !important;
	border: 0;
	border-bottom: 1px solid var(--deercoffe-color-cream);
	font-family: var(--deercoffe-font-heading);
	font-weight: 700;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--deercoffe-color-text) !important;
	cursor: pointer;
	text-align: left;
}

.product-accordion-trigger svg line:first-of-type {
	transform-origin: center;
	transition: opacity 0.2s ease, transform 0.3s ease;
}

.product-accordion-trigger[aria-expanded="true"] svg line:first-of-type {
	opacity: 0;
	transform: rotate(90deg);
}

.product-accordion-panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.3s ease;
}

.product-accordion-panel.is-open {
	grid-template-rows: 1fr;
}

.product-accordion-panel-inner {
	min-height: 0;
	overflow: hidden;
	padding: 0 0 20px;
	color: var(--deercoffe-color-muted);
	line-height: 1.6;
	font-size: 0.9rem;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.product-accordion-panel.is-open .product-accordion-panel-inner {
	padding-top: 4px;
	opacity: 1;
	transition: opacity 0.3s ease 0.1s;
}

.product-accordion-panel-inner p {
	margin: 0 0 1em;
}

.product-accordion-panel-inner p:last-child {
	margin-bottom: 0;
}

/* Może Ci się spodobać ------------------------------------------------------ */

.product-related-section {
	padding: 90px 0;
}

.product-related-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 40px;
}

.product-related-head h2 {
	font-size: clamp(1.4rem, 2.5vw, 1.9rem);
	letter-spacing: 0.02em;
}

.product-related-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 40px 24px;
}

/* Sticky mobile purchase bar ------------------------------------------------ */

.product-sticky-cta {
	display: none;
}

/* Responsive ----------------------------------------------------------- */

@media (max-width: 900px) {
	.product-hero-grid,
	.product-profile-grid {
		grid-template-columns: 1fr;
		gap: 44px;
	}

	.product-related-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 782px) {
	.product-container {
		padding: 0 15px;
	}

	.product-breadcrumb-row {
		padding-top: 20px;
	}

	.product-hero-grid {
		padding-bottom: 60px;
	}

	.product-form {
		max-width: none;
	}

	.product-title {
		font-size: 2rem;
	}

	.deercoffe-product {
		padding-bottom: 90px;
	}

	.product-profile-section {
		padding: 44px 0;
	}

	.product-related-section {
		padding: 50px 0;
	}

	.product-related-grid {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.product-sticky-cta {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 40;
		background: #fff;
		border-top: 1px solid var(--deercoffe-color-border);
		box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.06);
		padding: 14px 15px;
	}

	.product-sticky-info {
		display: flex;
		flex-direction: column;
		gap: 2px;
		min-width: 0;
	}

	.product-sticky-weight {
		font-size: 0.85rem;
	}

	.product-sticky-price {
		font-weight: 700;
	}

	.product-sticky-btn {
		flex-shrink: 0;
		min-height: 48px;
		padding: 0 24px;
		background: var(--deercoffe-color-primary);
		color: #fff;
		border: 0;
		font-family: var(--deercoffe-font-heading);
		font-weight: 700;
		font-size: 0.85rem;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		cursor: pointer;
	}

	.product-sticky-btn:hover {
		background: var(--deercoffe-color-primary-dark);
	}

	.product-sticky-btn:disabled {
		opacity: 0.5;
		cursor: not-allowed;
	}
}
