/* Sea of Herbs: customer-experience fixes from the design review of Dec 2, 2026.
   Loaded after site.css by wp-content/mu-plugins/soh-cx.php. Deleting that one file switches all of this off.
   Sections: 1 product page on phones · 2 sale label · 3 photo-coming caption · 4 cookie banner · 5 chat button
   · 6 tap sizes · 7 contrast · 8 free-shipping bar. */

/* ---- 1a. Product photo shows at once. WooCommerce keeps the whole gallery invisible until all scripts have run,
   which left a blank box for seconds on slow phones. Until the slider starts, only the first photo is laid out. ---- */
body .soh-product .woocommerce-product-gallery { opacity: 1 !important; }
body .soh-product .woocommerce-product-gallery .flex-viewport > .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:nth-child(n+2):not([style]), body .soh-product .woocommerce-product-gallery > .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:nth-child(n+2) { display: none !important; }

/* ---- 1. Product page on phones: smaller photo, then title, price and Add to basket on the first screen ---- */
@media (max-width: 781px) {
	.soh-product .soh-product__top { row-gap: 14px !important; }
	body .soh-product .soh-product__gallery .woocommerce-product-gallery { box-sizing: border-box; width: 100%; margin-bottom: 0 !important; padding: 8px; background: #F6EFE3; }
	body .soh-product .woocommerce-product-gallery .flex-viewport { height: auto !important; }
	body .soh-product .woocommerce-product-gallery .woocommerce-product-gallery__image > a,
	body .soh-product .woocommerce-product-gallery .woocommerce-product-gallery__image--placeholder { display: block; }
	body .soh-product .woocommerce-product-gallery .woocommerce-product-gallery__image img,
	body .soh-product .woocommerce-product-gallery .woocommerce-product-gallery__image--placeholder img {
		width: 100%;
		height: min(58vw, 220px) !important;
		object-fit: contain;
	}
	body .soh-product .woocommerce-product-gallery .flex-control-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
	body .soh-product .woocommerce-product-gallery .flex-control-thumbs li { float: none; width: 52px !important; margin: 0 !important; }
	body .soh-product .woocommerce-product-gallery .flex-control-thumbs li img { display: block; width: 52px; height: 52px !important; object-fit: cover; }
	/* 1b. Until the slider starts, keep room for the row of small photos, so the page doesn't jump when it appears (Dec 5). */
	body .soh-product .woocommerce-product-gallery:not(:has(.flex-control-nav)):has(> .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:nth-child(2))::after { content: ""; display: block; height: 52px; }

	/* Title, rating, price, then the buy row; the description follows the button. */
	.soh-product .soh-product__summary { display: flex; flex-direction: column; }
	.soh-product .soh-product__summary > * { order: 5; }
	.soh-product .soh-product__summary > .wp-block-post-terms,
	.soh-product .soh-product__summary > .soh-eyebrow { order: 1; }
	.soh-product .soh-product__summary > .soh-product__title { order: 2; margin-block-start: 6px; }
	.soh-product .soh-product__summary > .wp-block-woocommerce-product-rating { order: 3; }
	.soh-product .soh-product__summary > .soh-product__price { order: 3; margin-block-start: 8px; }
	.soh-product .soh-product__summary > .soh-product__buy { order: 4; margin-block-start: 10px; }
	.soh-product .soh-product__summary > .soh-product__buy form.cart { margin-bottom: 8px; }
	.soh-product .soh-product__summary > .soh-product__excerpt { margin-block-start: 14px; }
}

/* ---- 2. Sale label on the product page: the same red label as on the product cards ---- */
body .soh-product .woocommerce-product-gallery { position: relative; }
body .soh-product span.onsale {
	position: absolute;
	top: 12px !important;
	left: 12px !important;
	right: auto !important;
	z-index: 9;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 6px 9px;
	border-radius: 2px;
	background: #A3262A;
	color: #fff;
	font: 600 12px/1 var(--soh-sans);
	letter-spacing: .04em;
	text-transform: uppercase;
}
[dir="rtl"] body .soh-product span.onsale,
body[dir="rtl"] .soh-product span.onsale,
html[dir="rtl"] body .soh-product span.onsale { left: auto !important; right: 12px !important; letter-spacing: 0; }

/* ---- 3. "Photo coming soon" under the placeholder drawing (the drawing itself has no words) ---- */
.wc-block-components-product-image:has(img.soh-photo-coming),
.woocommerce-product-gallery__image--placeholder { position: relative; }
.wc-block-components-product-image:has(img.soh-photo-coming)::after,
.woocommerce-product-gallery__image--placeholder::after {
	content: "Photo coming soon";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 5%;
	color: var(--soh-muted, #6E604E);
	font: 600 10px/1.2 var(--soh-sans);
	letter-spacing: .1em;
	text-align: center;
	text-transform: uppercase;
	pointer-events: none;
}
.woocommerce-product-gallery__image--placeholder::after { font-size: 12px; letter-spacing: .14em; }
html:lang(ar) .wc-block-components-product-image:has(img.soh-photo-coming)::after,
html:lang(ar) .woocommerce-product-gallery__image--placeholder::after { content: "الصورة قريبًا"; font-size: 12px; letter-spacing: 0; }
html:lang(he) .wc-block-components-product-image:has(img.soh-photo-coming)::after,
html:lang(he) .woocommerce-product-gallery__image--placeholder::after { content: "התמונה בקרוב"; font-size: 12px; letter-spacing: .02em; }
img.soh-photo-coming { background: #F6EFE3; }

/* ---- 4. Cookie banner: above the basket page's checkout bar; shorter and easier to tap on phones ---- */
#cookie-notice { z-index: 10010; }
#cookie-notice .cn-close-icon { top: 2px; right: 2px; left: auto; width: 44px; height: 44px; margin: 0; padding: 0; opacity: .85; transform: none; }
#cookie-notice .cn-close-icon::before,
#cookie-notice .cn-close-icon::after { top: 14px; left: 21px; background-color: #FBF8F2; }
[dir="rtl"] #cookie-notice .cn-close-icon { right: auto; left: 2px; }
#cookie-notice .cn-button { min-height: 40px; }
@media (max-width: 560px) {
	#cookie-notice .cookie-notice-container { padding: 12px 14px; text-align: start; }
	#cookie-notice #cn-notice-text { display: block; margin: 0 0 10px; padding-inline-end: 34px; font-size: 13px; line-height: 1.4; }
	#cookie-notice #cn-notice-buttons { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 8px; }
	#cookie-notice #cn-notice-buttons .cn-button { flex: 1 1 0; min-width: 0; min-height: 44px; margin: 0; padding: 8px 8px; font-size: 13px; line-height: 1.2; white-space: normal; }
	#cookie-notice #cn-notice-buttons #cn-more-info { flex: 0 1 auto; }
}

/* ---- 5. Chat button on phones: shrinks to its star once the visitor scrolls (cx.js adds .is-compact); stays clear of the basket page's checkout bar ---- */
@media (max-width: 560px) {
	.soh-chat-btn.is-compact { gap: 0; width: 48px; height: 48px; padding: 0; justify-content: center; }
	.soh-chat-btn.is-compact > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* First visit on a phone: one layer at a time. The chat button waits until the cookie question is answered,
   so it never sits on top of "Add to basket". */
@media (max-width: 560px) {
	body .soh-chat-btn { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
	body:has(#cookie-notice.cookie-notice-visible) .soh-chat-btn { display: none; }
}
body:has(.wc-block-cart__submit-container--sticky) .soh-chat-btn { bottom: max(calc(96px + env(safe-area-inset-bottom, 0px)), var(--soh-cookie-lift, 0px)); }
@media (max-width: 560px) {
	body:has(.wc-block-cart__submit-container--sticky) .soh-chat-btn { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- 6. Tap sizes (at least 44 px where a finger lands) ---- */
.soh-site-header .wp-block-navigation__responsive-container-open { box-sizing: content-box; margin: -10px; padding: 10px; }
.soh-site-header a.dgwt-wcas-search-icon,
.soh-site-header a.dgwt-wcas-enable-mobile-form { box-sizing: content-box; }
.soh-site-header .dgwt-wcas-search-icon { margin: -12px; padding: 12px; }
.wp-block-query-pagination .page-numbers,
.woocommerce-pagination .page-numbers li > * { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 999px; }
.wp-block-query-pagination .page-numbers.current,
.woocommerce-pagination .page-numbers li > .current { background: var(--soh-stone, #EADFCB); font-weight: 700; }
.wp-block-query-pagination .wp-block-query-pagination-next,
.wp-block-query-pagination .wp-block-query-pagination-previous { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 8px; }
.wp-block-query-pagination-numbers { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.woocommerce-form-login__rememberme { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.woocommerce-form-login__rememberme input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--soh-leaf, #037952); }
.wc-block-components-quantity-selector { min-height: 40px; }
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button { min-width: 40px; min-height: 40px; }
.wc-block-cart-item__remove-link { min-width: 40px; min-height: 40px; }

/* ---- 7. Contrast (WCAG AA) ---- */
.soh-shop__head summary > span { color: var(--soh-leaf-deep, #02603F); }
.soh-shop__head.soh-shop__head--dark summary > span { color: #F2C56B; }
.woocommerce-account main .soh-eyebrow--saffron { color: var(--soh-saffron-deep, #9A4E17); }

/* ---- 8. Free-shipping bar: the progress bar appears from halfway; before that, a quiet link to the shipping page (cx.js) ---- */
.soh-freeship.soh-freeship--far { display: none; }
.soh-freeship__more { margin: 6px 0 12px; font: 13px/1.4 var(--soh-sans); }
.soh-freeship__more a { color: var(--soh-leaf-deep, #02603F); text-decoration: underline; text-underline-offset: 2px; }
.wc-block-mini-cart__drawer .soh-freeship__more { position: relative; z-index: 1; margin: 6px 16px 10px; }
.wc-block-mini-cart__drawer .soh-freeship--far + .soh-freeship__more { margin-top: 18px; }
.soh-freeship__more[hidden] { display: none; }
