/* Frontend: compact variation buttons that keep native WooCommerce selects in DOM. */
/* Product names must remain readable in catalog grids at every screen width. */
.product-grid-item .wd-entities-title,
.product-grid-item .wd-entities-title a {
	max-height: none !important;
	height: auto !important;
	overflow: visible !important;
	white-space: normal !important;
	text-overflow: clip !important;
	-webkit-line-clamp: unset !important;
	line-clamp: unset !important;
	overflow-wrap: anywhere;
}

.sr-volume-row .sr-volume-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 6px 0 10px;
}

.sr-volume-row .sr-volume-option {
	appearance: none;
	min-width: 64px;
	padding: 8px 12px;
	border: 1px solid #d7d7d7;
	border-radius: 5px;
	background: #fff;
	color: #222;
	font: inherit;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: border-color .18s ease, background-color .18s ease, color .18s ease, opacity .18s ease;
}

.sr-volume-row .sr-volume-option:hover:not(:disabled),
.sr-volume-row .sr-volume-option:focus-visible {
	border-color: var(--wd-primary-color, #8dbd68);
	outline: none;
}

.sr-volume-row .sr-volume-option.is-selected {
	border-color: var(--wd-primary-color, #8dbd68);
	background: var(--wd-primary-color, #8dbd68);
	color: #fff;
}

.sr-volume-row .sr-volume-option[hidden] {
	display: none !important;
}

.sr-volume-row .sr-volume-option:disabled {
	opacity: .42;
	cursor: not-allowed;
}

/* Keep the WooCommerce control available to scripts while making it visually invisible. */
.sr-volume-row select.sr-volume-select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	border: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
}

.sr-volume-row .sr-volume-swatches {
	display: none !important;
}

/* Once WooCommerce has resolved a concrete variation, its live price is the
 * only price shown. Before that, WoodMart's single starting price remains. */
.single-product-page.sr-variation-selected .wd-single-price {
	display: none !important;
}

/* Keep the product photo comfortably inside a desktop viewport. The gallery
 * stays centred inside WoodMart's existing left column, while the source file
 * and the click-to-enlarge action remain unchanged for every product. */
@media (min-width: 1025px) {
	body.single-product .single-product-page .wd-single-gallery {
		width: min(100%, 520px, calc(100vh - 250px)) !important;
		max-width: 100%;
		margin-right: auto;
		margin-left: auto;
	}

	.single-product-page .wd-single-gallery .woocommerce-product-gallery,
	.single-product-page .wd-single-gallery .woocommerce-product-gallery__wrapper,
	.single-product-page .wd-single-gallery .woocommerce-product-gallery__image,
	.single-product-page .wd-single-gallery .woocommerce-product-gallery__image img {
		width: 100%;
		max-width: 100%;
	}

	.single-product-page .wd-single-gallery .woocommerce-product-gallery__image img {
		display: block;
		height: auto !important;
		max-height: min(520px, calc(100vh - 250px)) !important;
		object-fit: contain;
	}
}

/* The mobile logo lives in the top row; desktop top navigation stays hidden. */
@media (max-width: 1024px) {
	body .whb-header .whb-top-bar {
		display: block !important;
	}
	body .whb-header .whb-top-bar .whb-top-bar-inner {
		height: 64px !important;
		min-height: 64px;
		justify-content: center;
	}
	.whb-top-bar .whb-col-mobile {
		justify-content: center;
	}
	.whb-top-bar .site-logo img {
		width: 180px;
		max-width: 180px !important;
		max-height: 54px;
		height: auto;
		object-fit: contain;
	}
	.whb-top-bar .site-logo,
	.whb-top-bar .site-logo .wd-logo {
		width: 180px;
		max-width: 180px !important;
		flex: none;
	}
}

.sr-product-documents {
	margin-top: 28px;
}

.sr-product-documents h2 {
	margin-bottom: 14px;
}

.sr-product-documents-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sr-product-documents-list li + li {
	margin-top: 8px;
}

.sr-product-documents-list a {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	color: var(--wd-primary-color, #8dbd68);
	text-decoration: none;
}

.sr-product-documents-list a:hover,
.sr-product-documents-list a:focus-visible {
	text-decoration: underline;
}

.sr-document-icon {
	font-size: .85em;
	line-height: 1;
}

/* Keep the catalog archive focused on the category and product content. The
 * active WoodMart archive layout renders these controls as builder blocks,
 * so they are disabled only on WooCommerce archive pages here. */
body.woocommerce.archive .wd-shop-prod-per-page,
body.woocommerce.archive .wd-shop-view,
body.woocommerce.archive .wd-shop-ordering,
body.tax-product_cat .wd-shop-prod-per-page,
body.tax-product_cat .wd-shop-view,
body.tax-product_cat .wd-shop-ordering {
    display: none !important;
}

/* The all-products archive should start with the product grid, not the
 * legacy WoodMart category carousel. Category archives keep their own
 * subcategory tiles. */
body.post-type-archive-product .wd-cats-element {
    display: none !important;
}

/* Remove the marked account link from the thin top bar while leaving the
 * main catalog tools (search, favorites, cart) intact. */
.whb-top-bar .wd-header-my-account {
    display: none !important;
}

.whb-top-bar #menu-header-top-bar-left-vegetables,
.whb-top-bar #menu-footer-menu-1 {
    display: none !important;
}

/* Hide the legacy archive text section from WooCommerce catalog pages. */
body.woocommerce.archive #wd-dad2128b {
    display: none !important;
}

/* The footer's second menu contains the legal links followed by the old
 * catalog-category dropdowns. Keep the legal links, but remove the four
 * catalog links marked for removal from the Siberian Rain footer. */
#menu-footer-menu-1 > li.menu-item-object-product_cat,
#menu-footer-menu-2 > li.menu-item-object-product_cat {
    display: none !important;
}

