/*
Theme Name: Methaq Theme
Theme URI: https://nabaaiq.com
Description: قالب مخصص لمعمل ميثاق السلام - الأتمتة الصناعية وحلول السيطرة والتحكم
Author: Nabaaiq
Version: 1.0.0
Text Domain: methaq-theme
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ===== Root Variables ===== */
:root {
  --b900: #071a3a;
  --b800: #0a2450;
  --b700: #0f2f66;
  --b600: #18407f;
  --b500: #24579b;
  --b400: #3a72b8;
  --b200: #b9d6ff;
  --sky: #6aa0de;
  --w: #fff;
  --w2: #f6f9ff;
  --ink: #0b1220;
  --muted: #4b5a73;
  --line: rgba(15, 23, 42, 0.12);
  --shadow: 0 18px 55px rgba(2, 6, 23, 0.12);
  --shadow2: 0 10px 28px rgba(2, 6, 23, 0.10);
  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 16px;
  --t: 0.22s ease;
}

/* ===== Base Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, #f4f8ff 55%, #f2f6ff 100%);
  direction: rtl;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform var(--t), box-shadow var(--t), background var(--t), border-color var(--t);
  white-space: nowrap;
  cursor: pointer;
}

.btn:focus-visible {
  outline: 3px solid rgba(106, 160, 222, 0.45);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--b400), var(--b700));
  color: #fff !important;
  box-shadow: 0 18px 44px rgba(36, 87, 155, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 60px rgba(36, 87, 155, 0.32);
}

.btn-outline {
  background: #fff;
  border-color: rgba(36, 87, 155, 0.25);
  color: var(--b700) !important;
}

.btn-outline:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow2);
  border-color: rgba(36, 87, 155, 0.35);
}

.btn-ghost {
  background: rgba(7, 26, 58, 0.06);
  border-color: rgba(7, 26, 58, 0.10);
  color: var(--b800) !important;
}

.btn-ghost:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow2);
}

/* ===== Header/Navigation ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  font-size: 18px;
  font-weight: 900;
  color: var(--b900);
}

.main-nav {
  display: flex;
  gap: 24px;
}

.main-nav a {
  font-weight: 800;
  font-size: 14px;
  color: rgba(7, 26, 58, 0.75);
  transition: color var(--t);
}

.main-nav a:hover,
.main-nav a.current {
  color: var(--b700);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  z-index: 1001;
  transition: background var(--t);
}

.mobile-menu-btn:hover {
  background: rgba(7, 26, 58, 0.05);
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--b800);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Navigation Overlay */
@media (max-width: 980px) {
  .mobile-menu-btn {
    display: flex;
  }

  .main-nav {
    display: flex !important;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    background: #fff;
    padding: 80px 24px 24px;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 999;
    gap: 0;
  }

  .main-nav.active {
    right: 0;
    display: flex !important;
  }

  .main-nav a {
    display: block;
    padding: 16px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--line);
  }

  .main-nav a:last-child {
    border-bottom: none;
  }

  /* Overlay */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  padding: 58px 0 42px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-blob {
  position: absolute;
  filter: blur(24px);
  opacity: 0.85;
  border-radius: 999px;
}

.hero-blob-1 {
  width: 520px;
  height: 520px;
  top: -260px;
  right: -220px;
  background: radial-gradient(circle at 30% 30%, rgba(106, 160, 222, 0.55), rgba(36, 87, 155, 0.18));
}

