/*
 * LujAnj Beauty — supplementary styles.
 * Uses CSS logical properties only (inline/block, start/end) so the same rules
 * render correctly in LTR (English) and RTL (Arabic). Colours come from theme.json.
 */

:root {
	--lujanj-radius: 16px;
	--lujanj-shadow: 0 6px 24px rgb(43 30 28 / 8%);
}

/* Accessibility --------------------------------------------------------- */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Header ------------------------------------------------------------------ */
.lujanj-header { position: sticky; inset-block-start: 0; z-index: 50; }
.admin-bar .lujanj-header { inset-block-start: var(--wp-admin--admin-bar--height, 32px); }
.lujanj-header__row { gap: 1rem 1.5rem; }
.lujanj-brand { gap: 0.6rem; align-items: center; }
.lujanj-brand .wp-block-site-title a { text-decoration: none; color: var(--wp--preset--color--contrast); }
.lujanj-nav a { text-decoration: none; }
.lujanj-nav a:hover, .lujanj-nav a:focus { text-decoration: underline; text-underline-offset: 6px; }
.lujanj-header__tools { gap: 0.75rem; align-items: center; }
.lujanj-search { flex: 1 1 260px; max-inline-size: 520px; }
.lujanj-header__nav { margin-block-start: 0.6rem; }
.lujanj-search .wp-block-search__inside-wrapper { border-radius: 999px; border-color: var(--wp--preset--color--nude); background: var(--wp--preset--color--base); padding-inline: 0.5rem 0.25rem; }
.lujanj-search .wp-block-search__input { border: 0; background: transparent; }
.lujanj-search .wp-block-search__button { border-radius: 999px; }
.lujanj-lang ul { display: flex; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.lujanj-lang a { font-size: var(--wp--preset--font-size--small); text-decoration: none; padding: 0.2rem 0.5rem; border-radius: 999px; }
.lujanj-lang a[aria-current="true"] { background: var(--wp--preset--color--blush); }

@media (max-width: 781px) {
	.lujanj-header__row { justify-content: space-between; }
	.lujanj-search { order: 3; flex: 1 1 100%; max-inline-size: none; }
	.lujanj-header__nav { margin-block-start: 0.25rem; justify-content: flex-start; }
	.lujanj-brand .wp-block-site-title { font-size: 1.4rem; }
}

/* Sections ---------------------------------------------------------------- */
.lujanj-section { margin-block: var(--wp--preset--spacing--60); }
.lujanj-eyebrow { letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
:lang(ar) .lujanj-eyebrow { letter-spacing: 0; text-transform: none; }
.lujanj-hero__content > * { max-inline-size: 620px; margin-inline: 0 auto; }
.lujanj-hero .wp-block-heading { max-inline-size: 18ch; }
.lujanj-hero .is-style-outline .wp-block-button__link { border-color: var(--wp--preset--color--contrast); color: var(--wp--preset--color--contrast); background: transparent; }
.lujanj-trust .wp-block-heading { margin-block-end: 0.25rem; }

/* Category tiles ---------------------------------------------------------- */
.lujanj-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
	gap: 1rem;
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
}
.lujanj-tile a {
	position: relative;
	display: flex;
	align-items: flex-end;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: var(--lujanj-radius);
	background: var(--wp--preset--gradient--hero);
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	box-shadow: var(--lujanj-shadow);
}
.lujanj-tile img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform 0.4s ease; }
.lujanj-tile a:hover img { transform: scale(1.04); }
.lujanj-tile__label {
	position: relative;
	margin: 0.75rem;
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
	background: rgb(255 255 255 / 88%);
	font-weight: 500;
}

/* Product cards (WooCommerce blocks) -------------------------------------- */
.wc-block-product-template .wc-block-product,
.wp-block-woocommerce-product-template > li {
	background: var(--wp--preset--color--surface);
	border-radius: var(--lujanj-radius);
	padding: 0.75rem 0.75rem 1rem;
	box-shadow: var(--lujanj-shadow);
	text-align: start;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.wc-block-components-product-image img { border-radius: calc(var(--lujanj-radius) - 6px); aspect-ratio: 1; object-fit: cover; background: var(--wp--preset--color--blush); }
.wc-block-product .wp-block-post-title { margin-block: 0.25rem 0; line-height: 1.35; font-family: var(--wp--preset--font-family--body); font-weight: 500; font-size: 0.95rem; }
.lujanj-trust .wp-block-heading { font-family: var(--wp--preset--font-family--body); font-weight: 700; }
.wc-block-product .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--contrast); }
.wc-block-components-product-price del { color: var(--wp--preset--color--muted); font-weight: 400; }
.wc-block-components-product-price ins { color: var(--wp--preset--color--sale); text-decoration: none; }
.wc-block-components-product-sale-badge,
.wc-block-components-product-image .wc-block-components-product-sale-badge {
	background: var(--wp--preset--color--sale);
	color: #fff;
	border: 0;
	border-radius: 999px;
	font-size: 0.75rem;
	padding: 0.2rem 0.6rem;
}
.wc-block-product .wp-block-button, .wc-block-product .wc-block-components-product-button { margin-block-start: auto; }
.wc-block-components-product-button .wp-block-button__link,
.wc-block-components-product-button__button { inline-size: 100%; }

/* Footer -------------------------------------------------------------------- */
.lujanj-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.lujanj-footer__list a { text-decoration: none; }
.lujanj-footer__list a:hover, .lujanj-footer__list a:focus { text-decoration: underline; }
.lujanj-footer .wp-block-site-title a { color: var(--wp--preset--color--base); text-decoration: none; }

