/* Apex shop.css: single product, cart + checkout blocks, and empty-state styling. */
/* Enqueued in functions.php via apex_child_enqueue_assets(). */
/* Loads on: single product, cart, checkout. Reuses global :root tokens from style.css. */

/* === single product === */

/* Vertical thumbnail gallery over WooCommerce's flexslider.
   DOM order is [main viewport, then thumbnails]; row-reverse puts the
   thumbnails on the LEFT and the main image on the right. Flexslider keeps
   its native click-to-switch and .flex-active class — we only restyle. */
.woocommerce div.product .woocommerce-product-gallery {
	position: relative;
	/* Reserve the left rail: 72px square thumbs + 8px gutter. The rail is
	   absolutely pinned top+bottom inside this box, so it can never run
	   past the main image; extra thumbs scroll (wheel, touch, or arrows). */
	padding-left: 80px;
	margin-bottom: 1.5rem;
}

.woocommerce div.product .woocommerce-product-gallery .flex-viewport,
.woocommerce div.product .woocommerce-product-gallery > .woocommerce-product-gallery__wrapper {
	margin: 0;
	border: 2px solid var(--apex-line);
	border-radius: 2px;
	background: var(--apex-card);
}

.woocommerce div.product .woocommerce-product-gallery__image img {
	border-radius: 2px;
}

/* Thumbnail rail: fixed 72px SQUARE tiles (never stretched), pinned to the
   gallery box top+bottom so its edges align with the main image exactly.
   Overflow scrolls; the scrollbar is hidden because the ▲▼ arrow chips
   (built in the footer script) plus wheel/touch do the moving. */
.woocommerce div.product .flex-control-thumbs {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 72px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: none;
}

.woocommerce div.product .flex-control-thumbs::-webkit-scrollbar {
	display: none;
}

/* Tile size: --cs-tile is set by the rail script to (imageHeight − gaps) / n
   so a WHOLE number of tiles always fills the rail exactly — bottom edge
   flush with the image, no clipped tile. Falls back to 72px squares. */
.woocommerce div.product .flex-control-thumbs li {
	flex: 0 0 var(--cs-tile, 72px);
	width: 72px !important;
	height: var(--cs-tile, 72px);
	margin: 0 !important;
	list-style: none;
	float: none;
}

/* Rail arrows: appear only when there are more thumbs than fit. */
.cs-rail-nav {
	position: absolute;
	left: 0;
	width: 72px;
	height: 24px;
	display: none;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 2px;
	background: var(--apex-ink);
	color: var(--apex-amber);
	font-size: 11px;
	line-height: 1;
	cursor: pointer;
	z-index: 4;
	padding: 0;
}

.cs-rail-nav--up {
	top: 0;
}

.cs-rail-nav--down {
	bottom: 0;
}

.cs-rail-nav.is-on {
	display: flex;
}

.cs-rail-nav:hover,
.cs-rail-nav:focus-visible {
	background: var(--apex-amber);
	color: var(--apex-ink);
	outline: none;
}

.woocommerce div.product .flex-control-thumbs img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 2px solid var(--apex-line);
	border-radius: 2px;
	opacity: 1;
	cursor: pointer;
	transition: border-color 0.12s ease;
}

.woocommerce div.product .flex-control-thumbs img:hover {
	border-color: var(--apex-ink);
}

/* Active thumbnail: solid amber border so it's always clear which photo is
   showing (suggestion 6). */
.woocommerce div.product .flex-control-thumbs img.flex-active {
	border-color: var(--apex-amber);
	box-shadow: 0 0 0 1px var(--apex-amber);
}

/* Keep the zoom trigger pinned to the main image, not the whole flex row. */
.woocommerce div.product .woocommerce-product-gallery__trigger {
	top: 0.75rem;
	right: 0.75rem;
	z-index: 3;
}

/* Mobile: the rail un-pins and drops under the main image as a swipeable
   horizontal row. */
@media ( max-width: 768px ) {
	.woocommerce div.product .woocommerce-product-gallery {
		padding-left: 0;
	}

	.woocommerce div.product .flex-control-thumbs {
		position: static;
		width: auto;
		flex-direction: row;
		overflow-x: auto;
		overflow-y: hidden;
		margin-top: 0.6rem;
		gap: 6px;
		-webkit-overflow-scrolling: touch;
	}

	.woocommerce div.product .flex-control-thumbs li {
		flex: 0 0 68px;
		width: 68px !important;
		height: 68px;
	}

	.cs-rail-nav {
		display: none !important;
	}
}

.product_title {
	margin: 0 0 .5rem;
}