.hero-blob-2 {
  width: 620px;
  height: 620px;
  bottom: -320px;
  left: -280px;
  background: radial-gradient(circle at 30% 30%, rgba(36, 87, 155, 0.40), rgba(106, 160, 222, 0.14));
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(7, 26, 58, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(7, 26, 58, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 35%, rgba(0, 0, 0, 0.55), transparent 70%);
  opacity: 0.55;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.hero-copy h1 {
  margin: 0 0 10px;
  color: var(--b900);
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.12;
}

.hero-copy p {
  margin: 0 0 14px;
  color: rgba(7, 26, 58, 0.72);
  line-height: 2;
  font-size: 14.5px;
}

.badge {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(36, 87, 155, 0.10);
  color: var(--b800);
  border: 1px solid rgba(36, 87, 155, 0.16);
  margin-bottom: 10px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

/* ===== Cards ===== */
.card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(7, 26, 58, 0.10);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(10px);
}

.card h2,
.card h3 {
  margin: 0 0 6px;
  color: var(--b900);
  font-size: 18px;
}

.card p {
  margin: 0;
  color: rgba(7, 26, 58, 0.70);
  font-size: 13px;
  line-height: 1.9;
}

/* ===== Sections ===== */
.section {
  padding: 54px 0;
}

.section-soft {
  background: linear-gradient(180deg, rgba(106, 160, 222, 0.10), rgba(255, 255, 255, 0.75));
  border-top: 1px solid rgba(7, 26, 58, 0.06);
  border-bottom: 1px solid rgba(7, 26, 58, 0.06);
}

.section-head {
  margin-bottom: 16px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--b600);
  margin-bottom: 8px;
}

.section-head h2 {
  margin: 0 0 8px;
  color: var(--b900);
  font-size: 26px;
}

.section-head p {
  margin: 0;
  color: rgba(7, 26, 58, 0.70);
  line-height: 1.95;
  font-size: 14px;
}

/* ===== Footer ===== */
.site-footer {
  padding: 22px 0;
  border-top: 1px solid rgba(7, 26, 58, 0.06);
  background: rgba(255, 255, 255, 0.70);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: rgba(7, 26, 58, 0.75);
  font-weight: 900;
}

.site-footer strong {
  color: var(--b900);
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== Floating WhatsApp ===== */
.whatsapp-fab {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 9999;
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff !important;
  font-weight: 900;
  box-shadow: 0 16px 40px rgba(22, 163, 74, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: transform var(--t), box-shadow var(--t);
}

.whatsapp-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 55px rgba(22, 163, 74, 0.30);
}

/* ===== Responsive ===== */

/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {
  .container {
    padding: 0 24px;
  }

  .hero {
    padding: 40px 0 30px;
  }

  .section {
    padding: 40px 0;
  }

  .hero-inner {
    gap: 24px;
  }
}

/* Tablets */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-copy {
    order: 1;
  }

  .hero-card {
    order: 2;
    max-width: 500px;
    margin: 0 auto;
  }

  /* Remove display:none override - mobile menu uses slide-in animation from line 210-273 */

  .hero-actions {
    justify-content: center;
  }

  .badge {
    margin: 0 auto 10px;
  }

  /* Mobile Menu Button */
  .mobile-menu-btn {
    display: flex !important;
  }

  /* Cards Grid */
  .cards-grid,
  .services-grid,
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px;
  }

  /* Section Heads */
  .section-head {
    text-align: center;
  }

  /* Footer */
  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

/* Small Tablets / Large Phones */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 30px 0 24px;
  }

  .hero-copy h1 {
    font-size: clamp(24px, 6vw, 32px);
  }

  .hero-copy p {
    font-size: 14px;
  }

  .section {
    padding: 32px 0;
  }

  .section-head h2 {
    font-size: 22px;
  }

  /* Cards */
  .cards-grid,
  .services-grid,
  .products-grid {
    grid-template-columns: 1fr !important;
  }

  .card {
    padding: 14px;
  }

  /* Tabs */
  .ms-tabs,
  .tabs-wrapper {
    flex-direction: column;
    gap: 8px;
  }

  .ms-tab,
  .tab-btn {
    width: 100%;
    text-align: center;
  }

  /* About Page Duo Cards */
  .ma-duo {
    flex-direction: column;
    gap: 12px;
  }

  .ma-duo-card {
    width: 100%;
  }

  /* Process Steps */
  .ma-process-grid {
    grid-template-columns: 1fr !important;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr !important;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }
}

/* Mobile Phones */
@media (max-width: 560px) {
  .container {
    padding: 0 12px;
  }

  .hero {
    padding: 24px 0 20px;
  }

  .hero-copy h1 {
    font-size: 24px;
    line-height: 1.25;
  }

  .hero-copy p {
    font-size: 13px;
    line-height: 1.8;
  }

  .hero-actions {
    flex-direction: column;
    gap: 8px;
  }

  .btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 13px;
  }

  .badge {
    font-size: 11px;
  }

  .section {
    padding: 24px 0;
  }

  .section-head h2 {
    font-size: 20px;
  }

  .section-head p {
    font-size: 13px;
  }

  /* Cards */
  .card {
    padding: 12px;
    border-radius: 16px;
  }

  .card h2,
  .card h3 {
    font-size: 16px;
  }

  .card p {
    font-size: 12px;
  }

  /* Footer */
  .site-footer {
    padding: 16px 0;
  }

  .footer-links {
    gap: 8px;
    font-size: 12px;
  }

  /* WhatsApp Button */
  .whatsapp-fab {
    padding: 10px 14px;
    font-size: 13px;
    left: 12px;
    bottom: 12px;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  /* Hide decorative elements */
  .hero-blob,
  .hero-grid,
  .ma-blob {
    opacity: 0.4;
  }
}

/* Very Small Phones */
@media (max-width: 380px) {
  .container {
    padding: 0 10px;
  }

  .hero-copy h1 {
    font-size: 20px;
  }

  .btn {
    font-size: 12px;
    padding: 10px 14px;
  }

  .site-logo {
    font-size: 14px;
  }
}

/* Height-based adjustments for landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 20px 0 16px;
  }

  .hero-inner {
    grid-template-columns: 1fr 1fr;
  }

  .hero-copy h1 {
    font-size: 20px;
  }

  .section {
    padding: 20px 0;
  }
}

/* Print Styles */
@media print {

  .site-header,
  .site-footer,
  .whatsapp-fab,
  .mobile-menu-btn {
    display: none !important;
  }

  .hero {
    padding: 20px 0;
  }

  .section {
    padding: 20px 0;
    page-break-inside: avoid;
  }
}