/* WoodMart keeps the dismissed cookie panel translated below the viewport.
 * Its overflowing contents still enlarge the document, leaving blank space
 * below the footer. The consent panel is not used in this local demo. */
.wd-cookies-popup {
    display: none !important;
}

/* The old Header assigned a footer menu to the thin top bar. It duplicates
 * category and legal navigation, so the Siberian Rain header remains focused
 * on the catalog trigger, search and cart. */
.whb-top-bar {
    display: none !important;
}


/* Make the current catalog destination obvious in the sidebar. */
.sr-catalog-categories .sr-catalog-category-list li.current-cat > a,
.sr-catalog-categories .sr-catalog-category-list li.current-cat-parent > a {
    font-weight: 700;
}

/* Clarify the category/subcategory hierarchy in the sidebar. */
.sr-catalog-categories .sr-catalog-category-list > li {
    margin-bottom: 12px;
}

.sr-catalog-categories .sr-catalog-category-list > li > a {
    display: block;
    font-weight: 600;
}

.sr-catalog-categories .sr-catalog-category-list > li > ul.children {
    margin: 6px 0 0;
    padding: 0 0 0 16px;
    border-left: 2px solid rgba(139, 190, 101, 0.35);
}

.sr-catalog-categories .sr-catalog-category-list > li > ul.children > li {
    margin: 0 0 5px;
}

.sr-catalog-categories .sr-catalog-category-list > li > ul.children > li > a {
    display: block;
    font-weight: 400;
}

/* Admin metabox. */
.sr-documents-metabox .description {
	margin: 0 0 14px;
}

.sr-document-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: end;
	margin: 0 0 10px;
	padding: 12px;
	border: 1px solid #dcdcde;
	background: #fff;
}

.sr-document-row label {
	display: flex;
	flex: 1 1 320px;
	flex-direction: column;
	gap: 4px;
	font-weight: 600;
}

.sr-document-row .sr-document-title {
	width: 100%;
}

.sr-document-drag {
	align-self: center;
	color: #8c8f94;
	font-size: 18px;
}

