/* Child-theme CSS addons (Hammas32). */

/* Soft notice under #billing_email — shown only while value is @mail.ru. */
.hammas32-mailru-notice {
	color: #555;
	display: none;
	font-size: 0.85rem;
	line-height: 1.35;
	margin: 0.45rem 0 0;
}

.hammas32-mailru-notice.is-visible {
	display: block;
}

/* Pink CTA colour (Ken 26.10): same values as the product page add-to-cart button. */
:root {
	--hammas32-cta-pink: #f82ea6;
	--hammas32-cta-pink-hover: #d91f8f;
	--hammas32-soft-pink: #f8e0f0;
}

/*
 * Category / archive / shortcode / related-products "Lisa korvi" buttons: same pink as the product page (Ken 26.10).
 * Size stays Flatsome's "is-small" (only colors change). Out-of-stock "Loe edasi" buttons have no add_to_cart_button class and stay as they are.
 */
.products .product .button.add_to_cart_button,
.product-small .button.add_to_cart_button,
.products .product .button.add_to_cart_button.primary {
	background-color: var(--hammas32-cta-pink) !important;
	border-color: var(--hammas32-cta-pink) !important;
	color: #fff !important;
}

.products .product .button.add_to_cart_button:hover,
.products .product .button.add_to_cart_button:focus-visible,
.product-small .button.add_to_cart_button:hover,
.product-small .button.add_to_cart_button:focus-visible {
	background-color: var(--hammas32-cta-pink-hover) !important;
	border-color: var(--hammas32-cta-pink-hover) !important;
	color: #fff !important;
}

/* Touch devices: no sticky :hover shade after a tap. */
@media (hover: none) {
	.products .product .button.add_to_cart_button:hover,
	.product-small .button.add_to_cart_button:hover {
		background-color: var(--hammas32-cta-pink) !important;
		border-color: var(--hammas32-cta-pink) !important;
	}
}

.products .product .button.add_to_cart_button.disabled,
.products .product .button.add_to_cart_button:disabled {
	background-color: var(--hammas32-cta-pink) !important;
	border-color: var(--hammas32-cta-pink) !important;
	opacity: 0.5;
}

/* -------------------------------------------------------------------------
 * YITH "Telli lisaks" — touch targets and contrast (PDP a11y)
 * ------------------------------------------------------------------------- */

/* Heading was Flatsome h3 #49aced (~2.5:1 on white). Dark blue on a soft blue band (Ken 24.10), contrast ~7.7:1. */
#yith-wapo-container .wapo-addon-title,
#yith-wapo-container h3.wapo-addon-title,
#yith-wapo-container .addon-header .wapo-addon-title,
#yith-wapo-container .addon-header h3.wapo-addon-title,
#yith-wapo-container .wapo-addon-title span,
#yith-wapo-container h3.wapo-addon-title span {
	color: #0b4f8a !important;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
}

#yith-wapo-container .wapo-addon-title,
#yith-wapo-container h3.wapo-addon-title {
	background: #eaf4fc;
	border-radius: 6px;
	margin: 1.75rem 0 0.6rem;
	padding: 0.5rem 0.75rem;
}

/* Larger checkbox hit area (≥44px). Whole option row is clickable (JS). */
#yith-wapo-container .yith-wapo-option {
	box-sizing: border-box;
	cursor: pointer;
	margin: 0 0 0.65rem;
	min-height: 44px;
	padding: 0.35rem 0.25rem;
	position: relative;
}

#yith-wapo-container .yith-wapo-option .checkbox-button-container,
#yith-wapo-container .yith-wapo-option .checkboxbutton {
	align-items: center;
	display: inline-flex;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
}

#yith-wapo-container .yith-wapo-option input[type="checkbox"],
#yith-wapo-container .yith-wapo-option input.yith-wapo-option-value {
	height: 22px !important;
	margin: 0;
	min-height: 22px;
	min-width: 22px;
	transform: scale(1.35);
	transform-origin: center center;
	width: 22px !important;
}

#yith-wapo-container .yith-wapo-option .label,
#yith-wapo-container .yith-wapo-option label,
#yith-wapo-container .yith-wapo-addon-label {
	cursor: pointer;
	font-size: 0.95rem;
	line-height: 1.35;
	min-height: 44px;
}

#yith-wapo-container .yith-wapo-option .price,
#yith-wapo-container .yith-wapo-option .woocommerce-Price-amount {
	color: #1a1a1a;
	font-weight: 700;
}