.woocommerce div.product p.price {
	color: var(--apex-ink);
	font-weight: 600;
}

.woocommerce-product-details__short-description {
	max-width: 60ch;
}

form.cart {
	display: flex;
	gap: .75rem;
	align-items: stretch;
	flex-wrap: wrap;
}

form.cart .quantity .qty {
	width: 5.5rem;
	text-align: center;
	border: 2px solid var(--apex-line);
	border-radius: 2px;
	font-family: var(--apex-ff-mono);
}

.product_meta {
	border-top: 1px solid var(--apex-line);
	padding-top: 1rem;
	margin-top: 1.5rem;
}

/* Tabs, storefront-marketplace style: quiet underline navigation with an
   amber active indicator, content in a white card. Woo's default skin uses
   ::before/::after borders + rounded corners on li — strip it all. */
.woocommerce-tabs ul.tabs {
	display: flex;
	width: 100%;
	padding: 0;
	margin: 0;
	background: none;
	border-bottom: 1px solid #e5e5e5;
	overflow: visible;
}

.woocommerce-tabs ul.tabs::before,
.woocommerce-tabs ul.tabs::after {
	content: none;
	background: none;
	border: none;
}

.woocommerce-tabs ul.tabs li {
	background: transparent !important;
	border: none;
	border-radius: 0;
	margin: 0;
	padding: 0;
}

.woocommerce-tabs ul.tabs li::before,
.woocommerce-tabs ul.tabs li::after {
	content: none;
	background: none;
	border: none;
}

.woocommerce-tabs ul.tabs li a {
	display: inline-block;
	font-family: var(--apex-ff-body);
	font-weight: 500;
	font-size: 0.95rem;
	text-transform: none;
	letter-spacing: 0;
	padding: 12px 18px;
	color: #6b7075;
	/* Sits on the ul's 1px line; the active bar replaces it seamlessly. */
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	transition: color 0.12s ease;
}

.woocommerce-tabs ul.tabs li a:hover,
.woocommerce-tabs ul.tabs li a:focus {
	color: var(--apex-ink);
}

.woocommerce-tabs ul.tabs li.active a {
	color: var(--apex-ink);
	font-weight: 700;
	border-bottom-color: #ffaa00;
}

/* Content card: white, hairline border, rounded, generous padding — clean
   separation from the grey page background. */
.woocommerce-Tabs-panel {
	background: #ffffff;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	padding: clamp(24px, 3.5vw, 32px);
	margin-top: 16px;
	line-height: 1.6;
}

.woocommerce-Tabs-panel h2 {
	font-size: 1.3rem;
	margin: 24px 0 12px;
}

.woocommerce-Tabs-panel h3,
.woocommerce-Tabs-panel h4 {
	margin: 24px 0 12px;
}

.woocommerce-Tabs-panel > h2:first-child,
.woocommerce-Tabs-panel > h3:first-child {
	margin-top: 0;
}

.woocommerce-Tabs-panel p {
	line-height: 1.6;
}

/* Solid-disc lists, tight rhythm. !important because Neve/Woo reset list
   styles to hollow circles at higher specificity. */
.woocommerce-Tabs-panel ul,
.woocommerce-Tabs-panel ul li {
	list-style: disc outside !important;
}

.woocommerce-Tabs-panel ul {
	padding-left: 1.35rem;
	margin: 0 0 1rem;
}

.woocommerce-Tabs-panel ul li {
	line-height: 1.6;
	margin: 0 0 8px;
	padding: 0;
}

.woocommerce-Tabs-panel ul li::marker {
	color: var(--apex-ink);
}

.related.products > h2,
.upsells.products > h2 {
	margin-top: 3rem;
}

.woocommerce div.product span.onsale {
	background: var(--apex-red);
	color: #FFF;
	font-family: var(--apex-ff-mono);
	text-transform: uppercase;
	border-radius: 2px;
	top: 0;
	left: 0;
}

/* Sparks/Neve paint the single add-to-cart with their own button variables,
   which beat the global recipe — force the store's amber here. */
