/*
Theme Name: Hadiya
Theme URI: https://wooarab.com/en/hadiya-theme/
Author: WooArab
Author URI: https://wooarab.com/
Description: Hadiya is an Arabic-first WooCommerce block theme for gift, perfume and jewelry stores. It ships ready templates for the shop, product, cart and checkout, three style variations (gifts, perfume, jewelry), patterns for heroes, bestsellers, testimonials, FAQ, about and contact pages, and locally hosted Arabic fonts.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hadiya
Tags: e-commerce, block-patterns, full-site-editing, rtl-language-support, style-variations, translation-ready, wide-blocks, custom-colors, custom-logo, editor-style, block-styles, one-column
*/

/*
 * كل القيم من theme.json عبر متغيرات CSS. خصائص منطقية فقط (inline/block).
 */

:root {
	--hadiya-radius-s: var(--wp--custom--radius--small);
	--hadiya-radius-m: var(--wp--custom--radius--medium);
	--hadiya-radius-l: var(--wp--custom--radius--large);
	--hadiya-ease: var(--wp--custom--transition);
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

:where(h1, h2, h3, h4, h5, h6) {
	text-wrap: balance;
}

:where(p) {
	text-wrap: pretty;
}

/* لا تباعد بين الحروف ولا تحويل لأحرف كبيرة في العربية. */
:lang(ar) :where(*) {
	letter-spacing: 0 !important;
	text-transform: none !important;
}

::selection {
	background: var(--wp--preset--color--accent-2);
	color: var(--wp--preset--color--contrast);
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

/* ---------- الترويسة ---------- */

.hadiya-announcement {
	text-align: center;
}

.hadiya-announcement a {
	color: inherit;
}

.hadiya-header {
	position: sticky;
	inset-block-start: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--wp--preset--color--base) 92%, transparent);
	backdrop-filter: saturate(1.4) blur(10px);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
}

.admin-bar .hadiya-header {
	inset-block-start: var(--wp-admin--admin-bar--height, 0);
}

.hadiya-header .wp-block-site-logo img {
	max-block-size: 48px;
	inline-size: auto;
}

.hadiya-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--base);
}

.hadiya-header .wp-block-navigation-item__content {
	padding-block: 0.4em;
	position: relative;
}

.hadiya-header .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	inset-block-end: 0;
	block-size: 2px;
	background: var(--wp--preset--color--accent);
	transform: scaleX(0);
	transition: transform var(--hadiya-ease);
}

.hadiya-header .wp-block-navigation-item__content:hover::after,
.hadiya-header .current-menu-item > .wp-block-navigation-item__content::after {
	transform: scaleX(1);
}

.hadiya-header .wp-block-search__input {
	border-radius: var(--wp--custom--radius--pill);
	border-color: var(--wp--preset--color--border);
	background: var(--wp--preset--color--base-2);
	padding-inline: 1em;
	min-inline-size: 12rem;
}

.hadiya-header .wc-block-mini-cart__button {
	padding: 0.4em;
}

.hadiya-header .wc-block-mini-cart__badge {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
	border: 0;
}

@media (max-width: 781px) {
	.hadiya-header .hadiya-header__search {
		display: none;
	}
}

/* ---------- أنماط البلوكات ---------- */

/* سطر تمهيدي فوق العناوين، بشريط يشبه شريط الهدية. */
.is-style-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}

.is-style-eyebrow::before {
	content: "";
	inline-size: 1.75em;
	block-size: 2px;
	background: currentColor;
	border-radius: 2px;
}

.has-text-align-center.is-style-eyebrow {
	justify-content: center;
}

/* صورة بقوس علوي – إشارة للعمارة العربية وشكل علبة الهدية. */
.wp-block-image.is-style-arch img,
.wp-block-cover.is-style-arch {
	border-radius: 999px 999px var(--hadiya-radius-m) var(--hadiya-radius-m);
}

.wp-block-image.is-style-arch img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
	inline-size: 100%;
}

/* بطاقة. */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--hadiya-radius-m);
	padding: var(--wp--preset--spacing--50);
	box-shadow: var(--wp--preset--shadow--soft);
}

/* بطاقة الإهداء: إطار مزدوج وثقب مثل بطاقة الهدية المعلّقة. */
.wp-block-group.is-style-gift-tag {
	position: relative;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--hadiya-radius-m);
	padding: var(--wp--preset--spacing--50);
	outline: 1px dashed var(--wp--preset--color--accent-2);
	outline-offset: -10px;
}

.wp-block-group.is-style-gift-tag::before {
	content: "";
	position: absolute;
	inset-block-start: 18px;
	inset-inline-end: 18px;
	inline-size: 12px;
	block-size: 12px;
	border-radius: 50%;
	background: var(--wp--preset--color--base-2);
	border: 1px solid var(--wp--preset--color--border);
}