/* Cart / PDP pink CTAs: keep Ken's approved brand pink. */
.single-product form.cart .single_add_to_cart_button.button,
.single-product form.cart button.single_add_to_cart_button,
.single-product .sticky-add-to-cart .single_add_to_cart_button.button,
.single-product .sticky-add-to-cart button.single_add_to_cart_button,
.woocommerce-cart .cart_totals a.checkout-button.button,
.woocommerce-cart a.checkout-button.button.alt,
.woocommerce-cart a.checkout-button {
	background-color: #f82ea6 !important;
	border-color: #f82ea6 !important;
	color: #fff !important;
	min-height: 44px;
}

.single-product form.cart .single_add_to_cart_button.button:hover,
.single-product form.cart button.single_add_to_cart_button:hover,
.single-product .sticky-add-to-cart .single_add_to_cart_button.button:hover,
.woocommerce-cart .cart_totals a.checkout-button.button:hover,
.woocommerce-cart a.checkout-button.button.alt:hover,
.woocommerce-cart a.checkout-button:hover {
	background-color: #d91f8f !important;
	border-color: #d91f8f !important;
	color: #fff !important;
}

/* Cart / mini-cart: larger remove × and qty controls. */
.woocommerce-cart .product-remove a.remove,
.woocommerce-mini-cart-item a.remove {
	align-items: center;
	display: inline-flex !important;
	font-size: 1.35rem !important;
	height: 44px !important;
	justify-content: center;
	line-height: 1 !important;
	min-height: 44px !important;
	min-width: 44px !important;
	width: 44px !important;
}

/* Qty row: match +/- and input at 36px (Flatsome button height:44 was winning over min-height). */
.woocommerce-cart .product-quantity .quantity,
.woocommerce-cart .product-quantity .buttons_added,
.woocommerce-checkout .product-quantity .quantity,
.woocommerce-checkout .product-quantity .buttons_added,
.woocommerce-checkout .quantity.buttons_added {
	align-items: center;
	display: inline-flex;
	height: 36px;
	min-height: 36px;
}

.woocommerce-cart .product-quantity .qty,
.woocommerce-cart .product-quantity input.qty,
.woocommerce-checkout .product-quantity .qty,
.woocommerce-checkout .product-quantity input.qty,
.woocommerce-checkout .quantity input.qty {
	box-sizing: border-box !important;
	/* 16px: iOS Safari zooms inputs with font-size < 16px on focus (#65 / Ken iPhone). */
	font-size: 16px !important;
	height: 36px !important;
	line-height: 36px !important;
	min-height: 36px !important;
	min-width: 2.4rem;
	max-width: 3.2rem;
	padding: 0 0.35rem !important;
	text-align: center !important;
	vertical-align: middle;
}

.woocommerce-cart .product-quantity .minus,
.woocommerce-cart .product-quantity .plus,
.woocommerce-checkout .product-quantity .minus,
.woocommerce-checkout .product-quantity .plus,
.woocommerce-checkout .quantity .minus,
.woocommerce-checkout .quantity .plus {
	align-items: center !important;
	box-sizing: border-box !important;
	display: inline-flex !important;
	font-size: 0.85rem !important;
	height: 36px !important;
	justify-content: center !important;
	line-height: 1 !important;
	min-height: 36px !important;
	min-width: 36px !important;
	padding: 0 !important;
	width: 36px !important;
}

/* Cart / checkout: larger product names (Ken 30.10 / #18); mobile slightly smaller (Ken 03.11). */
.woocommerce-cart table.shop_table .product-name,
.woocommerce-cart table.shop_table .product-name a,
.woocommerce-checkout table.shop_table .product-name,
.woocommerce-checkout table.shop_table .product-name a,
.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name,
.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name a {
	font-size: 1.05rem !important;
	line-height: 1.35 !important;
	font-weight: 600;
}

@media (max-width: 549px) {
	.woocommerce-cart table.shop_table .product-name,
	.woocommerce-cart table.shop_table .product-name a,
	.woocommerce-checkout table.shop_table .product-name,
	.woocommerce-checkout table.shop_table .product-name a,
	.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name,
	.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name a {
		/* Between pre-#63 (~theme default) and 1.05rem - fits ~3-4 lines on 390. */
		font-size: 0.95rem !important;
		line-height: 1.3 !important;
	}
}

/* Companion qty note (editable field; not locked to brush). */
.hammas32-wapo-companion-note {
	color: #555;
	display: block;
	font-size: 0.78rem;
	font-weight: 400;
	line-height: 1.3;
	margin-top: 0.25rem;
	max-width: 10rem;
}

