/* ==========================================================================
   Product page (mock-up "6c. Product pages"): gallery, sticky buy box,
   format and language chips, stepper, details. Loads with the add-to-cart
   block.
   ========================================================================== */

.wp-block-group.ll-product {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"gallery"
		"buy"
		"details";
	gap: 18px;
}

.ll-product > * {
	margin: 0 !important;
}

.ll-gallery {
	grid-area: gallery;
	min-width: 0;
}

.ll-buy-box {
	grid-area: buy;
	min-width: 0;
}

.ll-details {
	grid-area: details;
	min-width: 0;
}

/* Gallery: big picture in a rounded pastel tile, thumbnails below */
.ll-gallery.wc-block-product-gallery {
	display: flex !important;
	flex-direction: column;
	gap: 12px;
}

.ll-gallery .wc-block-product-gallery-large-image {
	overflow: hidden;
	border-radius: var(--ll-r-lg);
	background: var(--ll-tone, var(--ll-blush));
}

.ll-gallery .wc-block-product-gallery-large-image .wc-block-components-product-image {
	background: transparent;
}

.ll-gallery .wc-block-product-gallery-large-image__wrapper {
	aspect-ratio: 4 / 5 !important;
}

.ll-gallery .wc-block-product-gallery-large-image img {
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 4 / 5 !important;
	object-fit: contain !important;
}

.ll-gallery .wc-block-product-gallery-thumbnails {
	order: 2;
	align-self: stretch;
	max-width: 100%;
}

.ll-gallery .wc-block-product-gallery-thumbnails,
.ll-gallery .wc-block-product-gallery-thumbnails__scrollable {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap;
	gap: 10px;
	width: auto !important;
	height: auto !important;
	max-height: none !important;
	overflow: visible !important;
}

/* The mock-up uses the thumbnails only, no arrows on the big picture. */
.ll-gallery [class*="large-image-next-previous"] {
	display: none !important;
}

.ll-gallery .wc-block-product-gallery-thumbnails__thumbnail {
	position: relative;
	width: 72px !important;
	height: 72px;
	flex: none !important;
	overflow: hidden;
	border: 3px solid var(--ll-white);
	border-radius: 18px;
	background: var(--ll-white);
	box-shadow: 0 0 0 2px var(--ll-line-chip);
}

.ll-gallery .wc-block-product-gallery-thumbnails__thumbnail:hover {
	box-shadow: 0 0 0 2px var(--ll-ink);
}

.ll-gallery .wc-block-product-gallery-thumbnails__thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 13px;
	opacity: 1 !important;
}

.ll-gallery .wc-block-product-gallery-thumbnails__thumbnail:has(.wc-block-product-gallery-thumbnails__thumbnail__image--is-active) {
	border-color: var(--ll-teal);
	box-shadow: 0 0 0 2px var(--ll-teal);
}

.ll-gallery .wc-block-product-gallery-thumbnails__thumbnail:has(.wc-block-product-gallery-thumbnails__thumbnail__image--is-active)::after {
	content: "";
	position: absolute;
	right: 4px;
	bottom: 4px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--ll-teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* Buy box */
.wp-block-group.ll-buy-box {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 22px 20px;
	border: 3px solid var(--ll-blush);
	border-radius: var(--ll-r-lg);
	background: var(--ll-paper);
}

html[data-ll-format="printed-laminated"] .wp-block-group.ll-buy-box {
	border-color: var(--ll-peach);
}

.ll-buy-box > * {
	margin: 0 !important;
}

.ll-product-head > * {
	margin: 0;
}

.ll-product-title {
	font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem);
	line-height: 1.05;
}

.ll-product-sub,
.ll-product-sub p {
	margin: 6px 0 0;
	color: var(--ll-ink-soft);
	font-size: 1.0625rem;
}

.ll-product-price .wc-block-components-product-price {
	color: var(--ll-berry);
	font-family: var(--ll-font-head);
	font-size: 2.4rem;
	font-weight: 700;
	line-height: 1;
}

.ll-product-price .ll-from {
	margin-right: 4px;
	font-size: 0.875rem;
}

/* Format and language: the mock-up's segmented pills */
.wc-block-add-to-cart-with-options .wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute > .wp-block-group {
	gap: 8px !important;
	margin: 0 0 16px !important;
}

.wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute-name {
	font-size: 1rem;
	font-weight: 800;
}

.wc-block-add-to-cart-with-options .wc-block-product-filter-chips {
	display: inline-grid !important;
	grid-auto-columns: minmax(0, 1fr);
	grid-auto-flow: column;
	align-self: flex-start;
	gap: 4px;
	max-width: 100%;
	padding: 4px;
	border-radius: 26px;
	background: var(--ll-lilac);
	font-size: 1rem;
}

.wc-block-add-to-cart-with-options .wc-block-product-filter-chips__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 44px;
	padding: 4px clamp(10px, 3vw, 20px);
	line-height: 1.15;
	text-align: center;
	border: 2px solid transparent;
	border-radius: var(--ll-r-pill);
	background: transparent;
	color: var(--ll-ink);
	font-weight: 800;
}

