/* Rewa Tour — brand mark, mobile drawer and app-style bottom tab bar */

/* ── Brand ──────────────────────────────────────── */
.rb {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  text-decoration: none;
}
.rb__mark {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  overflow: hidden;
  border: 1.5px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(140deg, #5fd0e0, #0f5c6e 55%, #e0a44e) border-box;
  box-shadow: 0 8px 20px -10px rgba(14, 116, 144, .6);
  transition: transform .4s cubic-bezier(.3, 1.4, .5, 1), box-shadow .3s;
}
.rb__mark::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .85) 50%, transparent 60%);
  translate: -120% 0;
  animation: rbShine 6s ease-in-out infinite 1.5s;
  pointer-events: none;
}
@keyframes rbShine { 0%, 70% { translate: -120% 0; } 85%, 100% { translate: 120% 0; } }
.rb__mark img,
.rewa-site-header .rb__mark .rewa-brand__logo {
  width: 44px;
  height: 44px;
  border-radius: 0;
  object-fit: contain;
  transition: transform .4s cubic-bezier(.3, 1.4, .5, 1);
}
.rb:hover .rb__mark { transform: translateY(-1px); box-shadow: 0 12px 26px -10px rgba(14, 116, 144, .75); }
.rb:hover .rb__mark img { transform: rotate(-6deg) scale(1.06); }
.rb__text { display: flex; flex-direction: column; min-width: 0; text-align: left; line-height: 1; }
.rb__name {
  display: flex;
  font-family: 'Montserrat', 'Poppins', 'Tajawal', system-ui, sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
}
.rb__name b { font-weight: 800; color: #0f5c6e; }
.rb__name i { font-style: normal; font-weight: 800; color: #2a9aac; }
.rb__tag {
  margin-top: 5px;
  font-family: 'Montserrat', 'Poppins', system-ui, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: #5f7378;
  white-space: nowrap;
}
.rb--light .rb__name b { color: #fff; }
.rb--light .rb__name i { color: #7fe0ec; }
.rb--light .rb__tag { color: rgba(226, 244, 247, .6); }
.rewa-site-header .rewa-brand.rb { max-width: none; }
html[data-scheme="dark"] .rb:not(.rb--light) .rb__name b { color: #e2f4f7; }
html[data-scheme="dark"] .rb:not(.rb--light) .rb__tag { color: rgba(226, 244, 247, .6); }

@media (max-width: 1100px) {
  .rb__mark { width: 44px; height: 44px; border-radius: 14px; }
  .rb__mark img, .rewa-site-header .rb__mark .rewa-brand__logo { width: 40px; height: 40px; }
  .rb__name { font-size: 19px; }
  .rb__tag { font-size: 8.5px; letter-spacing: .3em; }
}
@media (max-width: 360px) {
  .rb__name { font-size: 17px; }
  .rb__tag { letter-spacing: .22em; }
}

/* ── Drawer ─────────────────────────────────────── */
@media (max-width: 1100px) {
  .rewa-drawer {
    width: min(380px, 90vw);
    background: #f3f8f9;
  }
  .rewa-drawer__top {
    position: relative;
    display: block;
    padding: 18px 18px 16px;
    overflow: hidden;
    background:
      radial-gradient(260px 160px at 100% 0%, rgba(95, 208, 224, .35), transparent 70%),
      radial-gradient(240px 160px at 0% 100%, rgba(224, 164, 78, .25), transparent 70%),
      linear-gradient(155deg, #0a4553, #04232b);
  }
  .rewa-drawer__top::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.4px);
    background-size: 16px 16px;
    pointer-events: none;
  }
  .rewa-drawer__top > * { position: relative; z-index: 1; }
  .rewa-drawer__head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .rewa-drawer__close { border-radius: 14px; }
  .rewa-drawer__hello { margin: 16px 2px 12px; font-size: 14.5px; font-weight: 700; color: rgba(226, 244, 247, .9); }
  .rewa-drawer__quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .rewa-drawer__q {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 74px;
    padding: 10px 6px;
    border-radius: 16px;
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    transition: transform .2s, background .2s;
  }
  .rewa-drawer .rewa-drawer__q { font-size: 12.5px !important; font-family: inherit; }
  .rewa-drawer button.rewa-drawer__link { width: 100%; font-family: inherit; }
  .rewa-drawer__q i { font-size: 24px; color: #7fe0ec; }
  .rewa-drawer__q:active { transform: scale(.96); }
  .rewa-drawer__q:hover { background: rgba(255, 255, 255, .14); }
  .rewa-drawer__q--gold { color: #3a2506; background: linear-gradient(135deg, #f3c77d, #e0a44e); border-color: transparent; }
  .rewa-drawer__q--gold i { color: #3a2506; }
  .rewa-drawer__q--wa i { color: #5ee69a; }

  .rewa-drawer__scroll { padding: 4px 14px 18px; }
  .rewa-drawer__links { gap: 6px; }
  .rewa-drawer__link {
    position: relative;
    min-height: 56px;
    border-radius: 16px;
    border: 1px solid rgba(6, 47, 57, .06);
    box-shadow: 0 4px 14px -10px rgba(4, 35, 43, .35);
  }
  .rewa-drawer__link-icon {
    border-radius: 13px;
    color: #0e7490;
    background: linear-gradient(145deg, #e3f5f8, #cdebf0);
    transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), background .2s, color .2s;
  }
  .rewa-drawer__link:hover .rewa-drawer__link-icon,
  .rewa-drawer__link.is-current .rewa-drawer__link-icon { color: #fff; background: linear-gradient(140deg, #0f5c6e, #14a3b8); transform: rotate(-6deg); }
  .rewa-drawer__link.is-current { border-color: rgba(14, 116, 144, .35); background: linear-gradient(150deg, #fff, #eef8fa); }
  .rewa-drawer__link.is-current::before {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    inset-inline-start: -1px;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, #5fd0e0, #e0a44e);
  }
  .rewa-drawer__link-chevron { transition: translate .25s; }
  .rewa-drawer__link:hover .rewa-drawer__link-chevron { translate: -3px 0; color: #0e7490; }
  [dir="ltr"] .rewa-drawer__link:hover .rewa-drawer__link-chevron { translate: 3px 0; }

  .rewa-drawer__panel { border-radius: 20px; border-color: rgba(6, 47, 57, .07); }

  .rewa-drawer.is-open .rewa-drawer__q,
  .rewa-drawer.is-open .rewa-drawer__link,
  .rewa-drawer.is-open .rewa-drawer__panel {
    animation: rxDrawIn .5s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--n, 0) * 35ms + 120ms);
  }
  @keyframes rxDrawIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* ── Bottom tab bar ─────────────────────────────── */
.rx-tabbar { display: none; }

@media (max-width: 900px) {
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }

  .rx-tabbar {
    position: fixed;
    inset-inline: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 95;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    height: 68px;
    padding: 0 6px 8px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
            backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, .7);
    box-shadow: 0 18px 40px -16px rgba(4, 35, 43, .45), 0 0 0 1px rgba(6, 47, 57, .06);
    animation: rxTabbarIn .6s cubic-bezier(.2, .9, .3, 1.15) both .2s;
  }
  @keyframes rxTabbarIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

  .rx-tabbar__blob {
    position: absolute;
    top: 8px;
    left: 0;
    width: 58px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(150deg, rgba(95, 208, 224, .22), rgba(14, 116, 144, .14));
    box-shadow: inset 0 0 0 1px rgba(14, 116, 144, .14);
    transform: translateX(calc(var(--x, -100px) - 50%));
    opacity: 0;
    transition: transform .55s cubic-bezier(.3, 1.35, .5, 1), opacity .25s;
    pointer-events: none;
  }
  .rx-tabbar.has-blob .rx-tabbar__blob { opacity: 1; }

  .rx-tab {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    color: #6b8489;
    -webkit-tap-highlight-color: transparent;
  }
  .rx-tab > i { font-size: 23px; line-height: 1; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1), color .2s; }
  .rx-tab__label { font-size: 11px; font-weight: 700; line-height: 1.2; white-space: nowrap; transition: color .2s; }
  .rx-tab.is-active { color: #0e7490; }
  .rx-tab.is-active > i { transform: translateY(-3px) scale(1.12); }
  .rx-tab.is-active .rx-tab__label { font-weight: 800; }
  .rx-tab.is-pop > i { animation: rxTabPop .5s cubic-bezier(.3, 1.6, .5, 1); }
  @keyframes rxTabPop { 0% { transform: scale(1); } 40% { transform: translateY(-6px) scale(1.25) rotate(-8deg); } 100% { transform: translateY(-3px) scale(1.12); } }

  .rx-tab--center { justify-content: flex-end; }
  .rx-tab__fab {
    position: absolute;
    top: -26px;
    left: 50%;
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin-left: -30px;
    border-radius: 50%;
    color: #fff;
    background:
      radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .35), transparent 45%),
      linear-gradient(150deg, #14a3b8, #0f5c6e 60%, #0a4553);
    border: 4px solid #fff;
    box-shadow: 0 14px 28px -10px rgba(14, 116, 144, .9);
    transition: transform .45s cubic-bezier(.3, 1.6, .5, 1);
  }
  .rx-tab__fab i { font-size: 26px; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
  .rx-tab__ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(224, 164, 78, .7);
    animation: rxTabRing 2.6s ease-out infinite;
  }
  @keyframes rxTabRing { 0% { opacity: .9; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.35); } }
  .rx-tab--center .rx-tab__label { color: #0f5c6e; font-weight: 800; }
  .rx-tab--center:active .rx-tab__fab { transform: scale(.92); }
  .rx-tab--center.is-active .rx-tab__fab i,
  .rx-tab--center:hover .rx-tab__fab i { transform: rotate(90deg); }

  /* Lift floating buttons above the bar */
  .rewa-wa-float { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
  .rafeeq-root { bottom: calc(166px + env(safe-area-inset-bottom)) !important; }
  .rewa-back-top { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
  .rewa-pwa-bar { bottom: calc(90px + env(safe-area-inset-bottom)) !important; }

  /* Rafeeq as a full app screen above the tab bar */
  html .rafeeq-root .rafeeq-panel {
    position: fixed;
    top: 0;
    bottom: auto;
    inset-inline: 0;
    z-index: 96;
    width: auto;
    height: calc(100vh - 104px - env(safe-area-inset-bottom));
    height: calc(100dvh - 104px - env(safe-area-inset-bottom));
    min-height: 0;
    border-radius: 0 0 28px 28px;
    border: 0;
    box-shadow: 0 30px 60px -20px rgba(4, 35, 43, .55);
    animation: rafeeqScreenIn .45s cubic-bezier(.2, .9, .25, 1);
  }
  @keyframes rafeeqScreenIn { from { opacity: .4; transform: translateY(100%); } to { opacity: 1; transform: none; } }
  html .rafeeq-root .rafeeq-head { padding: calc(12px + env(safe-area-inset-top)) 14px 14px; }
  html .rafeeq-root .rafeeq-close__d { display: none; }
  html body .rafeeq-root .rafeeq-close__m { display: block; }
  html .rafeeq-root .rafeeq-close:hover { transform: none; }
  html .rafeeq-new span { display: none; }
  html .rafeeq-new { width: 38px; height: 38px; padding: 0; justify-content: center; }
  html .rafeeq-root .rafeeq-body { padding: 16px 14px 10px; }
  html .rafeeq-root .rafeeq-bubble { font-size: 15px; }
  html .rafeeq-root .rafeeq-composer input { font-size: 16px; }
  html .rafeeq-root .rafeeq-foot { padding: 10px 12px 12px; border-radius: 0 0 28px 28px; }
  html .rafeeq-root.is-open .rafeeq-fab,
  html .rafeeq-root.is-open .rafeeq-hello { opacity: 0; pointer-events: none; }
  html.rafeeq-lock, html.rafeeq-lock body { overflow: hidden; }
  html.rafeeq-lock .rewa-wa-float,
  html.rafeeq-lock .rewa-back-top { opacity: 0; pointer-events: none; }
  html.rafeeq-lock .rafeeq-root { z-index: 120; }
}
html .rafeeq-root .rafeeq-close__m { display: none; }

html[data-scheme="dark"] .rx-tabbar { background: rgba(4, 35, 43, .88); border-color: rgba(255, 255, 255, .08); }
html[data-scheme="dark"] .rx-tab { color: rgba(226, 244, 247, .6); }
html[data-scheme="dark"] .rx-tab.is-active { color: #7fe0ec; }
html[data-scheme="dark"] .rx-tab__fab { border-color: #04232b; }

@media (prefers-reduced-motion: reduce) {
  .rb__mark::after, .rx-tab__ring { animation: none; }
  .rx-tabbar__blob, .rx-tabbar { transition: none; }
  .rewa-drawer.is-open .rewa-drawer__q,
  .rewa-drawer.is-open .rewa-drawer__link,
  .rewa-drawer.is-open .rewa-drawer__panel { animation: none; }
}