/* فاصل الشريط: خطان وعقدة في المنتصف. */
.wp-block-separator.is-style-ribbon {
	border: 0;
	block-size: 18px;
	max-inline-size: 140px;
	opacity: 1;
	background:
		radial-gradient(circle at 50% 50%, var(--wp--preset--color--accent) 0 5px, transparent 5.5px),
		linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
	color: var(--wp--preset--color--accent-2);
}

.wp-block-separator.is-style-ribbon.alignwide,
.wp-block-separator.is-style-ribbon.alignfull {
	max-inline-size: none;
}

/* زر محدد. */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1.5px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--contrast);
	padding-block: calc(0.9em - 1.5px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.wp-block-button__link {
	transition: background-color var(--hadiya-ease), color var(--hadiya-ease), transform var(--hadiya-ease);
}

.wp-block-button__link:active {
	transform: translateY(1px);
}

/* زر نصي بسهم يتبع اتجاه اللغة. */
.wp-block-button.is-style-arrow > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	padding-inline: 0;
	border-radius: 0;
	border-block-end: 1.5px solid currentColor;
	padding-block: 0.2em;
}

.wp-block-button.is-style-arrow > .wp-block-button__link::after {
	content: "←";
	display: inline-block;
	margin-inline-start: 0.5em;
	transition: transform var(--hadiya-ease);
}

html:not([dir="rtl"]) .wp-block-button.is-style-arrow > .wp-block-button__link::after {
	content: "→";
}

.wp-block-button.is-style-arrow > .wp-block-button__link:hover {
	color: var(--wp--preset--color--accent);
	background: transparent;
}

.wp-block-button.is-style-arrow > .wp-block-button__link:hover::after {
	transform: translateX(-4px);
}

html:not([dir="rtl"]) .wp-block-button.is-style-arrow > .wp-block-button__link:hover::after {
	transform: translateX(4px);
}

/* قائمة بعلامات صغيرة. */
.wp-block-list.is-style-checks {
	list-style: none;
	padding-inline-start: 0;
}

.wp-block-list.is-style-checks li {
	position: relative;
	padding-inline-start: 1.9em;
	margin-block-end: 0.5em;
}

.wp-block-list.is-style-checks li::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	inset-block-start: 0.45em;
	inline-size: 1.1em;
	block-size: 1.1em;
	border-radius: 50%;
	background: var(--wp--preset--color--accent-2);
	-webkit-mask: none;
}

.wp-block-list.is-style-checks li::after {
	content: "";
	position: absolute;
	inset-inline-start: 0.36em;
	inset-block-start: 0.68em;
	inline-size: 0.38em;
	block-size: 0.6em;
	border: solid var(--wp--preset--color--accent);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* ---------- الأيقونات (قناع CSS بلون النص) ---------- */

.hadiya-ficon::before {
	content: "";
	display: block;
	inline-size: 2.25rem;
	block-size: 2.25rem;
	margin-block-end: var(--wp--preset--spacing--20);
	background: var(--wp--preset--color--accent);
	-webkit-mask: var(--hadiya-ficon) center / contain no-repeat;
	mask: var(--hadiya-ficon) center / contain no-repeat;
}

.hadiya-ficon--truck { --hadiya-ficon: url(assets/icons/truck.svg); }
.hadiya-ficon--gift { --hadiya-ficon: url(assets/icons/gift.svg); }
.hadiya-ficon--cash { --hadiya-ficon: url(assets/icons/cash.svg); }
.hadiya-ficon--shield { --hadiya-ficon: url(assets/icons/shield.svg); }
.hadiya-ficon--card { --hadiya-ficon: url(assets/icons/card.svg); }
.hadiya-ficon--box { --hadiya-ficon: url(assets/icons/box.svg); }
.hadiya-ficon--phone { --hadiya-ficon: url(assets/icons/phone.svg); }
.hadiya-ficon--pin { --hadiya-ficon: url(assets/icons/pin.svg); }
.hadiya-ficon--clock { --hadiya-ficon: url(assets/icons/clock.svg); }

/* ---------- بطاقات المنتجات ---------- */

.wc-block-product-template .wc-block-product,
.wp-block-woocommerce-product-template .wc-block-product {
	position: relative;
}

.hadiya-product-card .wc-block-components-product-image,
.hadiya-product-card .wp-block-woocommerce-product-image {
	overflow: hidden;
	border-radius: var(--hadiya-radius-m);
	background: var(--wp--preset--color--base-2);
	margin-block-end: var(--wp--preset--spacing--30);
}

.hadiya-product-card .wc-block-components-product-image img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
	transition: transform 600ms cubic-bezier(.2, .7, .3, 1);
}