/* -------------------------------------------------------------------------
 * Sticky "MINE MAKSMA" on cart (mobile) — avoid two-screen scroll to CTA
 * ------------------------------------------------------------------------- */

.hammas32-sticky-checkout {
	display: none;
}

@media (max-width: 849px) {
	body.woocommerce-cart {
		padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
	}

	.hammas32-sticky-checkout {
		align-items: center;
		background: #fff;
		border-top: 1px solid #e5e5e5;
		bottom: 0;
		box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
		box-sizing: border-box;
		display: flex;
		gap: 0.65rem;
		justify-content: space-between;
		left: 0;
		padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
		position: fixed;
		right: 0;
		z-index: 99;
	}

	.hammas32-sticky-checkout__total {
		color: #222;
		font-size: 0.95rem;
		font-weight: 700;
		line-height: 1.25;
		min-width: 0;
	}

	.hammas32-sticky-checkout__total small {
		color: #555;
		display: block;
		font-size: 0.72rem;
		font-weight: 400;
	}

	.hammas32-sticky-checkout__btn {
		align-items: center;
		background-color: #f82ea6 !important;
		border-color: #f82ea6 !important;
		box-sizing: border-box;
		color: #fff !important;
		display: inline-flex !important;
		flex: 0 0 auto;
		font-size: 0.95rem !important;
		font-weight: 700;
		justify-content: center;
		line-height: 1.2 !important;
		margin: 0 !important;
		min-height: 44px !important;
		min-width: 9.5rem;
		padding: 0.65rem 1rem !important;
		text-align: center;
		text-transform: uppercase;
		white-space: nowrap;
	}

	.hammas32-sticky-checkout__btn:hover,
	.hammas32-sticky-checkout__btn:focus {
		background-color: #d91f8f !important;
		border-color: #d91f8f !important;
		color: #fff !important;
	}
}

/* Telli ja säästa: tavahind läbi kriipsutatud + lisavaliku hind (Ken 22.10). */
#yith-wapo-container .hammas32-wapo-sale-price {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.4em;
	font-size: 0.95rem;
}
#yith-wapo-container .hammas32-wapo-sale-price del,
#yith-wapo-container .hammas32-wapo-sale-price del .woocommerce-Price-amount {
	color: #6b6b6b !important;
	font-weight: 400 !important;
	opacity: 1 !important;
}
#yith-wapo-container .hammas32-wapo-sale-price ins {
	text-decoration: none;
}
#yith-wapo-container .hammas32-wapo-sale-price ins .woocommerce-Price-amount {
	color: #f82ea6 !important;
	font-weight: 700;
	font-size: 1.05rem;
}

/* Telli ja säästa: lisatoote pilt (Ken 02.11: väiksem scroll; lähte 150px, nähtav ~76/60). */
#yith-wapo-container .yith-wapo-option .option-container {
	align-items: center !important;
	gap: 0.65rem !important;
}
#yith-wapo-container .yith-wapo-option .image-container {
	flex: 0 0 76px;
	width: 76px !important;
	max-width: 76px;
}
#yith-wapo-container .yith-wapo-option .image-container img {
	width: 76px !important;
	height: 76px !important;
	max-width: none;
	object-fit: contain;
	border-radius: 6px;
}
@media (max-width: 549px) {
	#yith-wapo-container .yith-wapo-option .image-container {
		flex-basis: 60px;
		width: 60px !important;
		max-width: 60px;
	}
	#yith-wapo-container .yith-wapo-option .image-container img {
		width: 60px !important;
		height: 60px !important;
	}
}

/* Telli ja säästa: säästu märk "-10%" (Ken tooteleht2). */
#yith-wapo-container .hammas32-wapo-save-badge {
	background: #fde4f2;
	border-radius: 4px;
	color: #e0218a;
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.2;
	padding: 0.15em 0.45em;
	white-space: nowrap;
}

/* -------------------------------------------------------------------------
 * Telli ja säästa: kaardi paigutus (Ken tooteleht2 + 02.11). Iga valik on
 * ümarate nurkadega raamiga kaart; pealkirjakast ja tootekastid sama laiusega
 * (100%, joondatud). Pildi suurus 76px / 60px (Ken 02.11).
 * ------------------------------------------------------------------------- */
