/* Single product page.
   Loaded after jokercity.css (shared tokens + components) and before preset.css.
   Presentation only: the add-to-cart form is restyled, never re-wired. */

/* Top block: image well beside the buying column ---------------------- */
.single-product div.product {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	margin-bottom: 0;
	overflow: visible;
}
.single-product div.product::before,
.single-product div.product::after { content: none; }
.single-product div.product > * { grid-column: 1 / -1; min-width: 0; }

@media (min-width: 768px) {
	.single-product div.product {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		column-gap: clamp(28px, 4.5vw, 72px);
		row-gap: 0;
	}
	.single-product div.product > .woocommerce-product-gallery,
	.single-product div.product > .onsale { grid-column: 1; grid-row: 1; }
	.single-product div.product > .summary { grid-column: 2; grid-row: 1; }
}
/* Storefront's full-width layout (the shop's setting on staging/live) sizes these as floats: gallery 39%,
   summary 56.5% of their grid cell, which left a 245px image at 1440 (fresh-eyes critique, 0.6.4). */
.storefront-full-width-content.single-product div.product .woocommerce-product-gallery,
.storefront-full-width-content.single-product div.product .summary { width: auto; float: none; margin-right: 0; }

/* Gallery: the box on a lit shelf (contained, never cropped) */
.single-product div.product .woocommerce-product-gallery {
	position: relative;
	width: auto;
	float: none;
	margin: 0;
	align-self: start;
}
.single-product div.product .woocommerce-product-gallery__image {
	display: grid;
	/* One cell exactly the frame's inner box: without it the row grew to the photo's own height and
	   tall packs were clipped by the frame (pass-2 review A1, regression of 0.7.4's overflow:hidden). */
	grid-template: minmax(0, 1fr) / minmax(0, 1fr);
	place-items: center;
	aspect-ratio: 4 / 3;
	padding: 0; /* the inset is on the photo (--jc-well-pad): FlexSlider subtracts slide padding from slide widths */
	--jc-well-pad: 16px;
	background: #fafafa;
	border: 0; /* inset outline, not a border: FlexSlider's viewport cut the border by 2px (pass-3 audit B2) */
	box-shadow: inset 0 0 0 1px var(--jc-line);
	border-radius: var(--jc-radius);
}
.single-product div.product .woocommerce-product-gallery__image a { display: contents; }
.single-product div.product .woocommerce-product-gallery__image img:not(.zoomImg) {
	width: 100%;
	height: 100%;
	min-height: 0;
	max-height: 100%;
	box-sizing: border-box;
	padding: var(--jc-well-pad);
	object-fit: contain;
	margin: 0;
	mix-blend-mode: multiply; /* white photo backgrounds melt into the well */
}
/* Hover zoom: WooCommerce's zoom script adds a full-size img.zoomImg inside the well and moves it
   with the pointer. It must keep its natural size and normal blending, or the magnified layer is
   squashed to the well and shows as an offset ghost over the photo (user report, 0.7.4). */
.single-product div.product .woocommerce-product-gallery__image .zoomImg {
	max-width: none;
	max-height: none;
	background: #fff;
	mix-blend-mode: normal;
	border-radius: 0;
}
.single-product div.product .woocommerce-product-gallery__image { overflow: hidden; }
@media (min-width: 768px) {
	.single-product div.product .woocommerce-product-gallery__image { aspect-ratio: 1; --jc-well-pad: clamp(16px, 4vw, 56px); }
	/* Not a percentage: on products with several photos FlexSlider puts the slides in a 400%-wide track,
	   so 9% became ~226px a side and every slide was offset (walker 3/6: thumbnail 2 showed half a slide). */
	/* Not sticky: div.product also holds the description and related products, so a sticky gallery
	   rode down over them (user report, 0.7.4). Storefront's sticky buy bar covers the long scroll. */
}
/* Thumbnails, when a product has several photos */
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs {
	display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0;
}
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs li {
	width: 72px !important; margin: 0 !important; float: none;
}
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img {
	aspect-ratio: 1; object-fit: contain; background: #fafafa;
	border: 1px solid var(--jc-line); border-radius: 6px; opacity: .7; cursor: pointer;
	transition: opacity .15s, border-color .15s;
}
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img:hover,
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img.flex-active { opacity: 1; border-color: var(--jc-ink); }

