/*
Theme Name:   Astra BEM
Theme URI:    https://bem.local
Description:  Child theme — منصة البيام الذكية | BEM TO AI
Author:       BEM Platform
Template:     astra
Version:      3.0.0
Text Domain:  astra-bem
*/

/* ══════════════════════════════════════════════════
   BEM TO AI — منصة البيام الذكية
   Font: Tajawal | Colors: Purple + Orange
   ══════════════════════════════════════════════════ */

/* Font loaded via <link> in functions.php for performance */

/* ─── Override Astra default accent color (pink→purple) ─────── */
:root {
  /* Astra uses these CSS vars internally */
  --ast-global-color-0: #8b5cf6 !important;
  --ast-global-color-1: #7c3aed !important;
  --ast-global-color-2: #f3f0ff !important;
}

/* ─── Variables ─────────────────────────────────── */
:root {
  --c-primary:    #8b5cf6;
  --c-pdark:      #7c3aed;
  --c-plight:     #f3f0ff;
  --c-accent:     #f59e0b;
  --c-adark:      #d97706;
  --c-text:       #2d2b3d;
  --c-muted:      #7c7a8a;
  --c-light:      #a5a3b3;
  --c-bg:         #f8f7ff;
  --c-surface:    #ffffff;
  --c-border:     #ebe5f6;
  --c-footer:     #1a1035;
  --r:            14px;
  --font:         'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  --shadow:       0 2px 20px rgba(139,92,246,.06);
  --shadow-md:    0 6px 30px rgba(139,92,246,.1);
}

/* ─── Reset & Global ────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body {
  font-family: var(--font) !important;
  direction: rtl;
  text-align: right;
  background: #fff;
  color: var(--c-text);
}
body * { font-family: var(--font) !important; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font) !important;
  color: var(--c-text) !important;
  line-height: 1.4 !important;
}
a { transition: color .2s; }
img { max-width: 100%; height: auto; }

/* ═══════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════ */
#masthead,
.site-header,
.ast-site-header-wrap {
  background: #fff !important;
  border-bottom: 1px solid var(--c-border) !important;
  box-shadow: 0 2px 20px rgba(139,92,246,.05) !important;
  direction: rtl;
  position: sticky;
  top: 0;
  z-index: 999;
  /* padding-right handled via inline critical CSS in functions.php */
}

/* Logo */
.site-title a,
.ast-site-identity .site-title a {
  font-weight: 900 !important;
  font-size: 21px !important;
  color: var(--c-primary) !important;
  text-decoration: none !important;
  letter-spacing: -.3px;
}
.site-description,
.ast-site-identity .site-description {
  font-size: 11px !important;
  color: var(--c-muted) !important;
  margin-top: 1px !important;
}

/* ─── Navigation ────────────────────────────────── */
#ast-hf-menu-1,
.main-navigation,
.ast-main-navigation,
.ast-nav-menu { direction: rtl !important; }

.ast-nav-menu .menu-item > a,
.main-navigation ul li > a {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--c-text) !important;
  padding: 8px 13px !important;
  border-radius: 8px !important;
  transition: all .18s !important;
  text-decoration: none !important;
}
.ast-nav-menu .menu-item > a:hover,
.main-navigation ul li > a:hover {
  color: var(--c-primary) !important;
  background: var(--c-plight) !important;
}
.ast-nav-menu .current-menu-item > a,
.main-navigation .current-menu-item > a {
  color: var(--c-primary) !important;
  font-weight: 700 !important;
}

/* Dropdown */
.ast-nav-menu .sub-menu,
.main-navigation .sub-menu {
  background: #fff !important;
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--shadow-md) !important;
  min-width: 190px !important;
  overflow: hidden !important;
}
.ast-nav-menu .sub-menu .menu-item > a {
  padding: 11px 16px !important;
  font-size: 14px !important;
  border-radius: 0 !important;
  border-bottom: 1px solid var(--c-border) !important;
}
.ast-nav-menu .sub-menu .menu-item:last-child > a { border-bottom: none !important; }

