/* Alwan Storefront — sales popup + mobile fixes */

/* ---------- Sales notification ---------- */
.alwan-sp {
	--alwan-sp-blue: #0d6dd7;
	position: fixed;
	right: 16px;
	bottom: var(--alwan-sp-bottom, 16px);
	z-index: 1002; /* above the theme's mobile bottom bar (1001) */
	display: flex;
	align-items: center;
	width: 340px;
	max-width: calc(100vw - 24px);
	background: #fff;
	color: #222;
	border-radius: 12px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
	border-right: 4px solid var(--alwan-sp-blue);
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px);
	transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
	direction: rtl;
	text-align: right;
}
.alwan-sp.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .3s ease, transform .3s ease;
}
.alwan-sp__link {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	color: inherit !important;
	text-decoration: none !important;
}
.alwan-sp__img {
	width: 64px;
	height: 64px;
	flex: none;
	object-fit: contain;
	border-radius: 8px;
	background: #f5f5f5;
}
.alwan-sp__body { min-width: 0; line-height: 1.45; }
.alwan-sp__lead { font-size: 12px; color: #666; }
.alwan-sp__name {
	font-size: 14px;
	font-weight: 600;
	color: #111;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.alwan-sp__meta { font-size: 12px; color: var(--alwan-sp-blue); margin-top: 2px; }
.alwan-sp__meta bdi { direction: ltr; unicode-bidi: isolate; }
.alwan-sp__close {
	align-self: flex-start;
	flex: none;
	width: 32px;
	height: 32px;
	margin: 4px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #999;
	font-size: 22px;
	line-height: 32px;
	cursor: pointer;
}
.alwan-sp__close:hover { color: #333; background: transparent; }
@media (max-width: 767px) {
	.alwan-sp { right: 12px; left: 12px; width: auto; max-width: none; }
	.alwan-sp__img { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
	.alwan-sp, .alwan-sp.is-visible { transition: none; transform: none; }
}

/* ---------- Mobile layout fixes ---------- */
@media (max-width: 767px) {
	/* iOS zooms into inputs with font-size < 16px */
	input[type="text"], input[type="search"], input[type="email"], input[type="tel"],
	input[type="number"], input[type="password"], select, textarea { font-size: 16px !important; }

	/* Product cards: same-size square images so rows line up */
	.product-block .image img {
		width: 100%;
		aspect-ratio: 1 / 1;
		height: auto;
		object-fit: contain;
	}
	/* Show two lines of the product name instead of cutting it after a few words */
	.product-block .caption .name {
		font-size: 13px !important;
		line-height: 1.45 !important;
		min-height: 2.9em;
	}
	.product-block .caption .name a {
		display: -webkit-box !important;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden !important;
		white-space: normal !important;
		text-overflow: clip !important;
	}
	.product-block .price { font-size: 14px; }
	.product-block .add-cart .button { min-height: 40px; }

	/* Single product: long titles were filling the whole screen */
	.single-product .product_title {
		font-size: 19px !important;
		line-height: 1.5 !important;
		margin-bottom: 8px;
	}
	.single-product .summary .price { font-size: 20px; }

	/* Keep tables/embeds inside the viewport */
	.woocommerce-Tabs-panel table, .entry-content table { display: block; overflow-x: auto; }
	.entry-content img, .woocommerce-Tabs-panel img { max-width: 100%; height: auto; }
	iframe, video { max-width: 100%; }
}
