/* MY2LK V1 mobile storefront QA refinements */

/* Force the approved transparent MY2LK full logo to display at useful size. */
.my2lk-header-main {
	min-height: 132px !important;
}
.my2lk-header-main .my2lk-wordmark {
	overflow: visible;
}
.my2lk-header-main .my2lk-wordmark img {
	display: block !important;
	width: 260px !important;
	height: auto !important;
	max-width: none !important;
	max-height: 116px !important;
	object-fit: contain !important;
	object-position: left center !important;
	clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%, 0 20%, 16% 20%);
}
.my2lk-wordmark--footer img {
	display: block !important;
	width: 235px !important;
	height: auto !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: contain !important;
	clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%, 0 20%, 16% 20%);
}

.my2lk-mobile-nav { display: none; border-top: 1px solid var(--my2lk-line); border-bottom: 1px solid var(--my2lk-line); background: #fff; }
.my2lk-mobile-nav .my2lk-container { display: flex; gap: 8px; align-items: center; overflow-x: auto; padding-block: 8px; scrollbar-width: none; }
.my2lk-mobile-nav .my2lk-container::-webkit-scrollbar { display: none; }
.my2lk-mobile-nav a { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--my2lk-line); border-radius: 999px; color: var(--my2lk-ink); background: var(--my2lk-bg); font-size: 12px; font-weight: 750; line-height: 1.2; text-decoration: none; }
.my2lk-mobile-nav a:first-child { color: #fff; border-color: var(--my2lk-green); background: var(--my2lk-green); }

/* Small global confirmation toast for cart actions. */
.my2lk-cart-toast {
	position: fixed; right: 22px; bottom: 22px; z-index: 99999; max-width: min(360px, calc(100vw - 32px));
	padding: 13px 18px; border-radius: 10px; color: #fff; background: var(--my2lk-green-dark, #064e3b);
	box-shadow: 0 12px 30px rgba(0,0,0,.18); font-size: 14px; font-weight: 750; line-height: 1.3;
	opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.my2lk-cart-toast.is-visible { opacity: 1; transform: translateY(0); }

/* Checkout guidance and Sri Lanka IDD phone format. */
.woocommerce-checkout .my2lk-checkout-guide {
	display: grid;
	gap: 5px;
	margin: 0 0 22px;
	padding: 14px 16px;
	border: 1px solid #cfe3d8;
	border-radius: 12px;
	background: #f2faf6;
	color: var(--my2lk-ink);
	font-size: 13px;
	line-height: 1.5;
}
.woocommerce-checkout .my2lk-checkout-guide strong { color: var(--my2lk-green-dark); font-size: 14px; }
.woocommerce-checkout .my2lk-phone-row {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr);
	gap: 8px;
	align-items: stretch;
}
.woocommerce-checkout .my2lk-phone-prefix {
	width: 100%;
	min-height: 48px;
	padding: 0 12px;
	border: 1px solid #50575e;
	border-radius: 4px;
	background: #fff;
	color: #1f2933;
	font-size: 14px;
}
.woocommerce-checkout .my2lk-phone-row input { width: 100% !important; min-width: 0; }
.woocommerce-checkout .my2lk-field-help {
	display: block;
	margin-top: 6px;
	color: #59636e;
	font-size: 12px;
	line-height: 1.4;
}

@media (max-width: 980px) {
	.my2lk-header-main {
		min-height: 104px !important;
		gap: 14px;
	}
	.my2lk-header-main .my2lk-wordmark img {
		width: 205px !important;
		max-height: 92px !important;
	}
	.my2lk-mobile-nav { display: block; }
	.my2lk-header-actions { gap: 10px; }
	.my2lk-cart-link { min-height: 38px; }
	.my2lk-hero { padding-top: 44px; }
	.my2lk-section__heading { gap: 12px; align-items: flex-start; flex-direction: column; }
	.my2lk-section__heading > a { padding-bottom: 0; }
	.my2lk-source__card { gap: 24px; }
}

@media (max-width: 640px) {
	.my2lk-service-bar { font-size: 11px; }
	.my2lk-service-bar .my2lk-container { min-height: 28px; }
	.my2lk-header-main { min-height: 88px !important; }
	.my2lk-header-main .my2lk-wordmark img {
		width: 155px !important;
		max-height: 72px !important;
	}
	.my2lk-wordmark--footer img { width: 190px !important; }
	.my2lk-cart-link { min-height: 36px; padding: 6px 9px; font-size: 12px; }
	.my2lk-mobile-nav .my2lk-container { width: min(100% - 20px, 1180px); }
	.my2lk-mobile-nav a { padding: 7px 10px; font-size: 11px; }
	.my2lk-cart-toast { right: 16px; bottom: 16px; left: 16px; max-width: none; text-align: center; }
	.woocommerce-checkout .my2lk-phone-row { grid-template-columns: 126px minmax(0, 1fr); gap: 6px; }
	.woocommerce-checkout .my2lk-phone-prefix { padding: 0 8px; font-size: 12px; }

	.my2lk-hero { min-height: 660px; padding: 34px 0 38px; }
	.my2lk-hero__content { margin-top: 260px; padding: 22px 18px; }
	.my2lk-hero h1 { font-size: clamp(36px, 11vw, 50px); }
	.my2lk-hero__lead { font-size: 16px; line-height: 1.45; }
	.my2lk-hero__actions { gap: 9px; margin-top: 22px; }
	.my2lk-button { min-height: 44px; padding: 10px 16px; }
	.my2lk-search { margin-top: 20px; }
	.my2lk-trust__grid { grid-template-columns: 1fr 1fr; }
	.my2lk-trust__grid > div { min-width: 0; padding: 15px 10px; }
	.my2lk-trust strong { font-size: 13px; }
	.my2lk-trust span { font-size: 11px; line-height: 1.35; }

	.my2lk-home .my2lk-section--products ul.products,
	.woocommerce-shop ul.products,
	.tax-product_cat ul.products { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
	.my2lk-home .my2lk-section--products ul.products li.product,
	.woocommerce-shop ul.products li.product,
	.tax-product_cat ul.products li.product {
		float: none !important;
		clear: none !important;
		grid-column: auto !important;
		grid-row: auto !important;
		width: auto !important;
		margin: 0 !important;
	}
	/* Avada marks loop cards first/last and may retain row-placement rules from
	 * its float layout. In the MY2LK mobile grid those markers must not reserve
	 * or skip a column. */
	.woocommerce-shop ul.products li.product.first,
	.woocommerce-shop ul.products li.product.last,
	.tax-product_cat ul.products li.product.first,
	.tax-product_cat ul.products li.product.last {
		clear: none !important;
		grid-column: auto !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
	.woocommerce-shop ul.products::before,
	.woocommerce-shop ul.products::after,
	.tax-product_cat ul.products::before,
	.tax-product_cat ul.products::after {
		display: none !important;
		content: none !important;
	}

	/* Equal-height mobile card internals: pin purchase controls to the bottom so
	 * different title lengths do not stagger cart icons across a row. */
	body.woocommerce-shop ul.products li.product,
	body.tax-product_cat ul.products li.product {
		display: flex !important;
		flex-direction: column !important;
	}
	body.woocommerce-shop ul.products li.product .fusion-product-wrapper,
	body.tax-product_cat ul.products li.product .fusion-product-wrapper {
		display: flex !important;
		flex: 1 1 auto !important;
		flex-direction: column !important;
		height: 100% !important;
	}
	body.woocommerce-shop ul.products li.product .product-buttons,
	body.tax-product_cat ul.products li.product .product-buttons {
		margin-top: auto !important;
	}

	.my2lk-home .my2lk-section--products ul.products li.product .product-title,
	.woocommerce-shop ul.products li.product .product-title,
	.tax-product_cat ul.products li.product .product-title { font-size: 13px !important; line-height: 1.3 !important; }
	.woocommerce ul.products li.product .price { font-size: 13px; }
	.my2lk-steps { gap: 12px; }
	.my2lk-steps li { padding: 22px; }
	.my2lk-steps span { margin-bottom: 22px; }
	.my2lk-source__card { padding: 28px 22px; }
	.my2lk-source__card h2 { font-size: 30px; }
	.my2lk-source__card p:not(.my2lk-eyebrow) { font-size: 15px; }

	.woocommerce-cart #main, .woocommerce-checkout #main, .woocommerce-account #main,
	.woocommerce-shop #main, .tax-product_cat #main, .single-product #main { padding-left: 12px; padding-right: 12px; }
	.woocommerce-checkout .wc-block-components-title,
	.woocommerce-cart .wc-block-components-title { line-height: 1.25; }
	.woocommerce-checkout input, .woocommerce-checkout select, .woocommerce-checkout textarea,
	.woocommerce-cart input, .woocommerce-cart select { max-width: 100%; }

	/* Product-page add-to-cart confirmation: keep the message compact and make
	 * View cart a normal text button instead of Avada's icon-heavy treatment. */
	body.single-product .woocommerce-message,
	body.single-product .woocommerce-notices-wrapper .woocommerce-message {
		box-sizing: border-box !important;
		display: flex !important;
		flex-wrap: wrap !important;
		align-items: center !important;
		gap: 10px 12px !important;
		width: 100% !important;
		margin: 0 0 14px !important;
		padding: 12px 14px !important;
		border: 1px solid #cfe3d8 !important;
		border-radius: 11px !important;
		background: #f4faf7 !important;
		color: var(--my2lk-ink) !important;
		font-size: 13px !important;
		line-height: 1.4 !important;
	}
	body.single-product .woocommerce-message .button.wc-forward {
		display: inline-flex !important;
		width: auto !important;
		min-width: 96px !important;
		min-height: 40px !important;
		align-items: center !important;
		justify-content: center !important;
		margin: 0 0 0 auto !important;
		padding: 9px 14px !important;
		border-radius: 9px !important;
		font-size: 12px !important;
		line-height: 1 !important;
		white-space: nowrap !important;
	}
	body.single-product .woocommerce-message .button.wc-forward::before,
	body.single-product .woocommerce-message .button.wc-forward::after {
		display: none !important;
		content: none !important;
	}

	/* Mobile Cart milestone: improve hierarchy without changing WooCommerce
	 * block behaviour or checkout calculations. */
	body.woocommerce-cart .wp-block-woocommerce-cart,
	body.woocommerce-cart .wc-block-cart {
		box-sizing: border-box !important;
		width: 100% !important;
		max-width: 100% !important;
	}
	body.woocommerce-cart .wc-block-cart-items {
		width: 100% !important;
		border-collapse: separate !important;
		border-spacing: 0 10px !important;
	}
	body.woocommerce-cart .wc-block-cart-items__row td {
		padding-top: 14px !important;
		padding-bottom: 14px !important;
		background: #fff !important;
		border-top: 1px solid var(--my2lk-line) !important;
		border-bottom: 1px solid var(--my2lk-line) !important;
	}
	body.woocommerce-cart .wc-block-cart-items__row td:first-child {
		padding-left: 10px !important;
		border-left: 1px solid var(--my2lk-line) !important;
		border-radius: 12px 0 0 12px !important;
	}
	body.woocommerce-cart .wc-block-cart-items__row td:last-child {
		padding-right: 10px !important;
		border-right: 1px solid var(--my2lk-line) !important;
		border-radius: 0 12px 12px 0 !important;
	}
	body.woocommerce-cart .wc-block-cart-item__image img {
		border-radius: 7px !important;
		background: #f7faf8 !important;
		object-fit: contain !important;
	}
	body.woocommerce-cart .wc-block-components-product-name {
		color: var(--my2lk-ink) !important;
		font-size: 13px !important;
		font-weight: 800 !important;
		line-height: 1.25 !important;
	}
	body.woocommerce-cart .wc-block-cart-item__prices,
	body.woocommerce-cart .wc-block-components-product-price {
		color: var(--my2lk-green) !important;
		font-weight: 800 !important;
	}
	body.woocommerce-cart .wc-block-components-quantity-selector {
		min-height: 42px !important;
		border-radius: 8px !important;
	}
	body.woocommerce-cart .wc-block-cart__totals-title,
	body.woocommerce-cart .wc-block-components-totals-item__label,
	body.woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
		font-weight: 800 !important;
	}
	body.woocommerce-cart .wc-block-cart__submit-button,
	body.woocommerce-cart .wc-block-components-button.wp-element-button {
		min-height: 46px !important;
		border-radius: 10px !important;
		font-size: 14px !important;
		font-weight: 800 !important;
	}

	/* Brave/Chromium device emulation can expose less usable bottom viewport
	 * than a physical phone. Keep the floating WhatsApp control safely clear. */
	body .my2lk-floating-whatsapp {
		right: 16px !important;
		bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
		z-index: 99999 !important;
	}
}