/* Header CTA Button */
.ast-header-custom-item .ast-custom-button,
.ast-header-button,
.menu-item-cta > a {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
  color: #fff !important;
  border-radius: 12px !important;
  padding: 10px 22px !important;
  font-weight: 800 !important;
  font-size: 14px !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(139,92,246,.2) !important;
  transition: all .25s ease !important;
}
.ast-header-custom-item .ast-custom-button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(139,92,246,.3) !important;
  color: #fff !important;
}

/* ─── Mobile hamburger button ───────────────────── */
/* Hide on desktop — Astra breakpoint is 921px */
@media (min-width: 922px) {
  .ast-mobile-menu-trigger,
  .ast-button-wrap .menu-toggle { display: none !important; }
}
/* Show purple on mobile */
@media (max-width: 921px) {
  .ast-mobile-menu-trigger,
  .ast-button-wrap .menu-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    float: left !important;
    background: var(--c-primary) !important;
    border-radius: 10px !important;
    padding: 8px 10px !important;
    border: none !important;
    cursor: pointer !important;
    transition: background .2s !important;
  }
  .ast-mobile-menu-trigger:hover,
  .ast-button-wrap .menu-toggle:hover { background: var(--c-pdark) !important; }
}

/* Hamburger icon — force white */
.ast-mobile-menu-trigger svg,
.ast-mobile-menu-trigger .ast-mobile-menu-icon,
.ast-button-wrap .menu-toggle svg {
  color: #fff !important;
  fill: #fff !important;
  stroke: #fff !important;
}
.ast-mobile-menu-trigger * { color: #fff !important; fill: #fff !important; }

/* ─── Mobile nav overlay / drawer ───────────────── */
.ast-mobile-popup-wrapper,
.ast-below-header-navigation,
.ast-below-header-navigation.ast-mobile-popup,
.astra-full-screen-menu-enable .main-navigation {
  direction: rtl !important;
  background: #fff !important;
  border-top: 3px solid var(--c-primary) !important;
  box-shadow: 0 8px 40px rgba(124,58,237,.15) !important;
}

/* Mobile menu items */
.ast-mobile-popup-wrapper .menu-item > a,
.ast-below-header-navigation .menu-item > a,
.ast-header-break-point .main-navigation .menu-item > a {
  font-family: var(--font) !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  color: var(--c-text) !important;
  padding: 14px 20px !important;
  border-bottom: 1px solid var(--c-border) !important;
  text-align: right !important;
  display: flex !important;
  align-items: center !important;
  transition: all .18s !important;
}
.ast-mobile-popup-wrapper .menu-item > a:hover,
.ast-below-header-navigation .menu-item > a:hover {
  color: var(--c-primary) !important;
  background: var(--c-plight) !important;
  padding-right: 26px !important;
}
.ast-mobile-popup-wrapper .current-menu-item > a,
.ast-below-header-navigation .current-menu-item > a {
  color: var(--c-primary) !important;
  border-right: 3px solid var(--c-primary) !important;
  background: var(--c-plight) !important;
  font-weight: 800 !important;
}

/* ═══════════════════════════════════════════════════
   PAGE CONTENT
   ═══════════════════════════════════════════════════ */
.site-content,
.ast-container { direction: rtl !important; }

.entry-content,
.page-content,
.ast-post-format-standard {
  direction: rtl !important;
  font-size: 16px !important;
  line-height: 1.85 !important;
  color: var(--c-text) !important;
}
.entry-title,
.page-title {
  font-weight: 900 !important;
  color: var(--c-text) !important;
  direction: rtl !important;
}

/* ─── Elementor ─────────────────────────────────── */
.elementor-section { direction: rtl; }
.elementor-widget-heading .elementor-heading-title { font-family: var(--font) !important; }
.elementor-widget-text-editor,
.elementor-widget-text-editor * { line-height: 1.8 !important; }

.elementor-button {
  font-weight: 800 !important;
  border-radius: 10px !important;
  min-height: 48px !important;
  transition: all .2s !important;
}
.elementor-button-wrapper .elementor-button {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
  border: none !important;
}
.elementor-button:hover { transform: translateY(-2px) !important; }

/* Icon boxes */
.elementor-widget-image-box .elementor-image-box-title,
.elementor-widget-icon-box .elementor-icon-box-title {
  font-weight: 800 !important;
  color: var(--c-text) !important;
}
.elementor-widget-image-box .elementor-image-box-description,
.elementor-widget-icon-box .elementor-icon-box-description {
  color: var(--c-muted) !important;
  line-height: 1.8 !important;
}

/* ═══════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════ */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
textarea,
select {
  font-family: var(--font) !important;
  direction: rtl !important;
  border-radius: 10px !important;
  border: 1.5px solid var(--c-border) !important;
  padding: 11px 15px !important;
  font-size: 15px !important;
  background: #faf9ff !important;
  color: var(--c-text) !important;
  transition: border-color .2s, box-shadow .2s !important;
  width: 100%;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--c-primary) !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,.1) !important;
  outline: none !important;
  background: #fff !important;
}