.hadiya-product-card .wc-block-product:hover .wc-block-components-product-image img {
	transform: scale(1.04);
}

.hadiya-product-card .wp-block-post-title {
	margin-block: 0 0.2em;
}

.hadiya-product-card .wp-block-post-title a {
	text-decoration: none;
}

.hadiya-product-card .wc-block-components-product-sale-badge {
	border: 0;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
	font-size: var(--wp--preset--font-size--x-small);
	padding: 0.2em 0.9em;
	margin: var(--wp--preset--spacing--20);
}

.hadiya-product-card .wc-block-components-product-button .wp-block-button__link.wc-block-components-product-button__button {
	inline-size: 100%;
	justify-content: center;
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 1.5px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--pill);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	padding-block: 0.7em;
}

.hadiya-product-card .wc-block-components-product-button .wp-block-button__link.wc-block-components-product-button__button:hover {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.hadiya-product-card .wc-block-components-product-price del {
	color: var(--wp--preset--color--contrast-2);
	font-weight: 400;
	margin-inline-end: 0.4em;
}

.hadiya-product-card .wc-block-components-product-price ins {
	text-decoration: none;
	color: var(--wp--preset--color--accent);
}

/* ---------- صفحة المنتج ---------- */

.hadiya-product-summary {
	position: sticky;
	inset-block-start: calc(var(--wp-admin--admin-bar--height, 0px) + 96px);
}

.hadiya-product-summary .wp-block-post-title {
	margin-block-end: 0;
}

.hadiya-product-summary .wc-block-components-product-price {
	font-size: var(--wp--preset--font-size--x-large);
}

.hadiya-product-summary .wp-block-add-to-cart-form .quantity .qty,
.hadiya-product-summary form.cart .qty {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--base);
	block-size: 3.2em;
	inline-size: 5em;
	text-align: center;
}

.hadiya-product-summary form.cart {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30);
	align-items: stretch;
}

.hadiya-product-summary form.cart .single_add_to_cart_button {
	flex: 1;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
	font-weight: 700;
	min-block-size: 3.2em;
}

.hadiya-product-summary form.cart .single_add_to_cart_button:hover {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.hadiya-product-summary .woocommerce-product-details__short-description,
.hadiya-product-summary .wp-block-post-excerpt {
	color: var(--wp--preset--color--contrast-2);
}

.woocommerce-product-gallery__image img,
.wc-block-components-product-image-gallery img {
	border-radius: var(--hadiya-radius-m);
}

.hadiya-assurance p {
	margin: 0;
}

.wp-block-woocommerce-product-details .wc-tabs {
	border-block-end: 1px solid var(--wp--preset--color--border);
	padding-inline-start: 0;
}

.wp-block-woocommerce-product-details .wc-tabs li a {
	text-decoration: none;
	font-weight: 700;
	color: var(--wp--preset--color--contrast-2);
}

.wp-block-woocommerce-product-details .wc-tabs li.active a {
	color: var(--wp--preset--color--contrast);
	box-shadow: inset 0 -2px 0 var(--wp--preset--color--accent);
}

.wc-block-breadcrumbs,
.woocommerce-breadcrumb {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--contrast-2);
}

.wc-block-breadcrumbs a,
.woocommerce-breadcrumb a {
	color: inherit;
	text-decoration: none;
}

/* ---------- الأرشيف والفلاتر ---------- */

.hadiya-shop-toolbar {
	border-block: 1px solid var(--wp--preset--color--border);
	padding-block: var(--wp--preset--spacing--30);
}

.hadiya-filters .wp-block-heading {
	font-size: var(--wp--preset--font-size--small);
	margin-block-end: var(--wp--preset--spacing--20);
}

.hadiya-filters .wp-block-categories-list,
.hadiya-filters .wp-block-tag-cloud {
	padding-inline-start: 0;
	list-style: none;
}

.hadiya-filters .wp-block-categories-list a {
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
}

.hadiya-filters .wp-block-tag-cloud a {
	display: inline-block;
	padding: 0.3em 0.9em;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--pill);
	text-decoration: none;
	font-size: var(--wp--preset--font-size--x-small) !important;
	color: var(--wp--preset--color--contrast);
	margin: 0 0 0.4em;
}

.hadiya-filters .wp-block-tag-cloud a:hover {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}

@media (min-width: 960px) {
	.hadiya-filters {
		position: sticky;
		inset-block-start: calc(var(--wp-admin--admin-bar--height, 0px) + 96px);
	}
}

.wp-block-query-pagination {
	gap: var(--wp--preset--spacing--20);
}

