/**
 * Rattb — طبقة الاستجابة الشاملة (Responsive layer).
 *
 * تُحمّل بعد كل ملفات الثيم لتعالج أحجام الشاشات الصغيرة والمتوسطة
 * (320 / 375 / 390 / 430 / 768 / 1024 / 1366 / 1440 / 1920) دون تغيير
 * هوية التصميم أو ألوانه. تعتمد clamp() ووحدات نسبية وخصائص منطقية
 * (inline/block) لتعمل مع RTL وLTR معاً.
 */

/* -------------------------------------------------------------------------
   1) مقياس طباعي مرن
   ---------------------------------------------------------------------- */
:root {
	--rattb-fluid-body: clamp(0.95rem, 0.9rem + 0.18vw, 1.0625rem);
	--rattb-gutter: clamp(16px, 4vw, 28px);
	--rattb-section-space: clamp(44px, 7vw, 84px);
}

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

body {
	font-size: var(--rattb-fluid-body);
	line-height: 1.75;
	overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
	word-break: normal;
	hyphens: auto;
}

h1 {
	font-size: clamp(1.75rem, 1.15rem + 2.8vw, 3rem);
}

h2 {
	font-size: clamp(1.5rem, 1.1rem + 1.9vw, 2.4rem);
}

h3 {
	font-size: clamp(1.22rem, 1.02rem + 0.95vw, 1.75rem);
}

h4 {
	font-size: clamp(1.08rem, 1rem + 0.4vw, 1.3rem);
}

h5,
h6 {
	font-size: clamp(1rem, 0.97rem + 0.18vw, 1.12rem);
}

.container {
	padding-inline: var(--rattb-gutter);
}

.section {
	padding-block: var(--rattb-section-space);
}

.section-head {
	margin-bottom: clamp(28px, 4vw, 48px);
}

.section-head__subtitle {
	font-size: clamp(0.98rem, 0.95rem + 0.2vw, 1.05rem);
}

/* منع أي عنصر من كسر عرض الشاشة */
.site-header,
.site-header__inner,
.site-header__nav,
.site-header__actions,
.site-header__brand,
.hero,
.hero__grid,
.services-grid,
.posts-grid,
.features-grid,
.process-grid,
.contact-grid,
.site-footer__grid,
.rattb-single-product,
.rattb-single-product__inner,
.store-products__layout,
.store-products__grid,
.woocommerce,
.woocommerce-checkout {
	min-width: 0;
}

.hero__grid > *,
.services-grid > *,
.posts-grid > *,
.features-grid > *,
.process-grid > *,
.contact-grid > *,
.site-footer__grid > *,
.store-products__grid > * {
	min-width: 0;
}

img,
svg,
video,
iframe {
	max-width: 100%;
}

table {
	max-width: 100%;
}

/* -------------------------------------------------------------------------
   2) الأزرار والنماذج: أهداف لمس مريحة ومنع الفائض
   ---------------------------------------------------------------------- */
.btn,
button,
input[type="submit"],
input[type="button"],
.wc-block-components-button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
	max-width: 100%;
	min-height: 44px;
	white-space: normal;
	text-align: center;
	line-height: 1.5;
}

.btn {
	padding-inline: clamp(16px, 3vw, 28px);
}

.btn--cta {
	white-space: nowrap;
}

input,
select,
textarea,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
	max-width: 100%;
	min-width: 0;
}

/* منع تكبير iOS التلقائي عند التركيز على الحقول */
@media screen and (max-width: 767px) {
	input[type="text"],
	input[type="email"],
	input[type="tel"],
	input[type="url"],
	input[type="password"],
	input[type="search"],
	input[type="number"],
	select,
	textarea,
	.woocommerce form .form-row input.input-text,
	.woocommerce form .form-row textarea,
	.woocommerce form .form-row select {
		font-size: 16px;
	}
}

/* -------------------------------------------------------------------------
   3) الرأس والقائمة
   ---------------------------------------------------------------------- */
.site-header__inner {
	gap: clamp(10px, 2vw, 24px);
}

.site-header__brand {
	flex: 0 1 auto;
	min-width: 0;
}

.site-header .site-logo__img {
	height: clamp(32px, 5.5vw, 42px);
}