/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */
#colophon,
.site-footer,
.ast-footer-wrap {
  background: var(--c-footer) !important;
  color: #94a3b8 !important;
  direction: rtl !important;
  text-align: right !important;
}
#colophon a,
.site-footer a {
  color: #c4b5fd !important;
  text-decoration: none !important;
  transition: color .2s !important;
}
#colophon a:hover,
.site-footer a:hover { color: #fff !important; }
.ast-footer-copyright {
  color: #475569 !important;
  font-size: 13px !important;
  direction: rtl !important;
  padding: 10px 0 !important;
}
.ast-footer-widgets-area { direction: rtl !important; }
.ast-footer-widgets-area .widget-title {
  color: #e2e8f0 !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  text-transform: uppercase !important;
  letter-spacing: .6px !important;
  margin-bottom: 14px !important;
}
.ast-footer-widgets-area li a {
  color: #94a3b8 !important;
  font-size: 14px !important;
  line-height: 2 !important;
  transition: all .18s !important;
}
.ast-footer-widgets-area li a:hover {
  color: #c4b5fd !important;
  padding-right: 4px !important;
}

/* ═══════════════════════════════════════════════════
   BEM PLUGIN PAGES
   ═══════════════════════════════════════════════════ */
body.page-template-default #bem-platform-root { margin: 0 -16px; }
body.page-template-default .bem-auth          { margin: 48px auto; }
body.page-template-default .bem-dashboard     { margin: 28px auto; }

/* ═══════════════════════════════════════════════════
   KILL ASTRA DEFAULT PINK — override everywhere
   ═══════════════════════════════════════════════════ */

/* Any element using Astra's default pink accent */
a,
a:focus,
.ast-builder-grid-row a,
.ast-site-identity a:hover { color: var(--c-primary) !important; }

/* Astra's default button / CTA pink override */
.ast-button-wrap a,
.ast-custom-button,
.button,
button:not(.menu-toggle):not(.ast-mobile-menu-trigger):not(.bem-account-trigger):not(.bem-account-item):not(.bem-dark-toggle):not(.bem-auth__tab):not(.bem-tab):not(.bem-btn-solution):not([class*="bem-"]) {
  background-color: var(--c-primary) !important;
  border-color: var(--c-primary) !important;
}

/* Astra focus outline */
:focus { outline-color: var(--c-primary) !important; }

/* WooCommerce / misc pink elements */
.woocommerce a.button,
.woocommerce button.button { background-color: var(--c-primary) !important; }

/* ═══════════════════════════════════════════════════
   SCROLLBAR & SELECTION
   ═══════════════════════════════════════════════════ */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #d8b4fe; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a78bfa; }
::selection { background: rgba(124,58,237,.18); }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .ast-nav-menu .menu-item > a { font-size: 14px !important; padding: 7px 11px !important; }
}

