/* Import Cairo font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap');

/* --- 1. Variables for Easy Customization (Using Your Colors) --- */
:root {
  --main-font: "Cairo", sans-serif;
  /* Your original colors */
  --primary-text-color: #414042;
  --hover-text-color: #222;
  --dropdown-bg: #ffffff; /* Explicitly white for the dropdown */
  --dropdown-hover-bg: #464a44;
  --dropdown-hover-text: #ffffff;
  --border-color-subtle: rgb(161, 156, 156, 0.1); /* New variable for subtle border */
  --border-color: white; /* Kept for other borders if needed */
  /* Kept from the enhanced version */
  --dropdown-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  --animation-speed: 0.3s;
  --animation-easing: ease-in-out;
}

.block-superfishmain{
  display: flex;
  justify-content: center;
  margin-right: 5% !important;
  width: 80% !important;
}

/* --- 2. Main Menu Container (#superfish-main) --- */
#superfish-main {
  display: flex; /* This makes it horizontal */
  list-style: none;
  margin: 0 auto;
  padding: 0;
  direction: rtl; /* For Arabic */
  font-family: var(--main-font);
  width: fit-content;
  position: relative;
}

/* --- 3. Top-Level Menu Items --- */
#superfish-main > li {
  position: relative;
  margin-left: 10px;
}

#superfish-main > li > a,
#superfish-main > li > span.nolink {
  position: relative;
  display: block;
  color: var(--primary-text-color);
  padding: 10px 7px;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9em;
  transition: color var(--animation-speed) var(--animation-easing);
  white-space: nowrap;
  background: white !important;
}

/* Remove border from the last top-level menu item */
#superfish-main > li:last-child > a,
#superfish-main > li:last-child > span.nolink {
  border-bottom: none;
}

/* Text color change on hover */
#superfish-main > li:hover > a,
#superfish-main > li.sfHover > a,
#superfish-main > li > a:focus,
#superfish-main > li > a.is-active {
  color: var(--hover-text-color) !important;
}

/* --- 4. Dropdown Menu (Sub-menu) Styling --- */
#superfish-main ul {
  background: var(--dropdown-bg);

  box-shadow: var(--dropdown-shadow);

  margin-top: 5px;
  border: 1px solid var(--border-color); /* This is the border for the entire dropdown box */
  position: absolute;
  z-index: 999;
}

/* Styles for the individual items within the dropdowns (sf-depth-2 items) */
/* This targets the 'a' tags inside ul.sf-menu.sf-style-white li li li */
#superfish-main li li li a { /* More specific selector for nested items */
  background: white !important; /* Set background to white as requested */
  border-bottom: 1px solid var(--border-color-subtle); /* Apply subtle border as requested */
  color: var(--primary-text-color) !important; /* Ensure text color is consistent */
  padding: 12px 20px;
  font-size: 0.9em;
  font-weight: bold;
  transition: background-color var(--animation-speed) var(--animation-easing),
              color var(--animation-speed) var(--animation-easing);
}

/* Remove border from the last item at this specific nesting level (sf-depth-2) */
#superfish-main li li li:last-child a {
  border-bottom: none;
}

/* Sub-menu item hover effect */
#superfish-main ul li:hover > a,
#superfish-main ul li.sfHover > a {
  background-color: var(--dropdown-hover-bg) !important;
  color: var(--dropdown-hover-text) !important;
}

/* --- 5. Smooth Dropdown Animation --- */
#superfish-main ul.sf-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity var(--animation-speed) var(--animation-easing),
              transform var(--animation-speed) var(--animation-easing),
              visibility 0s var(--animation-speed);
}

#superfish-main li:hover > ul,
#superfish-main li.sfHover > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

/* --- 6. Icons (for desktop dropdowns) --- */
/* Hide the default Superfish text arrow (») */
#superfish-main .sf-sub-indicator {
  display: none;
}

/* Style and animate the Font Awesome dropdown icon (caret-down) */
#superfish-main li.menuparent > a::after,
#superfish-main li.menuparent > span::after  {
  content: "\f078"; /* Font Awesome caret-down icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 8px;
  display: inline-block;
  opacity: 0.5;
  transition: transform var(--animation-speed) var(--animation-easing);
}

/* Rotate the icon when the menu is hovered/open */
#superfish-main li.menuparent:hover > a::after,
#superfish-main li.menuparent.sfHover > a::after,
#superfish-main li.menuparent:hover > span::after {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--hover-text-color);
}

/* General Superfish menu background (might be redundant depending on other rules) */
ul.sf-menu.sf-style-default li,
ul.sf-menu.sf-style-default.sf-navbar {
  background: white !important;
}

/* Promotions badge styling */
#superfish-main .sf-depth-1 > a[href="/promotions"] {
  position: relative;
  padding-left: 35px !important;
}

#superfish-main .sf-depth-1 > a[href="/promotions"]::after {
  content: "حصري";
  position: absolute;
  top: 5px;
  left: 0;
  font-size: 10px;
  color: white;
  background-color: red;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: bold;
}
