/**
 * Shop product page (products in the "shop" category).
 *
 * Loaded only on those pages, after theme.css. Colours come from the
 * Bootstrap variables set in assets/scss/customize/_overrides.scss
 * (--bs-dark, --bs-success, --bs-border-color, --bs-light2 ...).
 */

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

.yb-shop-product__breadcrumb a {
	color: inherit;
	opacity: 0.75;
	text-decoration: none;
}

.yb-shop-product__breadcrumb a:hover {
	opacity: 1;
	text-decoration: underline;
}

.yb-shop-product__crumb-sep {
	margin: 0 0.5rem;
	opacity: 0.5;
}

/* Gallery: square, bordered images
   ---------------------------------------------------------------------- */

.yb-shop-product__media {
	position: relative;
}

.yb-shop-product .woocommerce-product-gallery {
	position: relative;
}

.yb-shop-product .woocommerce-product-gallery__image {
	aspect-ratio: 1 / 1;
	background-color: var(--bs-white);
	overflow: hidden;
}

.yb-shop-product .woocommerce-product-gallery__image a,
.yb-shop-product .woocommerce-product-gallery__image img {
	display: block;
	width: 100%;
	height: 100%;
}

.yb-shop-product .woocommerce-product-gallery__image img {
	object-fit: contain;
}

/* Thumbnails (added by WooCommerce's gallery script when there is more than one image) */
.yb-shop-product .flex-control-thumbs {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 0.75rem 0 0;
	padding: 0;
	list-style: none;
}

.yb-shop-product .flex-control-thumbs li {
	aspect-ratio: 1 / 1;
	background-color: var(--bs-white);
	border: var(--bs-border-width) solid var(--bs-border-color);
	cursor: pointer;
}

.yb-shop-product .flex-control-thumbs li:has(.flex-active) {
	border-color: var(--bs-dark);
	box-shadow: inset 0 0 0 1px var(--bs-dark);
}

.yb-shop-product .flex-control-thumbs img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.yb-shop-product .flex-control-thumbs img.flex-active,
.yb-shop-product .flex-control-thumbs img:hover {
	opacity: 1;
}

/* Lightbox button, as on other product pages */
.yb-shop-product .woocommerce-product-gallery__trigger {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 5;
	padding: 0.5rem;
	font-size: 0;
	line-height: 0;
	color: var(--bs-dark);
	text-decoration: none;
}

.yb-shop-product .woocommerce-product-gallery__trigger::before {
	content: "\f00e";
	font-family: "Font Awesome 6 Pro";
	font-size: 1rem;
}

.yb-shop-product .onsale {
	position: absolute;
	top: 1rem;
	left: calc(var(--bs-gutter-x) * 0.5 + 1rem);
	z-index: 5;
}

/* Summary
   ---------------------------------------------------------------------- */

.yb-shop-specs__label,
.yb-shop-product .ybwd-pricing__title,
.yb-shop-product .ybwd-pricing__table thead th {
	letter-spacing: 0.125em;
}

.yb-shop-product__title {
	letter-spacing: -0.02em;
}

.yb-shop-product__price del {
	font-size: 0.6em;
	font-weight: 400;
	opacity: 0.6;
}

.yb-shop-product__price ins {
	text-decoration: none;
}

.yb-shop-product__unit,
.yb-shop-product__legal {
	color: rgba(var(--bs-dark-rgb), 0.75);
}

.yb-shop-product__description > :last-child {
	margin-bottom: 0;
}

/* Specs row: dividers between items, wrapping to two columns on small screens */
.yb-shop-specs__label {
	font-size: 0.6875rem;
	color: rgba(var(--bs-dark-rgb), 0.75);
}

.yb-shop-specs__item {
	border-left: var(--bs-border-width) solid var(--bs-border-color);
}

.yb-shop-specs__item:nth-child(2n + 1) {
	border-left: 0;
}

.yb-shop-specs__item:nth-child(n + 3) {
	border-top: var(--bs-border-width) solid var(--bs-border-color);
}

