/* ==========================================================================
   Cubes Web — base styles (RTL first)
   Brand colors are injected as CSS variables from Web Brand Settings.
   ========================================================================== */

:root {
	--c-primary: #c8102e;
	--c-primary-dark: #8b1a1a;
	--c-dark: #0e0e10;
	--c-dark-2: #18181b;
	--c-surface: #f6f7f9;
	--c-white: #ffffff;
	--c-text: #1f2328;
	--c-muted: #5b6470;
	--c-border: #e5e7eb;
	--c-primary-soft: #fdecef;
	--c-whatsapp: #25d366;
	--c-whatsapp-dark: #0e7a43; /* white text on it passes 4.5:1 */

	--gradient-primary: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary) 55%, var(--c-primary-dark) 100%);

	--font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	--font-display: "Alexandria", var(--font);
	--radius-sm: 8px;
	--radius: 14px;
	--radius-lg: 22px;
	--shadow-sm: 0 1px 2px rgb(0 0 0 / 0.06);
	--shadow: 0 8px 24px rgb(15 15 20 / 0.08);
	--shadow-lg: 0 18px 48px rgb(15 15 20 / 0.14);
	--header-h: 76px;
	--container: 1240px;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.7;
	color: var(--c-text);
	background: var(--c-white);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em; line-height: 1.3; font-weight: 700; color: var(--c-dark); }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; border-radius: 4px; }
.disp { font-family: var(--font-display); }

.skip-link {
	position: absolute;
	inset-inline-start: 1rem;
	top: -100px;
	z-index: 1000;
	padding: 0.6rem 1rem;
	background: var(--c-primary);
	color: #fff;
	border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

/* ---------- Layout helpers ---------- */
.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: 16px;
}
@media (min-width: 768px) { .container { padding-inline: 24px; } }