.site-header .site-logo--custom img {
	height: clamp(34px, 6vw, 46px);
	max-width: min(210px, 46vw);
}

.site-header__actions {
	gap: clamp(6px, 1.4vw, 14px);
	flex-shrink: 0;
}

.rattb-language-switcher .rattb-langs a {
	padding: 6px 8px;
}

.site-header__burger {
	width: 44px;
	height: 44px;
	flex: 0 0 auto;
}

/* لا تظهر القائمة الأفقية قبل 1200px: عدد العناصر أكبر من عرض الأجهزة
   المتوسطة، وقائمة الجوال هي البديل المخصص لذلك. */
@media (max-width: 1199px) {
	.site-header__nav {
		display: none;
	}

	.site-header__burger {
		display: inline-flex;
	}
}

@media (min-width: 1200px) {
	.site-header__nav {
		display: block;
		min-width: 0;
	}

	.site-header__burger {
		display: none;
	}

	.primary-menu {
		gap: clamp(0px, 0.4vw, 6px);
	}

	.primary-menu > li > a {
		padding-inline: clamp(7px, 0.8vw, 13px);
		font-size: clamp(0.8rem, 0.72rem + 0.15vw, 0.92rem);
	}
}

/* على الشاشات الضيقة جداً يبقى زر الرأس داخل درج الجوال فقط،
   فلا يتزاحم الشعار ومبدّل اللغة والزر وزر القائمة. */
@media (max-width: 479px) {
	.site-header__cta {
		display: none;
	}
}

/* -------------------------------------------------------------------------
   4) البطل والأقسام العامة
   ---------------------------------------------------------------------- */
.hero,
.service-hero,
.about-hero {
	padding-block: clamp(56px, 9vw, 110px);
}

.hero__title,
.service-hero__title,
.about-hero__title {
	font-size: clamp(1.8rem, 1.15rem + 3.2vw, 3.4rem);
	line-height: 1.2;
}

.hero__subtitle,
.service-hero__subtitle,
.about-hero__subtitle {
	font-size: clamp(1rem, 0.95rem + 0.35vw, 1.2rem);
}

.cta-panel {
	padding: clamp(28px, 5vw, 60px) clamp(20px, 4vw, 48px);
}

/* -------------------------------------------------------------------------
   5) المتجر والمنتجات
   ---------------------------------------------------------------------- */
.store-hero {
	padding-block: clamp(36px, 6vw, 56px);
}

.store-hero__inner {
	padding-inline: var(--rattb-gutter);
	gap: clamp(24px, 4vw, 48px);
}

.store-hero__title {
	font-size: clamp(1.55rem, 1.15rem + 2vw, 2.25rem);
}

.store-hero__subtitle {
	font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
}

.store-products__grid {
	grid-template-columns: 1fr;
	gap: clamp(16px, 2.5vw, 24px);
}

@media (min-width: 480px) {
	.store-products__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.store-products__card-title {
	font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.25rem);
	overflow-wrap: anywhere;
}

.store-products__card-desc {
	font-size: clamp(0.86rem, 0.84rem + 0.1vw, 0.95rem);
}

.store-products__card-price {
	font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem);
}

.store-products__card-footer {
	flex-wrap: wrap;
	gap: 8px;
}

/* صفحة المنتج المفردة */
.rattb-single-product {
	padding-inline: var(--rattb-gutter);
}

.rattb-single-product__inner {
	gap: clamp(16px, 2.5vw, 24px);
}

.rattb-single-product__gallery {
	min-height: clamp(260px, 52vw, 400px);
	padding: clamp(16px, 3vw, 24px);
}

.rattb-single-product__info-card {
	padding: clamp(16px, 3vw, 32px);
}

.rattb-single-product__title {
	font-size: clamp(1.4rem, 1.15rem + 1.4vw, 2rem);
	overflow-wrap: anywhere;
}

.rattb-single-product__description {
	font-size: clamp(0.95rem, 0.92rem + 0.15vw, 1rem);
	text-align: start;
	overflow-wrap: anywhere;
}

.rattb-single-product__price {
	flex-wrap: wrap;
	font-size: clamp(1.35rem, 1.1rem + 1.3vw, 2rem);
	row-gap: 4px;
}