@media (min-width: 576px) {
	.yb-shop-specs__item:nth-child(2n + 1) {
		border-left: var(--bs-border-width) solid var(--bs-border-color);
	}

	.yb-shop-specs__item:first-child {
		border-left: 0;
	}

	.yb-shop-specs__item:nth-child(n + 3) {
		border-top: 0;
	}
}

/* Bulk discount table (Yellowbox WooCommerce Discounts markup, restyled)
   ---------------------------------------------------------------------- */

.yb-shop-product .ybwd-pricing {
	margin: 0;
}

.yb-shop-product .ybwd-pricing__title {
	margin-bottom: 0.75rem;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
}

.yb-shop-product .ybwd-pricing__table {
	font-size: 0.9375rem;
	background-color: var(--bs-white);
	border: var(--bs-border-width) solid var(--bs-border-color);
}

.yb-shop-product .ybwd-pricing__table th,
.yb-shop-product .ybwd-pricing__table td {
	padding: 0.85rem 1.1rem;
	border-bottom: var(--bs-border-width) solid var(--bs-border-color);
}

.yb-shop-product .ybwd-pricing__table thead th {
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	color: rgba(var(--bs-dark-rgb), 0.75);
	border-bottom-width: var(--bs-border-width);
}

.yb-shop-product .ybwd-pricing__table th:last-child,
.yb-shop-product .ybwd-pricing__table td:last-child {
	text-align: right;
}

.yb-shop-product .ybwd-pricing__table tbody tr:last-child td {
	border-bottom: 0;
}

/* Current tier, set by the plugin's script from the chosen quantity */
.yb-shop-product .ybwd-pricing__row--active td {
	background-color: var(--bs-light2);
	font-weight: 700;
}

.yb-shop-product .ybwd-pricing__row--active td:first-child {
	box-shadow: inset 3px 0 0 var(--bs-dark);
}

.yb-shop-product .ybwd-pricing__row td:last-child {
	white-space: nowrap;
}

.yb-shop-product .ybwd-pricing__note {
	margin-top: 0.5rem;
}

/* Add to basket: compact quantity beside the button
   ---------------------------------------------------------------------- */

.yb-shop-product__buy .stock {
	margin-bottom: 0.75rem !important;
}

.yb-shop-stock__dot {
	display: inline-block;
	width: 0.5625rem;
	height: 0.5625rem;
}

.yb-shop-product__buy form.cart:not(.variations_form) {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0;
}

/* Anything else a plugin adds inside the form takes a full row */
.yb-shop-product__buy form.cart:not(.variations_form) > :not(.quantity):not(.single_add_to_cart_button) {
	flex: 1 0 100%;
}

.yb-shop-product__buy .quantity {
	flex: 0 0 auto;
	margin: 0;
}

.yb-shop-product__buy .quantity-input-group {
	height: 100%;
	min-height: 3.25rem;
	background-color: var(--bs-white);
}

.yb-shop-product__buy .quantity-input-group input.qty {
	width: 3.25rem !important;
	font-weight: 700;
}

.yb-shop-product__buy .quantity-input-group button {
	min-width: 2.75rem;
	font-size: 1.25rem;
}

/* Keep the current green */
.yb-shop-product__buy .single_add_to_cart_button {
	flex: 1 1 13.75rem;
	min-height: 3.25rem;
	color: var(--bs-white);
	background-color: var(--bs-success);
	border-color: var(--bs-success);
	letter-spacing: 2px;
	text-transform: uppercase;
}

.yb-shop-product__buy .single_add_to_cart_button:hover,
.yb-shop-product__buy .single_add_to_cart_button:focus-visible {
	background-color: rgba(var(--bs-success-rgb), 0.9);
	border-color: rgba(var(--bs-success-rgb), 0.9);
}

/* Bulk discount nudge */
.yb-shop-nudge[hidden] {
	display: none !important;
}

/* USPs and tabs
   ---------------------------------------------------------------------- */

.yb-shop-usps__icon {
	width: 1.5rem;
	text-align: center;
	line-height: 1.4;
}

.yb-shop-product__summary .woocommerce-tabs {
	margin-top: 0;
}
