:root {
  --gold: #cda434;
  --red: #ff4b5e;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --pill: #ffffff;
  --radius: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Tajawal", system-ui, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: #fff;
  padding-top: 180px; /* Desktop logo height */
}
@media (max-width: 980px) {
  body {
    padding-top: 100px; /* Mobile logo height */
  }
}
a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1240px;
  margin: auto;
  padding: 0 16px;
}

/* ====== الشريط العلوي ====== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: normal;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
      flex-wrap: wrap;
    justify-content: space-between; /* logo left, burger right */
    padding: 10px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  height: 180px;
  width: auto;
  display: block;
  object-fit: contain;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid #d1d5db;
  background: var(--pill);
  font-weight: 600;
  line-height: 1;
}



.cta {
  background: var(--red);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

/* روابط القسم الأعلى */
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-inline-end: 14px;
  white-space: nowrap;
}

.nav a {
  color: #111827;
  font-weight: 500;
}

.nav a:hover {
  color: #000;
}

/* حسابي (منيو) */
.user {
  position: relative;
}

.user-menu {
  position: absolute;
  inset-inline-start: 0;
  top: 48px;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  display: none;
  z-index: 30;
}

.user.open .user-menu {
  display: block;
}

.user-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #374151;
}

.user-menu a:hover {
  background: #f3f4f6;
}

/* ====== صف الأيقونات ====== */
.tiles {
  display: flex;
  justify-content: center;
  gap: 70px;
  padding: 28px 0 10px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  filter: grayscale(0.1);
}

.tile span {
  font-weight: 600;
  color: #333;
}

.tile.active span {
  color: var(--gold);
}

.tile.active {
  position: relative;
}

.tile.active::after {
  content: "";
  position: absolute;
  bottom: -12px;
  height: 3px;
  width: 36px;
  background: var(--gold);
  border-radius: 3px;
}


/* ====== موبايل ====== */
.burger {
  display: none;
}

@media (max-width: 980px) {
  .nav {
    display: none;
    flex-direction: column;
    gap: 16px;
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 20px;
    z-index: 50;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  }

  .nav.active {
    display: flex;
    animation: fadeDown 0.3s ease;
  }

  @keyframes fadeDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* برغر */
  .burger {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: 10px;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    position: relative;
    z-index: 60;
  }

  /* Three lines */
  .burger-line {
    position: absolute;
    background: #111827;
    border-radius: 2px;
    transition: all 0.3s ease;
  }


  .topbar {
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 10px 0;
  }

  .logo img {
    height: 60px;
  }
}

/* ====== FIX WORDPRESS MENU ALIGNMENT ====== */
.nav ul,
#menu-main-menu,
#menu-main-menu > li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Make sure menu items align properly */
#menu-main-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Change to center if you want centered */
  gap: 25px;
}

/* Style for links */
#menu-main-menu a {
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #111;
  transition: color 0.3s ease;
}

#menu-main-menu a:hover {
  color: var(--red);
}

/* RTL fix */
html[dir="rtl"] #menu-main-menu {
  justify-content: flex-start;
}

/* Fix alignment on small screens (for your hamburger toggle) */
@media (max-width: 768px) {
  #menu-main-menu {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
}

/* ====== FIX WORDPRESS MENU ALIGNMENT (FINAL VERSION) ====== */

/* Remove default list styles */
.nav,
.nav ul,
.nav li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Force ul to behave as flex container */
.nav ul,
#menu-main-menu,
.nav > div > ul {
  display: flex !important;
  align-items: center;
  justify-content: flex-end; /* change to center if you want */
  gap: 25px;
  flex-wrap: wrap;
}

/* Fix WordPress wrapper <div> that may appear */
.nav > div {
  display: flex !important;
  width: 100%;
}

/* Style for menu links */
.nav a,
#menu-main-menu a {
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #111;
  transition: color 0.3s ease;
  display: inline-block;
  padding: 5px 0;
}

.nav a:hover,
#menu-main-menu a:hover {
  color: var(--red);
}

/* RTL (Arabic) fix */
html[dir="rtl"] .nav ul,
html[dir="rtl"] #menu-main-menu {
  justify-content: flex-start;
}

/* Responsive: stack menu under burger */
@media (max-width: 980px) {
  .nav,
  .nav ul,
  #menu-main-menu,
  .nav > div > ul {
    flex-direction: column !important;
    align-items: center;
    gap: 15px;
    width: 100%;
  }
}

@media (max-width: 980px) {
  /* Make sure topbar elements wrap nicely */
  .topbar {
    flex-wrap: wrap;
    justify-content: space-between; /* logo left, burger right */
    padding: 8px 12px;
  }

  /* Mobile menu */
  .nav {
    position: relative; /* was absolute, now stays in flow */
    top: 0;
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px; /* space below logo/burger */
  }

  .nav.active {
    display: flex;
  }

  /* Menu links alignment */
  #menu-main-menu {
    flex-direction: column;
    align-items: flex-start; /* aligns links to the left */
    gap: 10px;
    width: 100%;
  }

  html[dir="rtl"] #menu-main-menu {
    align-items: flex-end; /* for RTL sites */
  }

  /* Make burger stay on the right */
  .burger {
    margin-inline-start: auto; /* pushes it to the far side */
  }
    .logo img {
    height: 50px; /* smaller logo */
  }
   #menu-main-menu a,
  .nav a {
    font-size: 14px; /* smaller text */
    padding: 4px 0;
  }
   .burger {
     width: 36px;
    height: 36px;
  }
   .burger-line {
     width: 16px;
    height: 2px;
  }
  .burger-line:nth-child(1) {
    top: 10px; /* adjust vertical position */
  }

  .burger-line:nth-child(2) {
    top: 17px;
  }

  .burger-line:nth-child(3) {
    top: 24px;
  }

  /* Adjust X animation positions */
  .burger.active .burger-line:nth-child(1) {
    transform: rotate(45deg);
    top: 17px;
  }

  .burger.active .burger-line:nth-child(2) {
    opacity: 0;
  }

  .burger.active .burger-line:nth-child(3) {
    transform: rotate(-45deg);
    top: 17px;
  }
  .pill {
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
  }

   .tiles {
    gap: 30px;
    padding: 16px 0 8px;
  }

  .tile .ico {
    width: 36px;
    height: 36px;
  }

  .tile span {
    font-size: 13px;
  }

}