/* Zoom: a touchable control with a drawn magnifier (WooCommerce ships an emoji) */
.single-product div.product .woocommerce-product-gallery .woocommerce-product-gallery__trigger {
	position: absolute; top: 10px; right: 10px; z-index: 9;
	display: grid; place-items: center;
	width: 44px; height: 44px;
	background: var(--jc-paper);
	border: 1px solid var(--jc-line);
	border-radius: 8px;
	color: var(--jc-ink);
	transition: border-color .15s, box-shadow .15s;
}
.single-product div.product .woocommerce-product-gallery__trigger > span { display: none; }
.single-product div.product .woocommerce-product-gallery__trigger::before {
	content: "";
	width: 20px; height: 20px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.single-product div.product .woocommerce-product-gallery__trigger:hover { border-color: var(--jc-ink); box-shadow: 0 8px 24px rgba(18, 19, 22, .08); }

/* Sale badge sits on the image well, same badge as the cards */
.single-product div.product > .onsale {
	position: relative; z-index: 9;
	align-self: start; justify-self: start;
	margin: 12px; min-height: 0; min-width: 0;
	border: 0; border-radius: 4px; padding: 2px 8px;
	background: var(--jc-brand); color: #fff;
	font-size: 13px; font-weight: 700; line-height: 1.5;
}

/* Buying column ------------------------------------------------------- */
.single-product div.product .summary {
	width: auto; float: none; margin: 0;
	display: flex; flex-direction: column;
	max-width: 640px;
}
.single-product div.product .product_title {
	font-size: clamp(1.6rem, 1.2rem + 1.3vw, 2.5rem);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.015em;
	text-wrap: balance;
	overflow-wrap: anywhere;
	margin: 0 0 14px;
}
.single-product div.product p.price {
	margin: 0 0 18px;
	font-size: 28px;
	font-weight: 800;
	line-height: 1.1;
	color: var(--jc-ink);
	font-variant-numeric: tabular-nums;
}
.single-product div.product p.price del { font-size: 18px; font-weight: 400; color: var(--jc-muted); opacity: 1; margin-right: 6px; }
.single-product div.product p.price ins { text-decoration: none; font-weight: 800; }
/* Stock label (shared .jc-stock component, printed by inc/product.php) */
.single-product div.product .summary .jc-stock { margin: -8px 0 18px; font-size: 14px; }
.single-product div.product .summary .stock { font-size: 14px; font-weight: 600; margin: 0 0 16px; }
.single-product div.product .summary .stock.in-stock { color: var(--jc-ok); }
.single-product div.product .summary .stock.out-of-stock { color: #9b1c1c; }
.single-product div.product .summary .stock.available-on-backorder { color: #9a5b00; }

.single-product div.product .woocommerce-product-details__short-description {
	color: var(--jc-ink-2);
	font-size: 16px;
	line-height: 1.6;
	max-width: 56ch; /* Archivo: ~1.25 rendered chars per ch, so this is ~70 characters */
	margin: 0 0 22px;
}
.single-product div.product .woocommerce-product-details__short-description > :last-child { margin-bottom: 0; }

/* Add-to-cart form: styling only (quantity, limits and submit untouched) */
.single-product div.product form.cart {
	display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px;
	margin: 0 0 24px; padding: 0;
}
.single-product div.product form.cart::before,
.single-product div.product form.cart::after { content: none; }
.single-product div.product form.cart .quantity { float: none; margin: 0; }
.single-product div.product form.cart .quantity .qty {
	width: 76px; height: 50px;
	padding: 0 8px;
	border: 1px solid var(--jc-control-line, #c9ccd3);
	border-radius: 8px;
	background: var(--jc-paper);
	box-shadow: none;
	color: var(--jc-ink);
	font: 600 16px/1 var(--jc-font);
	text-align: center;
	font-variant-numeric: tabular-nums;
}
.single-product div.product form.cart .quantity .qty:hover { border-color: var(--jc-ink); }
.single-product div.product form.cart .single_add_to_cart_button {
	flex: 1 1 200px;
	min-height: 50px;
	float: none;
	margin: 0;
	padding: 0 28px;
	border: 0;
	border-radius: 8px;
	background: var(--jc-ink);
	color: #fff;
	font: 700 16px/1.2 var(--jc-font);
	transition: background-color .15s;
}
.single-product div.product form.cart .single_add_to_cart_button:hover { background: #000; }
.single-product div.product form.cart .single_add_to_cart_button.disabled,
.single-product div.product form.cart .single_add_to_cart_button:disabled { opacity: .45; cursor: not-allowed; }
.single-product div.product form.cart .single_add_to_cart_button.loading { opacity: .7; }
/* Variable products: attribute selects */
.single-product div.product form.cart .variations { margin: 0 0 4px; width: 100%; border: 0; }
.single-product div.product form.cart .variations th,
.single-product div.product form.cart .variations td { padding: 0 0 8px; background: none; vertical-align: middle; }
.single-product div.product form.cart .variations label { font-weight: 600; font-size: 15px; }
.single-product div.product form.cart .variations select {
	min-height: 44px; padding: 0 12px; border: 1px solid #c9ccd3; border-radius: 8px;
	background-color: var(--jc-paper); font: 600 15px var(--jc-font); color: var(--jc-ink);
}
.single-product div.product form.cart .single_variation_wrap { width: 100%; }
.single-product div.product form.cart .woocommerce-variation-add-to-cart { display: flex; flex-wrap: wrap; gap: 10px; }

/* Product facts: SKU and categories as a quiet fact sheet */
.single-product div.product .product_meta {
	display: grid; gap: 6px;
	margin: 0; padding: 16px 0 0;
	border-top: 1px solid var(--jc-line);
	font-size: 14px;
	color: var(--jc-muted);
}
.single-product div.product .product_meta > span { display: block; border: 0; padding: 0; margin: 0; }
.single-product div.product .product_meta .sku { color: var(--jc-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.single-product div.product .product_meta a { color: var(--jc-ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--jc-line); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.single-product div.product .product_meta a:hover { text-decoration-color: currentColor; }

/* Description and details: open sections, not hidden tabs ------------- */
.single-product div.product .woocommerce-tabs {
	margin: clamp(36px, 5vw, 64px) 0 0;
	padding: clamp(28px, 4vw, 48px) 0 0;
	border-top: 1px solid var(--jc-line);
}
.single-product div.product .woocommerce-tabs ul.tabs { display: none; }
/* WooCommerce's tab script hides inactive panels inline; with the tab list gone every
   panel is a plain section. Reviews are hidden: the shop has none (PRODUCT.md). */
.single-product div.product .woocommerce-tabs .panel {
	display: block !important;
	width: auto; float: none;
	max-width: 60ch;
	margin: 0;
	padding: 0;
	font-size: 16px;
	line-height: 1.65;
	color: var(--jc-ink-2);
}
.single-product div.product .woocommerce-tabs .panel + .panel { margin-top: clamp(28px, 4vw, 44px); }
.single-product div.product .woocommerce-tabs .reviews_tab,
.single-product div.product .woocommerce-tabs .woocommerce-Tabs-panel--reviews { display: none !important; }
.single-product div.product .woocommerce-tabs:not(:has(.woocommerce-Tabs-panel:not(.woocommerce-Tabs-panel--reviews))) { display: none; }
.single-product div.product .woocommerce-tabs .panel h2:first-child {
	font-size: clamp(1.4rem, 1.2rem + .8vw, 2rem);
	font-weight: 800;
	line-height: 1.15;
	margin: 0 0 16px;
	color: var(--jc-ink);
}
.single-product div.product .woocommerce-tabs .panel strong { color: var(--jc-ink); }
.single-product div.product .woocommerce-tabs .panel p { margin: 0 0 1em; }
.single-product div.product .woocommerce-tabs .panel ul { margin: 0 0 1.2em 1.25em; }
.single-product div.product .woocommerce-tabs .panel li { margin-bottom: .2em; }
.single-product div.product .woocommerce-tabs .panel li::marker { color: var(--jc-muted); }
.single-product div.product .woocommerce-tabs .panel > :last-child { margin-bottom: 0; }
/* "Dodatne informacije" table (weight, dimensions, attributes) */
.single-product .woocommerce-product-attributes { border: 0; margin: 0; font-size: 15px; }
.single-product .woocommerce-product-attributes th,
.single-product .woocommerce-product-attributes td {
	padding: 10px 0; background: none !important; border-bottom: 1px solid var(--jc-line); text-align: left; vertical-align: top;
}
.single-product .woocommerce-product-attributes th { width: 40%; padding-right: 16px; font-weight: 600; color: var(--jc-muted); }
.single-product .woocommerce-product-attributes td p { margin: 0; }

/* Related / up-sells: the shared card grid under a section title ------ */
.single-product div.product .related,
.single-product div.product .up-sells {
	margin: clamp(40px, 6vw, 72px) 0 0;
	padding: clamp(28px, 4vw, 48px) 0 0;
	border-top: 1px solid var(--jc-line);
}
.single-product div.product .related > h2,
.single-product div.product .up-sells > h2 {
	font-size: clamp(1.4rem, 1.2rem + .8vw, 2rem);
	font-weight: 800;
	line-height: 1.15;
	margin: 0 0 20px;
}
.single-product div.product .related ul.products,
.single-product div.product .up-sells ul.products { margin-bottom: clamp(32px, 5vw, 64px) !important; }

/* Storefront's fixed prev/next thumbnails clip at the screen edges and duplicate
   the related grid; inc/product.php removes them, this hides them until it loads. */
.single-product .storefront-product-pagination { display: none; }

/* Phones: price, stock and the buy button before the longer text, so the
   purchase controls sit in the first screen. Short description has no controls. */
@media (max-width: 767px) {
	.single-product div.product .summary > .woocommerce-product-details__short-description { order: 1; }
	.single-product div.product .summary > .product_meta { order: 2; }
	.single-product div.product form.cart { margin-bottom: 18px; }
}

/* Narrow phones -------------------------------------------------------- */
@media (max-width: 420px) {
	.single-product div.product .woocommerce-product-gallery__image { aspect-ratio: 5 / 4; --jc-well-pad: 12px; }
	.single-product div.product p.price { font-size: 24px; margin-bottom: 14px; }
	.single-product div.product form.cart .single_add_to_cart_button { max-width: none; padding: 0 16px; }
}

/* 0.7.2 review fixes ---------------------------------------------------- */
/* Format line under the title: what kind of product this is, for shoppers who don't play. */
.single-product .summary .jc-format {
	display: block; width: fit-content; margin: 0 0 14px; padding: 6px 12px; border-radius: 8px;
	background: var(--jc-wash); color: var(--jc-ink-2); font-size: 15px; line-height: 1.4;
}
.single-product .summary .jc-format strong { color: var(--jc-ink); font-weight: 700; }
/* The categories repeat the breadcrumb right above; the SKU stays. */
.single-product div.product .product_meta > span.posted_in { display: none; }

/* Loop pass 1 ----------------------------------------------------------- */
/* Delivery and payment facts right under the buy button (inc/product.php jc_shop_facts):
   a quiet two-row fact sheet in the meta's type scale, so the button stays the loudest thing. */
.single-product div.product .summary .jc-buyfacts {
	display: grid; gap: 6px;
	margin: 4px 0 22px; padding: 0; clear: both;
	font-size: 15px; line-height: 1.45;
}
.single-product .summary .jc-buyfacts > div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); column-gap: 12px; }
.single-product .summary .jc-buyfacts dt { margin: 0; font-weight: 600; color: var(--jc-muted); }
.single-product .summary .jc-buyfacts dd { margin: 0; color: var(--jc-ink); }
.single-product .summary .jc-buyfacts .amount { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Storefront's sticky buy bar (appears once the buy button scrolls away). Its colours came from
   Storefront's Customizer CSS, which this theme switches off (functions.php), so the bar was
   see-through and page text ran through it (user report + pass-1 verifier). Paper bar, shelf rule,
   the shop's ink button. */
.storefront-sticky-add-to-cart {
	background: var(--jc-paper);
	color: var(--jc-ink);
	border-bottom: 1px solid var(--jc-line);
	box-shadow: 0 8px 24px rgba(18, 19, 22, .08);
}
.storefront-sticky-add-to-cart__content { padding: 10px 0; }
.storefront-sticky-add-to-cart__content img { border: 1px solid var(--jc-line); border-radius: 6px; background: #fafafa; }
.storefront-sticky-add-to-cart__content-title { color: var(--jc-ink); font-size: 15px; }
.storefront-sticky-add-to-cart__content-title strong { font-weight: 700; }
.storefront-sticky-add-to-cart__content-price { color: var(--jc-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.storefront-sticky-add-to-cart__content-button.button {
	min-height: 44px; display: inline-flex; align-items: center; padding: 0 22px;
	border: 0; border-radius: 8px; background: var(--jc-ink); color: #fff;
	font: 700 15px/1.2 var(--jc-font); text-decoration: none;
}
.storefront-sticky-add-to-cart__content-button.button:hover { background: #000; color: #fff; }

/* Loop pass 2 polish: section titles left like every other one; sticky-bar price in full ink. */
.single-product div.product .related > h2,
.single-product div.product .up-sells > h2 { text-align: left; }
.storefront-sticky-add-to-cart__content-price,
.storefront-sticky-add-to-cart__content-price .amount { opacity: 1; color: var(--jc-ink); }

/* Pass-2 verifier: Storefront centres the related heading from 768px with a longer selector. */
body.single-product div.product section.related.products > h2,
body.single-product div.product section.up-sells.products > h2 { text-align: left; }
/* Sold individually / stock of 1: WooCommerce prints an empty quantity wrapper (hidden input) that
   took a flex gap and pushed the buy button 10px off the column edge. */
.single-product div.product form.cart .quantity:not(:has(input:not([type="hidden"]))) { display: none; }

/* Wide screens (0.7.18): listings use up to 2200px, but a product page stays at 1400px, so the
   photo isn't blown up past its pixels and the buy column stays next to it. */
.single-product .site-content > .col-full,
.single-product .storefront-breadcrumb > .col-full { max-width: 1400px; }