.wp-block-query-pagination-numbers .page-numbers {
	display: inline-grid;
	place-items: center;
	min-inline-size: 2.5em;
	block-size: 2.5em;
	border-radius: 50%;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
}

.wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* ---------- السلة والدفع ---------- */

.wc-block-cart .wc-block-components-button:not(.is-link),
.wc-block-checkout .wc-block-components-checkout-place-order-button,
.wc-block-mini-cart__footer .wc-block-components-button {
	border-radius: var(--wp--custom--radius--pill);
	font-weight: 700;
}

.wc-block-components-text-input input,
.wc-block-components-combobox .components-combobox-control input,
.wc-blocks-components-select .wc-blocks-components-select__select,
.wc-block-components-textarea {
	border-radius: var(--hadiya-radius-s) !important;
	border-color: var(--wp--preset--color--border) !important;
}

.wc-block-components-sidebar-layout .wc-block-components-sidebar {
	background: var(--wp--preset--color--base-2);
	border-radius: var(--hadiya-radius-m);
	padding: var(--wp--preset--spacing--40);
}

.hadiya-checkout-header {
	border-block-end: 1px solid var(--wp--preset--color--border);
}

/* ---------- التذييل ---------- */

.hadiya-footer a {
	color: inherit;
	text-decoration: none;
}

.hadiya-footer a:hover {
	color: var(--wp--preset--color--accent);
}

.hadiya-footer .wp-block-navigation {
	gap: var(--wp--preset--spacing--20);
}

.hadiya-payments {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
}

.hadiya-payments span {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--hadiya-radius-s);
	padding: 0.15em 0.7em;
	font-size: var(--wp--preset--font-size--x-small);
}

/* ---------- عناصر عامة ---------- */

.hadiya-confetti {
	position: relative;
	isolation: isolate;
}

.hadiya-confetti::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	opacity: 0.55;
	background-image:
		radial-gradient(circle, var(--wp--preset--color--accent-2) 2px, transparent 2.5px),
		radial-gradient(circle, var(--wp--preset--color--accent-3) 1.5px, transparent 2px);
	background-size: 46px 46px, 71px 71px;
	background-position: 0 0, 23px 31px;
	-webkit-mask: linear-gradient(to bottom, #000 0%, transparent 80%);
	mask: linear-gradient(to bottom, #000 0%, transparent 80%);
	pointer-events: none;
}

.hadiya-stat strong {
	display: block;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.2;
	color: var(--wp--preset--color--contrast);
}

.hadiya-quote-card {
	block-size: 100%;
}

.hadiya-stars {
	color: var(--wp--preset--color--accent-3);
	font-size: var(--wp--preset--font-size--small);
}

.wp-block-details summary {
	cursor: pointer;
	font-weight: 700;
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 1em;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "+";
	font-weight: 400;
	font-size: 1.4em;
	line-height: 1;
	color: var(--wp--preset--color--accent);
	transition: transform var(--hadiya-ease);
}

.wp-block-details[open] summary::after {
	transform: rotate(45deg);
}

.wp-block-details > :not(summary) {
	color: var(--wp--preset--color--contrast-2);
}

.hadiya-step-number {
	display: inline-grid;
	place-items: center;
	inline-size: 2.6rem;
	block-size: 2.6rem;
	border-radius: 50%;
	border: 1.5px solid var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
	font-weight: 700;
	font-family: var(--wp--preset--font-family--heading);
}

.hadiya-404-number {
	font-family: var(--wp--preset--font-family--heading);
	line-height: 1;
	color: var(--wp--preset--color--accent-2);
}

/* شريط الإعلان المتحرك ببطء على الجوال. */
@media (max-width: 600px) {
	.hadiya-announcement p {
		font-size: var(--wp--preset--font-size--x-small);
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

.hadiya-plain-list {
	list-style: none;
	padding-inline-start: 0;
}

.hadiya-plain-list li {
	margin-block-end: 0.45em;
}

.hadiya-footer .wp-block-separator {
	margin-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--40);
}

.hadiya-header .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 0;
	padding: 0.4em;
	margin: 0;
	box-shadow: none;
}

.hadiya-header .wp-block-search__button:hover {
	color: var(--wp--preset--color--accent);
	background: transparent;
}

.hadiya-header .wp-block-search__button svg {
	inline-size: 26px;
	block-size: 26px;
}

/* على الجوال: المنتجات أولًا ثم الفلاتر. */
@media (max-width: 781px) {
	.hadiya-shop-columns > .wp-block-column:first-child {
		order: 2;
		border-block-start: 1px solid var(--wp--preset--color--border);
		padding-block-start: var(--wp--preset--spacing--50);
	}
}