#yith-wapo-container .wapo-addon,
#yith-wapo-container .yith-wapo-addons-container,
#yith-wapo-container .yith-wapo-addon-type-checkbox {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}
#yith-wapo-container .wapo-addon-title,
#yith-wapo-container h3.wapo-addon-title {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option {
	box-sizing: border-box;
	margin: 0 0 0.55rem;
	padding: 0;
	width: 100%;
	max-width: 100%;
}
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option .option-container {
	box-sizing: border-box;
	display: flex !important;
	flex-wrap: nowrap;
	align-items: center !important;
	gap: 0.7rem !important;
	padding: 0.45rem 0.75rem 0.45rem calc(56px + 0.55rem);
	position: relative;
	min-height: 56px;
	width: 100%;
}
/* The card frame, drawn behind image + text, leaving room for the checkbox. */
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option .option-container::before {
	background: #fff;
	border: 1px solid #d9d9d9;
	border-radius: 8px;
	bottom: 0;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	content: "";
	left: 56px;
	position: absolute;
	right: 0;
	top: 0;
	transition: border-color 0.15s ease;
	z-index: 0;
}
/* Hover only on devices that really hover: on touch :hover sticks to the last tapped card. */
@media (hover: hover) and (pointer: fine) {
	#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option:hover .option-container::before {
		border-color: #f82ea6;
	}
}
/* Selected card: pink frame follows the checkbox state (class set by addons.js, :has() as a bonus). */
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option.hammas32-is-checked .option-container::before {
	background: #fff7fc;
	border-color: #f82ea6;
	box-shadow: 0 0 0 1px #f82ea6;
}
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option:has(input[type="checkbox"]:checked) .option-container::before {
	background: #fff7fc;
	border-color: #f82ea6;
	box-shadow: 0 0 0 1px #f82ea6;
}
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option {
	-webkit-tap-highlight-color: transparent;
}
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option .image-container,
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option .checkbox-button-container {
	position: relative;
	z-index: 1;
}
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option .checkbox-button-container {
	display: block !important;
	flex: 1 1 auto;
	min-height: 0;
	min-width: 0;
	position: static;
}
/* Checkbox: large, left of the card, vertically centred. */
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option .checkboxbutton {
	left: 0;
	margin: 0 !important;
	min-height: 44px;
	min-width: 44px;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 1;
}
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option .checkboxbutton input[type="checkbox"] {
	height: 26px !important;
	min-height: 26px;
	min-width: 26px;
	transform: scale(1.3);
	width: 26px !important;
}
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option label.yith-wapo-addon-label {
	display: block;
	min-height: 0;
	position: relative;
	z-index: 1;
}
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option label.yith-wapo-addon-label a {
	color: #1a1a1a;
	display: block;
	font-weight: 400;
	margin-bottom: 0.2rem;
}
#yith-wapo-container .yith-wapo-addon-type-checkbox .hammas32-wapo-sale-price {
	align-items: center;
	gap: 0.55em;
}
#yith-wapo-container .yith-wapo-addon-type-checkbox .hammas32-wapo-sale-price del,
#yith-wapo-container .yith-wapo-addon-type-checkbox .hammas32-wapo-sale-price del .woocommerce-Price-amount {
	color: #6b6b6b !important;
	font-size: 0.9rem;
	opacity: 1 !important;
}
#yith-wapo-container .yith-wapo-addon-type-checkbox .hammas32-wapo-sale-price ins .woocommerce-Price-amount {
	color: #1a1a1a !important;
	font-size: 1rem;
	font-weight: 700;
}
@media (max-width: 549px) {
	#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option .option-container {
		gap: 0.65rem !important;
		padding: 0.5rem 0.6rem 0.5rem calc(48px + 0.5rem);
	}
	#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option .option-container::before {
		left: 48px;
	}
}

/* Telli ja säästa: kogu kaart on klikitav (JS toggles checkbox once). */
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option,
#yith-wapo-container .yith-wapo-addon-type-checkbox .yith-wapo-option * {
	cursor: pointer;
}

/* Free-shipping hint (cart only): light-blue box above "Jätka ostlemist", Ken 26.10 (not shipping row / checkout). */
.woocommerce-cart .hammas32-free-ship-notice {
	background-color: #eaf4fc;
	border-radius: 6px;
	box-sizing: border-box;
	clear: both;
	color: #1a1a1a;
	font-size: 1em;
	font-weight: 400;
	line-height: 1.4;
	margin: 0 0 1rem;
	padding: 0.65rem 0.85rem;
	text-align: left;
	width: 100%;
}