.woocommerce div.product form.cart .single_add_to_cart_button {
	background-color: var(--apex-amber) !important;
	color: var(--apex-ink) !important;
	border: 2px solid var(--apex-ink) !important;
	border-radius: 2px !important;
	box-shadow: 3px 3px 0 var(--apex-ink);
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover {
	background-color: var(--apex-amber-dark) !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button:active {
	box-shadow: 1px 1px 0 var(--apex-ink);
	transform: translate(2px, 2px);
}

/* === single product layout: gallery | buy box ===
   Two-panel grid replaces Woo's float layout. The summary becomes a true
   buy box card; the price is the page's one loud element (shelf-tag plate).
   Grid children ignore floats, so Woo/Neve float rules are neutralized. */

.single-product .nv-single-product-top {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(300px, 5fr);
	gap: clamp(1.25rem, 3.5vw, 2.5rem);
	align-items: start;
	max-width: 1200px;
	margin-inline: auto;
}

.single-product div.product .woocommerce-product-gallery {
	width: 100% !important;
	max-width: none;
	float: none;
}

.single-product div.product .summary.entry-summary {
	width: 100% !important;
	max-width: none;
	float: none;
	margin: 0;
	background: #ffffff;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	padding: clamp(20px, 3vw, 28px);
}

/* Buy box internals, top to bottom */

.summary .product_title {
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	line-height: 1.05;
	margin: 0 0 0.5rem;
}

.summary .woocommerce-product-rating {
	margin-bottom: 0.85rem;
}

/* Condition strip: the bargain shopper's first question, answered up top. */
.cs-condition {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 0.85rem;
	font-family: var(--apex-ff-mono), monospace;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.cs-condition__badge {
	background: var(--apex-teal);
	color: #fff;
	padding: 0.3em 0.6em;
	border-radius: 2px;
	font-weight: 600;
}

.cs-condition__sku {
	opacity: 0.6;
}

/* The shelf tag: price stamped on an amber plate — the one loud element. */
.woocommerce div.product .summary p.price {
	display: inline-block;
	background: var(--apex-amber);
	border: 2px solid var(--apex-ink);
	border-radius: 2px;
	box-shadow: 3px 3px 0 var(--apex-ink);
	padding: 0.28em 0.55em;
	font-size: 1.7rem;
	line-height: 1;
	margin: 0.25rem 0 1.1rem;
	color: var(--apex-ink);
}

.woocommerce div.product .summary p.price .woocommerce-Price-amount {
	color: var(--apex-ink);
	font-weight: 600;
}

.woocommerce div.product .summary p.price del {
	font-size: 0.55em;
	opacity: 0.65;
	margin-right: 0.45em;
}

.woocommerce div.product .summary p.price ins {
	text-decoration: none;
}

.summary .woocommerce-product-details__short-description {
	font-size: 0.95rem;
	line-height: 1.6;
	max-width: none;
}

.summary form.cart {
	margin: 1.25rem 0 0;
}

.summary form.cart .single_add_to_cart_button {
	flex: 1 1 auto;
	padding: 0.95em 1.4em;
	font-size: 1rem;
}

/* Trust rows: quiet mono reassurance under the button */
.cs-trust {
	list-style: none;
	margin: 1.25rem 0 0;
	padding: 0.35rem 0 0;
	border-top: 1px solid #e5e5e5;
}

.cs-trust li {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-family: var(--apex-ff-mono), monospace;
	font-size: 0.8rem;
	letter-spacing: 0.02em;
	padding: 0.5rem 0;
	border-bottom: 1px solid #f0f0f0;
}

.cs-trust li:last-child {
	border-bottom: none;
}

.cs-trust__tick {
	color: var(--apex-ink);
	background: var(--apex-amber);
	width: 1.15rem;
	height: 1.15rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.7rem;
	border-radius: 2px;
	flex-shrink: 0;
}

.summary .product_meta {
	font-size: 0.75rem;
	border-top: none;
	margin-top: 1rem;
	padding-top: 0;
	opacity: 0.75;
}

.single-product div.product .woocommerce-tabs {
	max-width: 1200px;
	margin: 2rem auto 0;
}

.single-product .related.products {
	max-width: 1200px;
	margin-inline: auto;
}

/* Stack on tablets/phones: image, then buy box */
@media ( max-width: 900px ) {
	.single-product .nv-single-product-top {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* === shop pagination (centered — suggestion 1) === */

.woocommerce nav.woocommerce-pagination {
	text-align: center;
	margin: 2.5rem 0 1rem;
}

.woocommerce nav.woocommerce-pagination ul {
	display: inline-flex;
	gap: 6px;
	border: none;
	margin: 0 auto;
}

.woocommerce nav.woocommerce-pagination ul li {
	border: none;
	margin: 0;
	display: inline-flex;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
	min-width: 42px;
	padding: 0.55em 0.75em;
	border: 2px solid var(--apex-line);
	border-radius: 2px;
	font-family: var(--apex-ff-mono), monospace;
	font-size: 0.85rem;
	color: var(--apex-ink);
	line-height: 1;
}

.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li a:focus {
	border-color: var(--apex-ink);
	background: var(--apex-card);
}

.woocommerce nav.woocommerce-pagination ul li span.current {
	background: var(--apex-amber);
	border-color: var(--apex-ink);
	color: var(--apex-ink);
	font-weight: 600;
}

/* === cart + checkout blocks === */

/* Woo blocks ship a dark default button skin; override thoroughly */
.wc-block-components-button,
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
	background-color: var(--apex-amber) !important;
	color: var(--apex-ink) !important;
	font-family: var(--apex-ff-body);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .05em;
	border: 2px solid var(--apex-ink) !important;
	border-radius: 2px;
	box-shadow: 3px 3px 0 var(--apex-ink);
	transition: transform .1s ease, box-shadow .1s ease;
}

.wc-block-components-button .wc-block-components-button__text {
	color: inherit;
}

.wc-block-components-button:hover,
.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover {
	background-color: var(--apex-amber-dark) !important;
}

.wc-block-components-button:active,
.wc-block-cart__submit-button:active,
.wc-block-components-checkout-place-order-button:active {
	box-shadow: none;
	transform: translate(2px, 2px);
}

.wc-block-components-button:focus-visible,
.wc-block-cart__submit-button:focus-visible,
.wc-block-components-checkout-place-order-button:focus-visible {
	outline: 3px solid var(--apex-amber);
	outline-offset: 2px;
}

/* Recolor borders/radius only; Woo blocks wrap labels inside the field, don't touch padding */
.wc-block-components-text-input input[type="text"],
.wc-block-components-text-input input[type="email"],
.wc-block-components-text-input input[type="tel"],
.wc-block-components-text-input input[type="number"],
.wc-block-components-combobox input {
	border: 2px solid var(--apex-line);
	border-radius: 2px;
	background: var(--apex-card);
}

.wc-block-components-text-input input:focus,
.wc-block-components-combobox input:focus {
	border-color: var(--apex-ink);
	outline: 2px solid var(--apex-amber);
	outline-offset: 1px;
}

.wc-block-components-totals-item__value,
.wc-block-formatted-money-amount {
	font-family: var(--apex-ff-mono);
}

.wc-block-components-totals-footer-item {
	font-weight: 700;
	border-top: 2px solid var(--apex-ink);
}

.wc-block-components-chip {
	background: var(--apex-ink);
	color: #FFF;
	border-radius: 2px;
	font-family: var(--apex-ff-mono);
}

.wc-block-components-quantity-selector {
	border: 2px solid var(--apex-line);
	border-radius: 2px;
}

.wc-block-components-quantity-selector__button {
	color: var(--apex-ink);
}

.wc-block-components-product-name {
	font-family: var(--apex-ff-body);
	font-weight: 600;
	color: var(--apex-ink);
	text-decoration: none;
}

.wc-block-components-product-price,
.wc-block-cart-item__total {
	font-family: var(--apex-ff-mono);
}

/* Keep sidebar light: subtle separation only, no card treatment */
.wc-block-components-sidebar .wc-block-components-totals-wrapper {
	border-top: 1px solid var(--apex-line);
}

.wc-block-components-checkout-step__title {
	font-family: var(--apex-ff-display);
	text-transform: uppercase;
	letter-spacing: .03em;
}

.wc-block-components-checkout-return-to-cart-button {
	color: var(--apex-teal);
}

/* === empty states === */

.wp-block-woocommerce-empty-cart-block,
.wc-block-cart__empty-cart {
	text-align: center;
}

.wp-block-woocommerce-empty-cart-block h2,
.wc-block-cart__empty-cart h2 {
	font-family: var(--apex-ff-display);
	text-transform: uppercase;
}

.wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart__cta a,
.wc-block-cart__empty-cart .wc-block-cart__empty-cart__cta a {
	display: inline-block;
	background-color: var(--apex-amber) !important;
	color: var(--apex-ink) !important;
	font-family: var(--apex-ff-body);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .05em;
	border: 2px solid var(--apex-ink);
	border-radius: 2px;
	box-shadow: 3px 3px 0 var(--apex-ink);
	text-decoration: none;
	padding: .75em 1.5em;
}

.wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart__cta a:active,
.wc-block-cart__empty-cart .wc-block-cart__empty-cart__cta a:active {
	box-shadow: none;
	transform: translate(2px, 2px);
}

/* Hide the default oversized empty-cart illustration if present; harmless if the class is absent */
.wp-block-woocommerce-cart .wc-block-cart__empty-cart__image {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.wc-block-components-button,
	.wc-block-cart__submit-button,
	.wc-block-components-checkout-place-order-button {
		transition: none;
	}

	.wc-block-components-button:active,
	.wc-block-cart__submit-button:active,
	.wc-block-components-checkout-place-order-button:active {
		transform: none;
	}
}
