/* Add custom CSS styles below */

/* ============================================
   TRIPS PIONEERS - CUSTOM HEADER v2
   ============================================ */

/* ── Hide original salla top-navbar completely ── */
.store-header .top-navbar {
  display: none !important;
}

/* ── Hide original nav icons (we replace them) ── */
#mainnav salla-user-menu,
#mainnav salla-cart-summary {
  visibility: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
}

/* ── Hide original hamburger ── */
#mainnav a.mburger {
  display: none !important;
}

/* ── Hide original menu from mainnav ── */
#mainnav custom-main-menu {
  display: none !important;
}

/* ============================================
   TOP BAR
   ============================================ */
#custom-top-bar {
  display: none !important;
  background: #1b2b3b;
  color: #ccd8e0;
  font-family: var(--font-main, 'DINNextLTArabic-Regular'), sans-serif;
  font-size: 13px;
  direction: rtl;
  width: 100%;
}

#custom-top-bar .tb-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tb-group {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tb-group a,
.tb-group span {
  color: #ccd8e0;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  transition: color .2s;
}

.tb-group a:hover { color: #fff; }

.tb-group svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.tb-sep {
  color: #3d5566;
  font-size: 18px;
  line-height: 1;
  user-select: none;
}

.tb-highlight {
  color: #fff;
  font-weight: bold;
}

/* ============================================
   MAIN NAV
   ============================================ */
#mainnav {
  background: #fff !important;
  box-shadow: 0 1px 0 #e4eaef !important;
  height: auto !important;
  min-height: unset !important;
  padding: 0 !important;
}

#mainnav > .inner {
  padding: 0 !important;
}

#mainnav .container {
  max-width: 1280px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
}

/* ── Grid: [لوجو] | [أيقونات + بحث] ── */
#mainnav .flex.items-stretch.justify-between {
  display: grid !important;
  grid-template-columns: auto 1fr !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  column-gap: 24px !important;
  row-gap: 8px !important;
  padding: 12px 0 !important;
  min-height: 100px !important;
}

/* ── اللوجو — عمود يسار (1)، ممتد على الصفين ── */
.navbar-brand {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  flex-shrink: 0 !important;
  grid-column: 1 !important;
  grid-row: 1 / 3 !important;
}

.navbar-brand img {
  height: 90px !important;
  width: auto !important;
  max-width: 230px !important;
  object-fit: contain !important;
}

.navbar-brand h1 { display: none !important; }

/* ── الأيقونات — صف 1، عمود 2 ── */
#custom-nav-icons {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 2px !important;
  flex-shrink: 0 !important;
}

/* ── البحث — صف 2، عمود 2 ── */
#custom-search-wrap {
  grid-column: 2 !important;
  grid-row: 2 !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  position: relative !important;
  direction: rtl !important;
}

#custom-search-input {
  width: 100%;
  height: 46px;
  background: #f3f6f9;
  border: 1.5px solid #dde4eb;
  border-radius: 8px;
  padding: 0 18px 0 56px;
  font-size: 14px;
  font-family: var(--font-main, 'DINNextLTArabic-Regular'), sans-serif;
  color: #2d3f4f;
  direction: rtl;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

#custom-search-input:focus {
  border-color: #004d73;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,77,115,.08);
}

#custom-search-input::placeholder { color: #9aabb8; }

#custom-search-btn {
  position: absolute;
  left: 0;
  top: 0;
  width: 52px;
  height: 46px;
  background: #004d73;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  flex-shrink: 0;
}

#custom-search-btn:hover { background: #003a58; }

#custom-search-btn svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.2;
}

/* ── أزرار الأيقونات ── */
.cni-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  border: none;
  color: #2d3f4f;
  font-family: var(--font-main, 'DINNextLTArabic-Regular'), sans-serif;
  font-size: 12px;
  text-decoration: none;
  transition: background .15s, color .15s;
  position: relative;
  min-width: 58px;
  white-space: nowrap;
}

.cni-btn:hover {
  background: #f0f5f9;
  color: #004d73;
}

.cni-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}

.cni-label {
  font-size: 12px;
  line-height: 1;
}

/* بادج السلة */
#cni-cart-badge {
  position: absolute;
  top: 3px;
  right: 8px;
  background: #004d73;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* الهامبرجر — مخفي على الديسكتوب */
#custom-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background .15s;
}
#custom-hamburger:hover { background: #f0f5f9; }
#custom-hamburger svg {
  width: 24px;
  height: 24px;
  stroke: #004d73;
  fill: none;
  stroke-width: 2;
  display: block;
}