@media (max-width: 768px) {
  .ast-mobile-menu-trigger { float: left !important; }
  .site-title a             { font-size: 18px !important; }
  .elementor-heading-title  { text-align: right !important; }
  .elementor-widget-container { direction: rtl !important; }
  .elementor-column         { padding: 0 10px !important; }
  .elementor-section        { padding-left: 14px !important; padding-right: 14px !important; }
  .ast-header-account-wrap,
  .ast-header-woo-cart      { display: none !important; }
}

@media (max-width: 480px) {
  .site-title a { font-size: 16px !important; }
  .ast-header-custom-item .ast-custom-button { padding: 8px 14px !important; font-size: 13px !important; }
  #colophon     { text-align: center !important; }
  .ast-footer-copyright { text-align: center !important; }
}

/* ═══════════════════════════════════════════════════
   ACCOUNT MENU — Override Astra interference
   ═══════════════════════════════════════════════════ */
.bem-account-menu,
.bem-account-menu * { box-sizing: border-box !important; }

.bem-account-dropdown {
  display: none !important;
  flex-direction: column !important;
}
.bem-account-dropdown.open {
  display: flex !important;
  flex-direction: column !important;
}

.bem-account-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 22px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--c-text) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  border: none !important;
  background: none !important;
  width: 100% !important;
  font-family: 'Tajawal', sans-serif !important;
  transition: background .15s !important;
  line-height: 1.4 !important;
  border-radius: 0 !important;
  min-height: auto !important;
  box-shadow: none !important;
  text-align: right !important;
  justify-content: flex-start !important;
}
.bem-account-item:hover {
  background: var(--c-plight) !important;
  color: var(--c-text) !important;
  transform: none !important;
  box-shadow: none !important;
}
.bem-account-item--danger { color: #ef4444 !important; }
.bem-account-item--danger:hover { background: #fef2f2 !important; color: #ef4444 !important; }

.bem-account-trigger {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
  border: 2.5px solid rgba(255,255,255,.4) !important;
  border-radius: 50% !important;
  min-height: auto !important;
}

.bem-dark-toggle {
  min-height: auto !important;
  box-shadow: none !important;
}

.bem-guest-controls .bem-dark-toggle {
  background: var(--c-surface) !important;
  border-color: var(--c-border) !important;
  color: var(--c-text) !important;
}

/* ═══════════════════════════════════════════════════
   DARK MODE — Astra Overrides
   ═══════════════════════════════════════════════════ */
.bem-dark {
  --c-text:    #e2e8f0;
  --c-muted:   #94a3b8;
  --c-light:   #64748b;
  --c-bg:      #0f0a1a;
  --c-surface: #1a1230;
  --c-border:  #2d2250;
  --c-plight:  #2e1065;
  --c-footer:  #0a0714;
}

/* ── Global dark background — covers ALL Astra wrappers ── */
.bem-dark,
.bem-dark body,
.bem-dark #page,
.bem-dark #content,
.bem-dark .site-content,
.bem-dark .ast-page-builder-template,
.bem-dark .ast-article-post,
.bem-dark .entry-content,
.bem-dark .page-content,
.bem-dark .ast-container,
.bem-dark .content-area {
  background: #0f0a1a !important;
  color: #e2e8f0 !important;
}

/* Astra inner wrappers */
.bem-dark .ast-article-inner-post,
.bem-dark .single-layout-1,
.bem-dark .page-layout-1,
.bem-dark .ast-single-post,
.bem-dark .post-inner-content {
  background: transparent !important;
  color: #e2e8f0 !important;
}

/* Header */
.bem-dark #masthead,
.bem-dark .site-header,
.bem-dark .ast-site-header-wrap {
  background: #110d1f !important;
  border-bottom-color: #2d2250 !important;
  box-shadow: 0 1px 16px rgba(0,0,0,.3) !important;
}

/* Navigation */
.bem-dark .ast-nav-menu .menu-item > a,
.bem-dark .main-navigation ul li > a {
  color: #cbd5e1 !important;
}
.bem-dark .ast-nav-menu .menu-item > a:hover,
.bem-dark .main-navigation ul li > a:hover {
  color: #a78bfa !important;
  background: #2e1065 !important;
}
.bem-dark .ast-nav-menu .current-menu-item > a {
  color: #a78bfa !important;
}

/* Dropdowns */
.bem-dark .ast-nav-menu .sub-menu,
.bem-dark .main-navigation .sub-menu {
  background: #1a1230 !important;
  border-color: #2d2250 !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.4) !important;
}
.bem-dark .ast-nav-menu .sub-menu .menu-item > a {
  border-bottom-color: #2d2250 !important;
}

/* Mobile nav */
.bem-dark .ast-mobile-popup-wrapper,
.bem-dark .ast-below-header-navigation {
  background: #1a1230 !important;
  border-top-color: #7c3aed !important;
}
.bem-dark .ast-mobile-popup-wrapper .menu-item > a,
.bem-dark .ast-below-header-navigation .menu-item > a {
  color: #cbd5e1 !important;
  border-bottom-color: #2d2250 !important;
}
.bem-dark .ast-mobile-popup-wrapper .menu-item > a:hover,
.bem-dark .ast-below-header-navigation .menu-item > a:hover {
  color: #a78bfa !important;
  background: #2e1065 !important;
}

/* Page content */
.bem-dark .entry-content,
.bem-dark .page-content,
.bem-dark .ast-post-format-standard {
  color: #cbd5e1 !important;
}
.bem-dark .entry-title,
.bem-dark .page-title {
  color: #e2e8f0 !important;
}
.bem-dark .site-content {
  background: #0f0a1a !important;
}
.bem-dark .ast-container {
  background: transparent !important;
}

/* Elementor */
.bem-dark .elementor-section,
.bem-dark .elementor-section-wrap { background: transparent; }
.bem-dark .elementor-widget-heading .elementor-heading-title { color: #e2e8f0 !important; }
.bem-dark .elementor-widget-text-editor { color: #cbd5e1 !important; }

/* Forms */
.bem-dark input[type="text"],
.bem-dark input[type="email"],
.bem-dark input[type="tel"],
.bem-dark input[type="password"],
.bem-dark input[type="search"],
.bem-dark textarea,
.bem-dark select {
  background: #1a1230 !important;
  border-color: #2d2250 !important;
  color: #e2e8f0 !important;
}
.bem-dark input:focus,
.bem-dark textarea:focus,
.bem-dark select:focus {
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 3px rgba(167,139,250,.2) !important;
  background: #241a40 !important;
}
.bem-dark input::placeholder,
.bem-dark textarea::placeholder {
  color: #64748b !important;
}

/* Footer */
.bem-dark #colophon,
.bem-dark .site-footer,
.bem-dark .ast-footer-wrap {
  background: #0a0714 !important;
}
.bem-dark #bem-custom-footer {
  background: #0a0714 !important;
  border-top-color: #7c3aed !important;
}

/* Scrollbar */
.bem-dark ::-webkit-scrollbar-thumb { background: #4c1d95; }
.bem-dark ::-webkit-scrollbar-thumb:hover { background: #6d28d9; }
.bem-dark ::selection { background: rgba(167,139,250,.25); }

/* Links */
.bem-dark a { color: #a78bfa !important; }
.bem-dark a:hover { color: #c4b5fd !important; }

/* Account menu dark */
.bem-dark .bem-account-item { color: #e2e8f0 !important; }
.bem-dark .bem-account-item:hover { background: #2e1065 !important; color: #e2e8f0 !important; }
.bem-dark .bem-account-item--danger { color: #fca5a5 !important; }
.bem-dark .bem-account-item--danger:hover { background: #450a0a !important; color: #fca5a5 !important; }
.bem-dark .bem-guest-controls .bem-dark-toggle { background: #1a1230 !important; border-color: #2d2250 !important; color: #e2e8f0 !important; }

/* Transition for smooth dark mode switch */
body, #masthead, .site-header, .ast-site-header-wrap,
.entry-content, .page-content, #colophon, .site-footer {
  transition: background-color .3s, color .3s, border-color .3s !important;
}