.section-alt { background: var(--c-surface); }
.section-dark { background: var(--c-dark); color: #fff; }
.section-dark h2, .section-dark h3 { color: #fff; }

.section-foot { margin-top: 36px; display: flex; justify-content: center; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 24px;
	border-radius: 10px;
	border: 1px solid transparent;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1;
	white-space: nowrap;
	transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 0.92rem; }
.btn-lg { min-height: 56px; padding: 0 32px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-primary {
	background: var(--gradient-primary);
	background-size: 200% 100%;
	color: #fff;
	box-shadow: 0 6px 18px color-mix(in srgb, var(--c-primary) 35%, transparent);
}
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 10px 26px color-mix(in srgb, var(--c-primary) 45%, transparent); }

.btn-dark { background: var(--c-dark); color: #fff; }
.btn-dark:hover { background: var(--c-dark-2); }

.btn-outline { border-color: var(--c-border); background: #fff; color: var(--c-dark); }
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); }

.btn-outline-light { border-color: rgb(255 255 255 / 0.25); color: #fff; }
.btn-outline-light:hover { border-color: #fff; background: rgb(255 255 255 / 0.08); }

.btn-whatsapp { background: var(--c-whatsapp-dark); color: #fff; }
.btn-whatsapp:hover { background: #0b6537; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Ticker & utility bar ---------- */
.site-ticker { overflow: hidden; background: var(--c-primary); color: #fff; font-size: 0.875rem; font-weight: 600; }
.ticker-track { display: flex; width: max-content; padding-block: 9px; }
.site-ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 10px; padding-inline: 28px; white-space: nowrap; }
.ticker-item .ic { fill: currentColor; stroke: none; }
.ticker-item a:hover { text-decoration: underline; }

.utility-bar { background: var(--c-dark-2); color: rgb(255 255 255 / 0.75); font-size: 0.8125rem; }
.utility-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; min-height: 40px; }
.utility-info,
.utility-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.utility-info span { display: inline-flex; align-items: center; gap: 6px; }
.utility-links { gap: 16px; }
.utility-links a { display: inline-flex; align-items: center; min-height: 44px; }
.utility-links a:first-child { color: #fff; font-weight: 600; }
.utility-links a:hover { color: #fff; text-decoration: underline; }
.utility-links [aria-hidden] { opacity: 0.3; }

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	height: var(--header-h);
	background: color-mix(in srgb, var(--c-dark) 94%, transparent);
	backdrop-filter: saturate(160%) blur(10px);
	-webkit-backdrop-filter: saturate(160%) blur(10px);
	color: #fff;
	border-bottom: 1px solid rgb(255 255 255 / 0.06);
	transition: box-shadow 0.25s;
}
.site-header.is-scrolled { box-shadow: 0 8px 28px rgb(0 0 0 / 0.25); }

.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; color: #fff; }
.header-logo img { height: 44px; width: auto; }
.logo-text { font-size: 1.4rem; font-weight: 700; color: #fff; }
.logo-mark {
	width: 42px;
	height: 42px;
	flex-shrink: 0;
	display: grid;
	place-items: center;
	border-radius: 12px;
	background: var(--c-primary);
}
.logo-name { display: grid; line-height: 1.15; }
.logo-name strong { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; }
.logo-name small { font-size: 0.7rem; color: rgb(255 255 255 / 0.65); }

.header-nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 10px;
	border-radius: 8px;
	color: rgb(255 255 255 / 0.82);
	font-weight: 500;
	font-size: 0.94rem;
	white-space: nowrap;
	position: relative;
	transition: color 0.2s, background-color 0.2s;
}
.nav-link:hover { color: #fff; background: rgb(255 255 255 / 0.06); }
.nav-link.active { color: #fff; }
.nav-link.active::after {
	content: "";
	position: absolute;
	inset-inline: 10px;
	bottom: -2px;
	height: 2px;
	background: var(--c-primary);
	border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 10px; }
.header-icon {
	position: relative;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: 12px;
	border: 1px solid rgb(255 255 255 / 0.12);
	color: #fff;
	transition: background-color 0.2s, border-color 0.2s;
}
.header-icon:hover { background: rgb(255 255 255 / 0.06); border-color: rgb(255 255 255 / 0.3); }
.header-count {
	position: absolute;
	top: -6px;
	inset-inline-end: -6px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	display: grid;
	place-items: center;
	border-radius: 999px;
	background: var(--c-primary);
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
}
.header-cta { min-height: 44px; border-radius: 12px; }
.header-support { display: flex; align-items: center; gap: 10px; }
.support-icon {
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.08);
	color: #fff;
}
.support-text { display: flex; flex-direction: column; line-height: 1.25; }
.support-text small { font-size: 0.75rem; color: rgb(255 255 255 / 0.65); }
.support-text strong { font-size: 0.95rem; font-weight: 600; }

.menu-toggle { display: none; color: #fff; width: 44px; height: 44px; place-items: center; border-radius: 10px; }
.menu-toggle:hover { background: rgb(255 255 255 / 0.08); }

.menu-toggle { border: 1px solid rgb(255 255 255 / 0.12); }

@media (max-width: 1280px) {
	.header-support { display: none; }
}
@media (max-width: 1080px) {
	.header-nav { display: none; }
	.menu-toggle { display: grid; }
}
@media (max-width: 960px) {
	:root { --header-h: 64px; }
	.hide-m { display: none !important; }
	.header-logo img { height: 36px; }
}

/* ---------- Mobile drawer ---------- */
.drawer-backdrop {
	position: fixed;
	inset: 0;
	z-index: 190;
	background: rgb(0 0 0 / 0.5);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s, visibility 0.3s;
}
.mobile-drawer {
	position: fixed;
	top: 0;
	bottom: 0;
	inset-inline-end: 0;
	z-index: 200;
	width: min(86vw, 340px);
	background: var(--c-dark);
	color: #fff;
	display: flex;
	flex-direction: column;
	transform: translateX(-100%);
	visibility: hidden; /* not focusable while closed (no-JS too) */
	transition: transform 0.35s var(--ease), visibility 0.35s;
}
[dir="rtl"] .mobile-drawer { transform: translateX(-100%); inset-inline-end: auto; left: 0; }
body.menu-open .drawer-backdrop { opacity: 1; visibility: visible; }
body.menu-open .mobile-drawer { transform: translateX(0); visibility: visible; }
body.menu-open { overflow: hidden; }

.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgb(255 255 255 / 0.08); }
.drawer-head img { height: 36px; width: auto; }
.menu-close { color: #fff; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; }
.drawer-nav { padding: 12px; flex: 1; overflow-y: auto; }
.drawer-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 12px;
	border-radius: 10px;
	font-weight: 500;
	color: rgb(255 255 255 / 0.88);
}
.drawer-link:hover { background: rgb(255 255 255 / 0.06); color: #fff; }
.drawer-link .header-count { position: static; margin-inline-start: auto; }
.drawer-foot { padding: 16px 20px 24px; display: grid; gap: 10px; border-top: 1px solid rgb(255 255 255 / 0.08); }

/* ---------- Footer ---------- */
.site-footer { background: var(--c-dark); color: rgb(255 255 255 / 0.72); padding-top: 56px; }
.site-footer h3, .site-footer h4 { color: #fff; }

.footer-newsletter {
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	align-items: center;
	gap: 24px;
	padding: 26px 28px;
	margin-bottom: 48px;
	border-radius: var(--radius-lg);
	background: var(--c-dark-2);
	color: #fff;
}
.footer-newsletter h3 { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 4px; }
.footer-newsletter p { margin: 0; font-size: 0.9rem; color: rgb(255 255 255 / 0.72); }
.newsletter-form { display: flex; flex-wrap: wrap; gap: 8px; }
.newsletter-form input {
	flex: 1 1 220px;
	min-width: 0;
	min-height: 50px;
	padding: 0 16px;
	border: 1px solid rgb(255 255 255 / 0.14);
	border-radius: 12px;
	color: #fff;
	background: var(--c-dark);
}
.newsletter-form input::placeholder { color: rgb(255 255 255 / 0.55); }
.newsletter-form input:focus { outline: none; border-color: var(--c-primary); }
.newsletter-form .btn { min-height: 50px; border-radius: 12px; }
.newsletter-form .form-status { flex-basis: 100%; }

.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 40px; padding-bottom: 40px; }
.footer-about img { height: 48px; width: auto; margin-bottom: 16px; }
.footer-about p { max-width: 360px; }
.footer-col h4 { font-size: 1.05rem; margin-bottom: 16px; position: relative; padding-bottom: 10px; }
.footer-col h4::after { content: ""; position: absolute; bottom: 0; inset-inline-start: 0; width: 32px; height: 2px; background: var(--c-primary); }
.footer-col ul { display: grid; gap: 10px; }
.footer-col a { transition: color 0.2s; }
.footer-col a:hover { color: #fff; }
.footer-contact li, .footer-contact a { display: flex; align-items: flex-start; gap: 10px; }
.footer-contact .ic { flex-shrink: 0; margin-top: 4px; color: var(--c-primary); }

.footer-social { margin-top: 20px; }
.footer-social > span { display: block; margin-bottom: 10px; font-size: 0.92rem; }
.social-list { display: flex; flex-wrap: wrap; gap: 8px; }
.social-list a {
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	border-radius: 10px;
	background: rgb(255 255 255 / 0.06);
	color: #fff;
	transition: background-color 0.2s, transform 0.2s;
}
.social-list a:hover { background: var(--c-primary); transform: translateY(-2px); }

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	padding-block: 20px;
	border-top: 1px solid rgb(255 255 255 / 0.08);
	font-size: 0.9rem;
}
.footer-bottom p { margin: 0; }
@media (min-width: 961px) { .footer-bottom { padding-inline-start: 72px; } } /* clear of the back-to-top button */
.footer-legal { display: flex; gap: 18px; }

@media (max-width: 991px) {
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.footer-newsletter { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
	.site-footer { padding-bottom: 72px; } /* space for mobile bar */
}
@media (max-width: 575px) {
	.footer-grid { grid-template-columns: 1fr; gap: 28px; }
	.footer-newsletter { padding: 22px 18px; }
	.newsletter-form .btn { width: 100%; }
}

/* ---------- Floating elements ---------- */
.float-whatsapp {
	position: fixed;
	bottom: 24px;
	inset-inline-end: 24px;
	z-index: 90;
	width: 58px;
	height: 58px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--c-whatsapp);
	color: #fff;
	box-shadow: 0 10px 26px rgb(37 211 102 / 0.4);
	transition: transform 0.2s var(--ease);
}
.float-whatsapp:hover { transform: scale(1.08); }
.float-whatsapp::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--c-whatsapp);
	z-index: -1;
	animation: pulse 2.2s infinite;
}
@keyframes pulse {
	0% { transform: scale(1); opacity: 0.6; }
	100% { transform: scale(1.6); opacity: 0; }
}

.back-to-top {
	position: fixed;
	bottom: 24px;
	inset-inline-start: 24px;
	z-index: 90;
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: #fff;
	color: var(--c-dark);
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--c-primary); color: #fff; }

.mobile-bar { display: none; }
@media (max-width: 960px) {
	.float-whatsapp { display: none; }
	.back-to-top { bottom: 84px; }
	.mobile-bar {
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 95;
		display: grid;
		grid-auto-flow: column;
		grid-auto-columns: 1fr;
		gap: 8px;
		padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
		background: #fff;
		border-top: 1px solid var(--c-border);
		box-shadow: 0 -6px 20px rgb(0 0 0 / 0.06);
	}
	.mobile-bar a {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 2px;
		min-height: 52px;
		border-radius: 10px;
		font-size: 0.8rem;
		font-weight: 600;
		color: var(--c-dark);
		background: var(--c-surface);
	}
	.mobile-bar a.is-whatsapp { background: var(--c-whatsapp-dark); color: #fff; }
	.mobile-bar a.is-primary { background: var(--gradient-primary); color: #fff; }
}

/* ---------- Compare tray & toast ---------- */
.compare-tray {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 96;
	background: var(--c-dark);
	color: #fff;
	box-shadow: 0 -10px 30px rgb(0 0 0 / 0.2);
	padding-bottom: env(safe-area-inset-bottom, 0px);
}
.compare-tray-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 76px; padding-block: 10px; }
.compare-tray-list { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.compare-tray-list li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	padding-inline: 12px 6px;
	border-radius: 10px;
	background: rgb(255 255 255 / 0.08);
	font-size: 0.82rem;
}
.compare-tray-list button {
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.12);
	color: #fff;
}
.compare-tray-list button:hover { background: var(--c-primary); }
body.has-compare-tray { padding-bottom: 96px; }
body.has-compare-tray .float-whatsapp,
body.has-compare-tray .back-to-top { bottom: 100px; }
@media (max-width: 960px) {
	.compare-tray { bottom: 68px; padding-bottom: 0; }
	body.has-compare-tray { padding-bottom: 164px; }
	body.has-compare-tray .back-to-top { bottom: 168px; }
}

.cubes-toast {
	position: fixed;
	bottom: calc(96px + env(safe-area-inset-bottom, 0px)); /* above the mobile bar / compare tray */
	inset-inline: 16px;
	z-index: 300;
	width: fit-content;
	max-width: calc(100% - 32px);
	margin-inline: auto;
	padding: 12px 18px;
	border-radius: 12px;
	background: var(--c-dark);
	color: #fff;
	font-weight: 600;
	box-shadow: var(--shadow-lg);
}

/* ---------- Utilities ---------- */
.text-primary { color: var(--c-primary); }
.text-muted { color: var(--c-muted); }
.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