.sr-document-file {
	max-width: 220px;
	overflow: hidden;
	color: #50575e;
	font-size: 12px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@media (max-width: 480px) {
	.sr-volume-row .sr-volume-option {
		min-width: 58px;
		padding: 7px 9px;
	}

	.sr-document-row {
		align-items: stretch;
	}

	.sr-document-row .sr-document-select,
	.sr-document-row .sr-document-remove {
		margin-top: 2px;
	}
}

/* The free-shipping threshold is not used in the Siberian Rain mini-cart. */
.cart-widget-side .wd-free-progress-bar {
	display: none !important;
}

/* Keep catalog purchase controls visible and allow customers to choose the
 * quantity without opening the individual product page. */
.product-grid-item.wd-hover-buttons-on-hover .product-element-bottom {
	margin-bottom: 0 !important;
	transform: none !important;
}

.product-grid-item.wd-hover-buttons-on-hover .wd-product-footer {
	opacity: 1 !important;
}

.product-grid-item .sr-loop-cart-control {
	display: flex;
	align-items: stretch;
	gap: 8px;
	width: 100%;
}

.product-grid-item .sr-loop-cart-control .quantity {
	flex: 0 0 82px;
	margin: 0;
	min-width: 0;
}

.product-grid-item .sr-loop-cart-control .quantity input.qty {
	width: 100%;
	height: var(--btn-height, 36px);
	min-height: var(--btn-height, 36px);
	text-align: center;
}

/* WoodMart sizes +/- with --wd-form-height, while the custom catalog input
 * follows the add-to-cart button height. Use one height for all three parts
 * so their upper and lower edges align in product cards. */
.product-grid-item .sr-loop-cart-control .quantity input.minus,
.product-grid-item .sr-loop-cart-control .quantity input.plus {
	height: var(--btn-height, 36px);
	min-height: var(--btn-height, 36px);
	max-height: var(--btn-height, 36px);
	box-sizing: border-box;
	padding-top: 0;
	padding-bottom: 0;
	line-height: 1;
}

.product-grid-item .sr-loop-cart-control .add-to-cart-loop {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	min-width: 0;
	height: var(--btn-height, 36px);
	padding: 0;
	border-radius: var(--btn-accented-brd-radius, var(--btn-brd-radius));
	color: var(--btn-accented-color);
	box-shadow: var(--btn-accented-box-shadow);
	background-color: var(--btn-accented-bgcolor);
}

.product-grid-item .sr-loop-cart-control .add-to-cart-loop:hover {
	color: var(--btn-accented-color-hover);
	box-shadow: var(--btn-accented-box-shadow-hover);
	background-color: var(--btn-accented-bgcolor-hover);
}

@media (max-width: 480px) {
	.product-grid-item .sr-loop-cart-control {
		gap: 6px;
	}

	.product-grid-item .sr-loop-cart-control .quantity {
		flex-basis: 70px;
	}
}

/* Keep the cart focused on the order: no delivery promo, coupon field,
 * shipping estimate or product recommendations. */
body.woocommerce-cart .wd-free-progress-bar,
body.woocommerce-cart .woocommerce-cart-form .coupon,
body.woocommerce-cart .woocommerce-shipping-totals.shipping,
body.woocommerce-cart .wd-products-element {
	display: none !important;
}

/* Checkout is used as a request form: hide coupons, address/delivery and
 * payment controls that are not part of the request. */
body.woocommerce-checkout .woocommerce-form-coupon-toggle,
body.woocommerce-checkout .woocommerce-form-coupon,
body.woocommerce-checkout #wd-62a782b5,
body.woocommerce-checkout #wd-522e9eda,
body.woocommerce-checkout #ship-to-different-address,
body.woocommerce-checkout .shipping_address,
body.woocommerce-checkout .wc_payment_methods,
body.woocommerce-checkout .woocommerce-privacy-policy-text,
body.woocommerce-checkout .woocommerce-terms-and-conditions,
body.woocommerce-checkout .woocommerce-shipping-totals,
body.woocommerce-checkout .wd-free-progress-bar {
	display: none !important;
}

body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper > .form-row:not(.sr-checkout-personal-data-consent) {
	display: none !important;
}

/* The confirmation retains the order details, but does not expose delivery,
 * payment or address information to the customer. */
body.woocommerce-order-received .woocommerce-order-overview__shipping,
body.woocommerce-order-received .woocommerce-order-overview__payment-method,
body.woocommerce-order-received .woocommerce-customer-details,
body.woocommerce-order-received .woocommerce-shipping-totals {
	display: none !important;
}

/* First-visit cookie notice. */
.sr-cookie-notice {
	position: fixed;
	z-index: 99999;
	right: 24px;
	bottom: 24px;
	display: flex;
	align-items: center;
	gap: 20px;
	max-width: min(620px, calc(100vw - 32px));
	padding: 18px 20px;
	border-radius: 8px;
	background: #263128;
	box-shadow: 0 12px 32px rgba(18, 31, 20, .25);
	color: #fff;
	font-size: 14px;
	line-height: 1.45;
}

.sr-cookie-notice p {
	margin: 0;
}

.sr-cookie-notice a {
	color: #9acb6e;
	font-weight: 700;
	text-decoration: underline;
}

.sr-cookie-notice__accept {
	flex: 0 0 auto;
	min-width: 64px;
	min-height: 40px;
	padding: 8px 16px;
	border: 0;
	border-radius: 4px;
	background: #8fbd65;
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}

.sr-cookie-notice__accept:hover,
.sr-cookie-notice__accept:focus {
	background: #79a952;
	color: #fff;
}

.sr-cookie-notice.is-hidden {
	display: none;
}

@media (max-width: 576px) {
	.sr-cookie-notice {
		right: 12px;
		bottom: 12px;
		left: 12px;
		max-width: none;
		align-items: stretch;
		flex-direction: column;
		gap: 12px;
		padding: 16px;
	}

	.sr-cookie-notice__accept {
		width: 100%;
	}
}

/* Product prices and the shared catalog/single-product sale label. */
body .price,
body .amount {
	color: #111111 !important;
	font-weight: 700 !important;
}
body .price ins,
body ins .amount {
	color: #d62828 !important;
	font-weight: 700 !important;
}
body .price del,
body del .amount {
	color: #666666 !important;
	font-weight: 500 !important;
}
.product-labels .product-label.sr-sale-label {
	background-color: #d62828 !important;
	color: #ffffff !important;
	border-radius: 5px;
	min-width: 64px;
	padding: 7px 12px;
	font-weight: 700;
}

/* Consent fields in Contact Form 7 and WooCommerce checkout. */
.wpcf7 .wpcf7-acceptance .wpcf7-list-item,
.sr-checkout-personal-data-consent .woocommerce-form__label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	color: var(--color-gray-700);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.45;
}

.wpcf7 .wpcf7-acceptance input,
.sr-checkout-personal-data-consent input {
	flex: 0 0 auto;
	margin-top: 3px;
}

.wpcf7 .wpcf7-acceptance a,
.sr-checkout-personal-data-consent a {
	color: var(--wd-primary-color);
	text-decoration: underline;
}