.wc-block-add-to-cart-with-options .wc-block-product-filter-chips__item:hover {
	border-color: var(--ll-l-lilac);
}

.wc-block-add-to-cart-with-options .wc-block-product-filter-chips__item[aria-checked="true"] {
	border-color: var(--ll-teal);
	background: var(--ll-white);
	color: var(--ll-teal);
}

.wc-block-add-to-cart-with-options .wc-block-product-filter-chips__item[aria-checked="true"]::before {
	content: "";
	width: 16px;
	height: 16px;
	background: currentcolor;
	-webkit-mask: var(--ll-i-check) center / contain no-repeat;
	mask: var(--ll-i-check) center / contain no-repeat;
}

.wc-block-add-to-cart-with-options .wc-block-product-filter-chips__item:focus-visible {
	outline: var(--ll-focus);
	outline-offset: 2px;
}

/* Quantity stepper and Add to cart (a PDF is bought once: no stepper) */
html[data-ll-format="pdf"] .wc-block-add-to-cart-with-options__quantity-selector {
	display: none;
}

.wc-block-add-to-cart-with-options > .wp-block-group.is-layout-flex {
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px;
}

.wc-block-add-to-cart-with-options .wc-block-add-to-cart-with-options__quantity-selector {
	flex: none;
	width: auto;
	margin: 0;
	border: 0;
}

.wc-block-add-to-cart-with-options .wc-block-components-quantity-selector {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	width: auto;
	padding: 2px;
	border: 2px solid var(--ll-ink-soft);
	border-radius: var(--ll-r-pill);
	background: var(--ll-white);
}

.wc-block-add-to-cart-with-options .wc-block-components-quantity-selector::after {
	display: none;
}

.wc-block-add-to-cart-with-options .wc-block-components-quantity-selector__button {
	display: grid;
	place-items: center;
	width: 44px;
	min-width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--ll-lilac);
	color: var(--ll-ink);
	font-size: 1.25rem;
	font-weight: 800;
	opacity: 1;
}

.wc-block-add-to-cart-with-options .wc-block-components-quantity-selector__button:hover {
	background: var(--ll-l-lilac);
}

.wc-block-add-to-cart-with-options .wc-block-components-quantity-selector__button:disabled {
	color: var(--ll-ink-soft);
	cursor: not-allowed;
}

.wc-block-add-to-cart-with-options .wc-block-components-quantity-selector__input {
	width: 46px;
	min-height: 44px;
	border: 0;
	background: transparent;
	font-size: 1.125rem;
	font-weight: 800;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

/* Next to the stepper when there's room, otherwise on its own row. */
.wc-block-add-to-cart-with-options .wc-block-components-product-button,
.wc-block-add-to-cart-with-options .wp-block-woocommerce-product-button {
	flex: 1 1 180px;
	width: auto;
	margin: 0;
}

.wc-block-add-to-cart-with-options .wc-block-components-product-button__button {
	width: 100% !important;
	min-height: 54px;
	border: 2px solid var(--ll-berry);
	border-radius: var(--ll-r-pill);
	background: var(--ll-berry);
	color: var(--ll-white);
	font-size: 1rem;
	font-weight: 800;
	white-space: nowrap;
}

.wc-block-add-to-cart-with-options .wc-block-components-product-button__button:hover {
	border-color: var(--ll-berry-dark);
	background: var(--ll-berry-dark);
}

.wc-block-add-to-cart-with-options .wc-block-components-product-button__button::before {
	content: "";
	width: 20px;
	height: 20px;
	margin-right: 8px;
	background: currentcolor;
	-webkit-mask: var(--ll-i-cart) center / contain no-repeat;
	mask: var(--ll-i-cart) center / contain no-repeat;
}

.ll-other-languages {
	color: var(--ll-ink-soft);
	font-size: 0.9375rem;
}

/* Details */
.ll-details > * {
	margin-block: 0;
}

.wp-block-group.ll-whats-in {
	border-radius: var(--ll-r-lg);
}

.ll-whats-in h2 {
	margin: 0 0 14px;
	font-size: 1.5rem;
}

.ll-details-title {
	margin: 22px 0 12px !important;
	font-size: 1.5rem;
}

.ll-details .wp-block-details + .wp-block-details {
	margin-top: 10px;
}

.ll-details .wp-block-details h3 {
	font-size: 1.0625rem;
}

.ll-details .wp-block-details .ll-whats-included {
	padding-left: 1.2em;
}

@media (min-width: 900px) {

	.wp-block-group.ll-product {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		grid-template-rows: auto 1fr;
		grid-template-areas:
			"gallery buy"
			"details buy";
		align-items: start;
		gap: 26px 40px;
	}

	/* Sticky buy box; buy-box.js lowers "top" when the box is taller than
	   the window. */
	.wp-block-group.ll-buy-box {
		position: sticky;
		top: 24px;
		gap: 16px;
		padding: 28px 30px;
	}

	.ll-gallery .wc-block-product-gallery-thumbnails__thumbnail {
		width: 84px !important;
		height: 84px;
	}

	.ll-card-grid-4 .wc-block-product-template {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}