.rattb-single-product__license {
	flex-wrap: wrap;
	gap: 8px;
}

.rattb-single-product__license-left {
	min-width: 0;
	flex: 1 1 auto;
}

.rattb-single-product__license-name,
.rattb-single-product__license-sub {
	overflow-wrap: anywhere;
}

.rattb-single-product__buy-btn {
	width: 100%;
	min-height: 48px;
}

.rattb-single-product__bottom-grid {
	grid-template-columns: 1fr;
}

/* على الأجهزة اللوحية يبقى المنتج بعمود واحد لأن العمودين 7/5 يضيقان
   الوصف والأسعار بشكل مفرط بين 768 و1023. */
@media (min-width: 768px) and (max-width: 1023px) {
	.rattb-single-product__inner {
		grid-template-columns: 1fr;
	}

	.rattb-single-product__gallery {
		min-height: 420px;
	}

	.rattb-single-product__bottom-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rattb-single-product__features-card {
		grid-column: 1 / -1;
	}
}

/* -------------------------------------------------------------------------
   6) الدفع والحساب
   ---------------------------------------------------------------------- */
.woocommerce form .form-row,
.woocommerce form .form-row-first,
.woocommerce form .form-row-last,
.woocommerce-page form .form-row-first,
.woocommerce-page form .form-row-last {
	float: none;
	width: 100%;
}

.woocommerce form .form-row label {
	line-height: 1.6;
}

.woocommerce form .form-row label .required,
.woocommerce form .form-row abbr.required,
.woocommerce form .required {
	color: #d32f2f;
	text-decoration: none;
	font-weight: 700;
}

.woocommerce form .form-row.woocommerce-invalid input.input-text,
.woocommerce form .form-row.woocommerce-invalid select,
.woocommerce-checkout .woocommerce-invalid input.input-text,
.woocommerce-checkout .woocommerce-invalid select {
	border-color: #d32f2f;
	box-shadow: 0 0 0 1px rgba(211, 47, 47, 0.25);
}

.woocommerce form .form-row.woocommerce-validated input.input-text,
.woocommerce form .form-row.woocommerce-validated select {
	border-color: #2e7d32;
}

.woocommerce-checkout #order_review,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout form.checkout {
	min-width: 0;
}

.woocommerce-checkout #order_review table,
.woocommerce-cart .cart_totals table,
.woocommerce table.shop_table {
	width: 100%;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table th,
.woocommerce-checkout .woocommerce-checkout-review-order-table td,
.woocommerce-cart .cart_totals table th,
.woocommerce-cart .cart_totals table td {
	overflow-wrap: anywhere;
}

#rattb_site_url_field {
	margin-block-start: 8px;
}

.woocommerce-checkout #rattb_site_url {
	direction: ltr;
	text-align: left;
}

.woocommerce form .form-row .select2-container,
.woocommerce form .form-row .select2-selection {
	max-width: 100%;
}

/* الجداول العريضة (السلة/الطلبات) تتمرر أفقياً بدل كسر الصفحة */
@media (max-width: 767px) {
	.woocommerce-cart .woocommerce,
	.woocommerce-account .woocommerce-MyAccount-content {
		overflow-x: auto;
	}

	.woocommerce table.shop_table_responsive tr td,
	.woocommerce-page table.shop_table_responsive tr td {
		text-align: end;
	}
}

/* -------------------------------------------------------------------------
   7) التذييل
   ---------------------------------------------------------------------- */
.site-footer__grid {
	grid-template-columns: 1fr;
	gap: clamp(24px, 4vw, 32px);
}

.site-footer__bottom-inner {
	flex-wrap: wrap;
	gap: 10px;
	text-align: center;
	justify-content: center;
}

@media (min-width: 560px) {
	.site-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 768px) {
	.site-footer__grid {
		grid-template-columns: 1.4fr 1fr 1fr 1fr;
	}
}

/* -------------------------------------------------------------------------
   8) لمسات نهائية للشاشات الكبيرة
   ---------------------------------------------------------------------- */
@media (min-width: 1440px) {
	.container {
		max-width: 1240px;
	}
}

@media (min-width: 1920px) {
	.container {
		max-width: 1280px;
	}

	:root {
		--rattb-section-space: 92px;
	}
}

/* احترام تفضيل تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