/* ============================================
   MENU BAR (desktop)
   ============================================ */
#custom-menu-bar {
  background: #fff;
  border-top: 1px solid #edf1f5;
  border-bottom: 2px solid #e4eaef;
  direction: rtl;
  font-family: var(--font-main, 'DINNextLTArabic-Regular'), sans-serif;
  position: relative;
  z-index: 100;
}

.cmb-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: stretch;
  direction: rtl;
}

.cmb-item-wrap {
  position: relative;
}

.cmb-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 13px 16px;
  font-size: 14px;
  color: #2d3f4f;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .2s, border-color .2s;
  cursor: pointer;
}

.cmb-item:hover,
.cmb-item-wrap:hover > .cmb-item {
  color: #004d73;
  border-bottom-color: #004d73;
}

.cmb-chevron {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  transition: transform .2s;
  flex-shrink: 0;
}

.cmb-item-wrap:hover .cmb-chevron {
  transform: rotate(180deg);
}

/* Dropdown */
.cmb-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #e4eaef;
  border-top: 2px solid #004d73;
  border-radius: 0 0 8px 8px;
  min-width: 210px;
  box-shadow: 0 10px 28px rgba(0,0,0,.1);
  z-index: 200;
  padding: 6px 0;
  direction: rtl;
}

.cmb-item-wrap:hover .cmb-dropdown {
  display: block;
}

.cmb-dropdown a {
  display: block;
  padding: 9px 20px;
  font-size: 13.5px;
  color: #3a4f5f;
  text-decoration: none;
  transition: background .12s, color .12s, padding .12s;
}

.cmb-dropdown a:hover {
  background: #f0f6fa;
  color: #004d73;
  padding-right: 26px;
}

/* ============================================
   RESPONSIVE — TABLET 768-1024
   ============================================ */
@media (max-width: 1024px) {
  #custom-menu-bar { display: none; }

  #mainnav .flex.items-stretch.justify-between {
    grid-template-columns: auto 1fr auto auto !important;
    grid-template-rows: auto !important;
    row-gap: 0 !important;
    column-gap: 12px !important;
    align-items: center !important;
    min-height: 64px !important;
    padding: 8px 0 !important;
  }

  .navbar-brand {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  #custom-nav-icons {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  #custom-search-wrap {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  #custom-hamburger { display: flex; }

  .navbar-brand img {
    height: 48px !important;
  }

  #custom-search-input { height: 44px; font-size: 13.5px; }
  #custom-search-btn { height: 44px; width: 48px; }

  .cni-label { display: none; }
  .cni-btn { min-width: 44px; padding: 8px; gap: 0; }
  .cni-btn svg { width: 24px; height: 24px; }
  #cni-cart-badge { top: 2px; right: 4px; }
}

/* ============================================
   RESPONSIVE — MOBILE < 640
   ============================================ */
@media (max-width: 640px) {

  /* Top bar */
  #custom-top-bar .tb-inner {
    height: auto;
    flex-direction: column;
    padding: 8px 16px;
    gap: 6px;
    align-items: center;
    text-align: center;
  }

  .tb-group { justify-content: center; flex-wrap: wrap; gap: 8px; }
  .tb-sep { display: none; }

  /* Mainnav: صفين على الموبايل */
  #mainnav .container { padding: 0 14px !important; }

  #mainnav .flex.items-stretch.justify-between {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 0 !important;
    min-height: unset !important;
  }

  /* صف 1: هامبرجر + لوجو + أيقونات */
  #custom-hamburger { order: 1; }
  .navbar-brand { order: 2; flex: 1; justify-content: center; }
  #custom-nav-icons { order: 3; }

  /* صف 2: بحث كامل العرض */
  #custom-search-wrap {
    order: 4;
    width: 100%;
    max-width: 100%;
    flex-basis: 100%;
  }

  .navbar-brand img { height: 42px !important; }

  #custom-search-input { height: 42px; font-size: 13px; padding: 0 14px 0 48px; }
  #custom-search-btn { height: 42px; width: 46px; }
  #custom-search-btn svg { width: 18px; height: 18px; }

  .cni-btn { min-width: 40px; padding: 6px; }
  .cni-btn svg { width: 22px; height: 22px; }
  #cni-cart-badge { width: 16px; height: 16px; font-size: 9px; top: 2px; right: 2px; }
}