/*
Theme Name: SOSMART – بيع معانا
Description: Thème léger SOSMART (bleu marine / orange), arabe RTL et français LTR, optimisé WooCommerce et mobile. Fonctionne avec l’extension SOSMART Be3M3ana Core.
Version: 0.2.3
Requires at least: 6.5
Requires PHP: 8.1
Author: SOSMART
Text Domain: sosmart-b3m
License: GPLv2 or later
*/

:root {
	--sos-navy: #0B1F3A;
	--sos-orange: #F7941D;
	--sos-bg: #F3F5F8;
	--sos-ink: #0F1B2D;
	--sos-muted: #64748B;
	--sos-line: #E2E8F0;
	--sos-r: 14px;
	--sos-sh: 0 1px 2px rgba(15, 27, 45, .06), 0 4px 16px rgba(15, 27, 45, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Cairo, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.65; color: var(--sos-ink); background: var(--sos-bg); }
img { max-width: 100%; height: auto; }
a { color: var(--sos-navy); }
h1, h2, h3 { color: var(--sos-navy); line-height: 1.3; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--sos-orange) 55%, transparent); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.sos-skip:focus { position: fixed !important; inset-inline-start: 8px; top: 8px; width: auto; height: auto; clip: auto; z-index: 1000; background: #fff; padding: 8px 14px; border-radius: 8px; }
.sos-container { max-width: 1240px; margin-inline: auto; padding-inline: 16px; }

/* Buttons */
.sos-btn, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
	font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
	transition: background .15s, transform .1s;
}
.sos-btn:active, .woocommerce .button:active { transform: scale(.97); }
.sos-btn--orange, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce a.button.alt, .woocommerce button.button.alt { background: var(--sos-orange); color: #fff; }
.sos-btn--orange:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover { background: color-mix(in srgb, var(--sos-orange) 85%, #000); color: #fff; }
.sos-btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.sos-btn--ghost:hover { border-color: #fff; }
.sos-btn--light { background: #fff; color: var(--sos-navy); }
.sos-btn--lg { min-height: 52px; padding: 12px 24px; font-size: 17px; }

/* Header */
.sos-header { background: var(--sos-navy); color: #fff; position: sticky; top: 0; z-index: 100; }
.admin-bar .sos-header { top: 32px; }
.sos-header__in { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.sos-logo { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; color: #fff; flex: none; min-width: 0; }
.sos-acc svg { flex: none; }
.sos-logo img { max-height: 48px; width: auto; }
.sos-logo__txt { font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.sos-logo__txt b { color: var(--sos-orange); }
.sos-logo__sub { font-size: 14px; color: #CBD5E1; font-weight: 700; }
.sos-nav { flex: 1; }
.sos-menu { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.sos-menu a { display: block; padding: 8px 12px; border-radius: 8px; color: #E2E8F0; text-decoration: none; font-weight: 600; }
.sos-menu a:hover, .sos-menu .current-menu-item > a { color: #fff; background: rgba(255, 255, 255, .08); }
.sos-actions { display: flex; align-items: center; gap: 10px; }
.sos-lang { display: inline-flex; border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; overflow: hidden; }
.sos-lang a { padding: 4px 10px; color: #CBD5E1; text-decoration: none; font-weight: 700; font-size: 14px; min-width: 36px; text-align: center; }
.sos-lang a.is-active { background: var(--sos-orange); color: #fff; }
.sos-cart { position: relative; color: #fff; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; }
.sos-cart:hover { background: rgba(255, 255, 255, .08); }
.sos-cart-count { position: absolute; top: 2px; inset-inline-end: 0; background: var(--sos-orange); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.sos-burger { display: none; background: none; border: 0; color: #fff; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; }

/* Hero */
.sos-hero {
	margin-top: 24px; border-radius: 22px; overflow: hidden; color: #fff;
	background: linear-gradient(120deg, var(--sos-navy) 0%, color-mix(in srgb, var(--sos-navy) 80%, #2B5797) 100%);
	display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; align-items: center; padding: 44px 36px;
}
.sos-hero h1 { color: #fff; font-size: clamp(28px, 4vw, 42px); margin: 8px 0 12px; }
.sos-hero p { color: #E2E8F0; font-size: 17px; max-width: 56ch; }
.sos-hero__tag { color: var(--sos-orange); font-weight: 800; }
.sos-hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.sos-hero__art img { border-radius: 16px; width: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.sos-hero__badge { aspect-ratio: 4 / 3; border-radius: 18px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .15); display: grid; grid-template-columns: auto 1fr; align-content: center; gap: 10px 16px; padding: 28px; font-size: 22px; }
.sos-hero__badge span { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--sos-orange); font-size: 28px; font-weight: 800; }
.sos-hero__badge strong { align-self: center; }

/* Sections */
.sos-section { margin-top: 44px; }
.sos-section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sos-section__head h2 { margin: 0; font-size: 26px; }
.sos-section__head a { color: var(--sos-orange); font-weight: 700; text-decoration: none; }
.sos-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.sos-steps li { background: #fff; border-radius: var(--sos-r); box-shadow: var(--sos-sh); padding: 18px; display: flex; gap: 14px; }
.sos-steps b { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--sos-orange); color: #fff; display: grid; place-items: center; font-size: 18px; }
.sos-steps h3 { margin: 0 0 4px; font-size: 17px; }
.sos-steps p { margin: 0; color: var(--sos-muted); }
.sos-programs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.sos-program { background: #fff; border-radius: var(--sos-r); box-shadow: var(--sos-sh); padding: 24px; }
.sos-program--accent { border-top: 5px solid var(--sos-orange); }
.sos-program__ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #FFF1E0; color: var(--sos-orange); font-size: 24px; font-weight: 800; }
.sos-program h2 { margin: 12px 0 8px; }
.sos-program ul { padding-inline-start: 20px; color: #334155; }
.sos-band { background: var(--sos-navy); border-radius: 22px; padding: 32px; display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.sos-band h2 { color: #fff; margin: 0; }
.sos-band div { display: flex; gap: 12px; flex-wrap: wrap; }
.sos-admin-hint { background: #FFF7EC; border: 1px dashed var(--sos-orange); border-radius: 12px; padding: 14px 18px; }

/* Pages */
.sos-page { padding-top: 24px; padding-bottom: 48px; }
.sos-page__title { font-size: 30px; margin: 0 0 18px; }
.sos-card { background: #fff; border-radius: var(--sos-r); box-shadow: var(--sos-sh); padding: 24px; }
.sos-entry { margin-bottom: 18px; }
.sos-404 { text-align: center; }
.sos-404__code { font-size: 72px; font-weight: 800; color: var(--sos-orange); margin: 0; line-height: 1; }

/* WooCommerce */
.woocommerce ul.products { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0 !important; padding: 0; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
.woocommerce ul.products li.product { width: auto !important; margin: 0 !important; float: none !important; background: #fff; border-radius: var(--sos-r); box-shadow: var(--sos-sh); padding: 12px; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.woocommerce ul.products li.product:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 27, 45, .1); }
.woocommerce ul.products li.product a img { border-radius: 10px; margin-bottom: 10px; aspect-ratio: 1; object-fit: cover; background: #EEF2F7; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 15px; color: var(--sos-ink); padding: 0; }
.woocommerce ul.products li.product .price { color: var(--sos-orange) !important; font-weight: 800; font-size: 18px !important; }
.woocommerce ul.products li.product .button { margin-top: auto; width: 100%; }
.woocommerce span.onsale { background: var(--sos-orange); border-radius: 8px; min-height: auto; min-width: auto; padding: 2px 10px; line-height: 1.6; }
.woocommerce div.product { background: #fff; border-radius: var(--sos-r); box-shadow: var(--sos-sh); padding: 24px; }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--sos-orange); font-weight: 800; font-size: 26px; }
.woocommerce div.product .product_title { font-size: 28px; }
.woocommerce .quantity .qty { min-height: 44px; border-radius: 10px; border: 1px solid var(--sos-line); }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce form .form-row select, .select2-container .select2-selection--single { min-height: 46px; border-radius: 10px; border: 1px solid var(--sos-line); padding: 8px 12px; }
.woocommerce-message, .woocommerce-info, .woocommerce-error { border-radius: 12px; border-top-width: 0 !important; border-inline-start: 4px solid var(--sos-orange); }
.woocommerce-breadcrumb { color: var(--sos-muted); }
.woocommerce-products-header__title { font-size: 30px; }

.sos-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff; border-radius: var(--sos-r); box-shadow: var(--sos-sh); padding: 12px; margin-bottom: 16px; }
.sos-filters label { margin: 0; }
.sos-filters input, .sos-filters select { min-height: 44px; border: 1px solid var(--sos-line); border-radius: 10px; padding: 8px 10px; font: inherit; background: #fff; }
.sos-filters__q { flex: 1 1 220px; }
.sos-filters__q input { width: 100%; }
.sos-filters__price input { width: 110px; }
.sos-filters__reset { color: var(--sos-muted); font-size: 14px; }
.woocommerce .woocommerce-result-count { color: var(--sos-muted); }
.woocommerce .woocommerce-ordering select { min-height: 40px; border-radius: 10px; border: 1px solid var(--sos-line); padding: 4px 10px; }
.woocommerce-checkout .sos-content, .woocommerce-cart .sos-content { padding: 20px; }
.woocommerce-checkout #payment { border-radius: var(--sos-r); }
.b3m-pay-instructions { background: #FFF7EC; border: 1px dashed var(--sos-orange); border-radius: 12px; padding: 14px 18px; margin: 16px 0; }

/* Footer */
.sos-footer { background: var(--sos-navy); color: #CBD5E1; margin-top: 56px; }
.sos-footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; padding-top: 36px; padding-bottom: 24px; }
.sos-footer h2 { color: #fff; font-size: 16px; margin: 0 0 10px; }
.sos-footer ul { list-style: none; margin: 0; padding: 0; }
.sos-footer li { margin-bottom: 6px; }
.sos-footer a { color: #CBD5E1; text-decoration: none; }
.sos-footer a:hover { color: #fff; }
.sos-footer__slogan { color: var(--sos-orange); font-weight: 700; }
.sos-social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sos-social a { border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.sos-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .1); text-align: center; padding: 14px 16px; font-size: 14px; }

/* Responsive */
@media (max-width: 1024px) {
	.woocommerce ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
	.sos-burger { display: inline-grid; place-items: center; }
	.sos-header__in { gap: 10px; }
	.sos-nav { position: absolute; inset-inline: 0; top: 100%; background: var(--sos-navy); border-top: 1px solid rgba(255, 255, 255, .1); display: none; padding: 8px 16px 16px; }
	.sos-nav.is-open { display: block; }
	.sos-menu { flex-direction: column; }
	.sos-menu a { padding: 12px; }
	.sos-actions { margin-inline-start: auto; }
	.sos-hide-sm { display: none !important; }
	.sos-hero { grid-template-columns: 1fr; padding: 28px 20px; }
	.sos-hero__art { display: none; }
	.sos-footer__grid { grid-template-columns: 1fr; }
	.woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
.sos-show-sm { display: none !important; }
@media (max-width: 860px) {
	.sos-show-sm { display: inline-flex !important; }
	.sos-acc { width: 44px; padding: 0; }
	.sos-acc span { display: none; }
}
@media (max-width: 480px) {
	.sos-logo__sub { display: none; }
	.sos-logo__txt { font-size: 20px; }
	.sos-header__in { gap: 6px; }
	.sos-actions { gap: 6px; }
	.sos-lang a { padding: 4px 8px; min-width: 30px; }
	.sos-section__head h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; }
}

/* Android app download (top bar + footer badge) */
.sos-appbar { background: var(--sos-orange); color: var(--sos-navy); font-size: 14px; }
.sos-appbar__in { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px; min-height: 44px; padding-block: 5px; }
.sos-appbar svg { flex: none; }
.sos-appbar__txt { font-weight: 700; }
.sos-appbar__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 16px; border-radius: 999px; background: var(--sos-navy); color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.sos-appbar__btn:hover { background: #000; color: #fff; }
.sos-footer .sos-app-badge { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; min-height: 54px; padding: 8px 18px; border-radius: 12px; background: #000; border: 1px solid rgba(255, 255, 255, .3); color: #fff; text-decoration: none; line-height: 1.25; }
.sos-footer .sos-app-badge:hover { border-color: #fff; color: #fff; }
.sos-app-badge svg { color: #3DDC84; flex: none; }
.sos-app-badge small { display: block; font-size: 12px; color: #CBD5E1; }
.sos-app-badge b { display: block; font-size: 16px; }
.b3m-native .sos-apk-only { display: none !important; }
@media print { .sos-apk-only { display: none !important; } }

/* Floating WhatsApp button */
.sos-wa-float { position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 60; width: 56px; height: 56px; border-radius: 50%; background: #25D366; color: #fff; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .22); transition: transform .15s ease; }
.sos-wa-float:hover { transform: scale(1.06); color: #fff; }
.sos-wa-float:focus-visible { outline: 3px solid #0B1F3A; outline-offset: 3px; }
.b3m-area .sos-wa-float { display: none; }
@media (prefers-reduced-motion: reduce) { .sos-wa-float { transition: none; } }
@media print { .sos-wa-float { display: none; } }