/* Arabic typography --------------------------------------------------------- */
:lang(ar) body, :lang(ar) .wp-block-heading, :lang(ar) h1, :lang(ar) h2, :lang(ar) h3 {
	font-family: var(--wp--preset--font-family--body);
	letter-spacing: 0;
}
:lang(ar) .wp-block-heading, :lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { font-weight: 700; line-height: 1.35; }
:lang(ar) body { line-height: 1.8; }

/* Classic WooCommerce templates (single product) ---------------------------- */
.woocommerce span.onsale,
.woocommerce div.product span.onsale,
.woocommerce ul.products li.product .onsale {
	background: var(--wp--preset--color--sale);
	color: #fff;
	border-radius: 999px;
	min-height: auto;
	min-width: auto;
	line-height: 1.2;
	padding: 0.35rem 0.75rem;
	font-size: 0.8rem;
	font-weight: 700;
	inset-block-start: 0.75rem;
	inset-inline-start: 0.75rem;
	inset-inline-end: auto;
	left: auto;
	right: auto;
	margin: 0;
}
.rtl.woocommerce div.product span.onsale, .rtl .woocommerce div.product span.onsale { right: 0.75rem; left: auto; }
body:not(.rtl).woocommerce div.product span.onsale, body:not(.rtl) .woocommerce div.product span.onsale { left: 0.75rem; right: auto; }
.woocommerce div.product .woocommerce-product-gallery__image img { border-radius: var(--lujanj-radius); }

/* Form fields (comments, account, classic forms) -------------------------- */
:where(.comment-form, .woocommerce-form, .woocommerce-address-fields, .wp-block-post-comments-form) :where(input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="url"], textarea, select) {
	box-sizing: border-box;
	inline-size: 100%;
	max-inline-size: 40rem;
	padding: 0.65rem 0.85rem;
	border: 1px solid var(--wp--preset--color--nude);
	border-radius: 10px;
	background: var(--wp--preset--color--surface);
	font: inherit;
}
.comment-form p { margin-block: 0 1rem; }
.comment-form label { display: block; margin-block-end: 0.3rem; font-weight: 500; }
.comment-form .comment-form-cookies-consent label { display: inline; font-weight: 400; }
.woocommerce .quantity input.qty { border: 1px solid var(--wp--preset--color--nude); border-radius: 10px; padding: 0.55rem; }
/* Checkout: secure payment badge */
.lujanj-secure-payment {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4em;
	margin: 1rem 0;
	padding: 0.75rem 1rem;
	border: 1px solid var(--wp--preset--color--nude);
	border-radius: 10px;
	font-size: 0.875rem;
}
.lujanj-secure-payment svg { flex: none; }
/* Arabic / RTL checkout, cart and mobile polish */
.lujanj-phone-hint, .woocommerce form .form-row .description { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--wp--preset--color--muted); }
.lujanj-phone-hint.is-error { color: var(--wp--preset--color--sale); }
.rtl .woocommerce form .form-row label,
.rtl .wc-block-components-text-input label,
.rtl .wc-block-checkout,
.rtl .wc-block-cart,
.rtl .woocommerce form .form-row input.input-text,
.rtl .woocommerce form .form-row textarea,
.rtl .wc-block-components-text-input input,
.rtl .wc-block-components-textarea,
.rtl .woocommerce-error, .rtl .woocommerce-message, .rtl .woocommerce-info,
.rtl .wc-block-components-notice-banner { text-align: right; }
/* Digits, emails and phone numbers stay left-to-right inside RTL forms. */
.rtl input[type="tel"], .rtl input[type="email"], .rtl input[type="url"], .rtl input[dir="ltr"] { direction: ltr; }
.rtl input[type="tel"]::placeholder, .rtl input[type="email"]::placeholder { text-align: right; }
/* Cart: the primary action stands out. */
.wc-block-cart__submit-button,
.wc-proceed-to-checkout .checkout-button {
	display: block;
	inline-size: 100%;
	box-sizing: border-box;
	padding-block: 1rem;
	border-radius: 999px;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	font-size: 1.125rem;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	box-shadow: var(--lujanj-shadow);
}
/* Mobile 360px: no horizontal overflow, full-width actions. */
@media (max-width: 600px) {
	html, body { overflow-x: clip; }
	img, video, iframe, table { max-inline-size: 100%; }
	.wp-site-blocks, .entry-content, .wp-block-group { min-inline-size: 0; }
	.wc-block-components-button:not(.is-link),
	.wp-block-button__link,
	.woocommerce button.button, .woocommerce a.button, .woocommerce #respond input#submit,
	.wc-block-components-checkout-place-order-button,
	.wc-block-components-product-button__button {
		inline-size: 100%;
		box-sizing: border-box;
		justify-content: center;
		text-align: center;
	}
	.wp-block-buttons { flex-direction: column; align-items: stretch; }
	.wp-block-buttons > .wp-block-button { inline-size: 100%; }
	.wc-block-checkout__main, .wc-block-checkout__sidebar, .wc-block-cart__main, .wc-block-cart__sidebar { inline-size: 100%; padding-inline: 0; box-sizing: border-box; }
	.wc-block-components-address-form__first_name, .wc-block-components-address-form__last_name { flex-basis: 100%; }
	.woocommerce form .form-row-first, .woocommerce form .form-row-last { float: none; inline-size: 100%; }
	.lujanj-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.woocommerce-ordering select, .wc-block-catalog-sorting select, .wc-block-components-sort-select__select {
	padding: 0.45rem 0.9rem;
	border: 1px solid var(--wp--preset--color--nude);
	border-radius: 999px;
	background: var(--wp--preset--color--surface);
	font: inherit;
}
