/*
 * Fair E Web Host Client Shell v11
 * Navigation, header/footer and cart/checkout hardening.
 * Loaded after the v10 portal component styles.
 */

:root {
  --fwh-topbar: 68px;
  --fwh-sidebar: 246px;
  --fwh-shell-max: 1580px;
}

/* ---------- Shell stability ---------- */
html,
body.fwh-shell {
  max-width: 100%;
  overflow-x: clip;
}

body.fwh-shell .fwh-app {
  min-height: 100dvh;
}

body.fwh-shell .fwh-topbar {
  overflow: visible;
}

body.fwh-shell .fwh-topbar-inner {
  min-width: 0;
}

body.fwh-shell .fwh-main {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.fwh-shell .fwh-content {
  width: 100%;
  max-width: var(--fwh-shell-max);
  min-height: calc(100dvh - var(--fwh-topbar));
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

body.fwh-shell .fwh-content > .fwh-page-scope,
body.fwh-shell .fwh-content > .alert,
body.fwh-shell .fwh-content > .fwh-page-head {
  flex: 0 0 auto;
}

body.fwh-shell .fwh-footer {
  margin-top: auto;
  padding-top: 22px;
  padding-bottom: 2px;
}

/* Keep sidebar usable on short screens without showing a second visual scrollbar. */
body.fwh-shell .fwh-sidebar {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
body.fwh-shell .fwh-sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
body.fwh-shell .fwh-sidebar-footer {
  margin-top: auto;
  flex: 0 0 auto;
}

/* ---------- Full-service desktop navigation ---------- */
body.fwh-shell .fwh-global-tabs {
  gap: 3px;
  min-width: 0;
}

body.fwh-shell .fwh-global-tabs > a,
body.fwh-shell .fwh-global-tab {
  position: relative;
  height: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #526173;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

body.fwh-shell .fwh-global-tabs > a:hover,
body.fwh-shell .fwh-global-tab:hover,
body.fwh-shell .fwh-global-tab[aria-expanded="true"] {
  background: #f1f7f4;
  color: #0f5f2d;
}

body.fwh-shell .fwh-global-tabs > a.active,
body.fwh-shell .fwh-global-tab.active {
  background: #eaf7ef;
  color: #0f5f2d;
}

body.fwh-shell .fwh-global-tabs > a.active::after,
body.fwh-shell .fwh-global-tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -12px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--fwh-brand);
}

body.fwh-shell .fwh-global-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  align-self: stretch;
}

body.fwh-shell .fwh-global-tab .fa-chevron-down {
  margin-left: 2px;
  font-size: .62rem;
  opacity: .68;
  transition: transform .16s ease;
}

body.fwh-shell .fwh-global-tab[aria-expanded="true"] .fa-chevron-down {
  transform: rotate(180deg);
}

body.fwh-shell .fwh-nav-menu {
  width: 300px;
  margin-top: 0 !important;
  padding: 10px !important;
  border: 1px solid #dce6ed !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,.995) !important;
  box-shadow: 0 18px 48px rgba(15,23,42,.14) !important;
}

body.fwh-shell .fwh-nav-menu-services {
  width: min(580px, calc(100vw - 36px));
}

body.fwh-shell .fwh-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.fwh-shell .fwh-nav-section-title {
  padding: 4px 8px 7px;
  color: #8090a2;
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.fwh-shell .fwh-nav-menu .dropdown-item {
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 9px !important;
  border-radius: 9px;
  color: #263746;
  white-space: normal;
}

body.fwh-shell .fwh-nav-menu .dropdown-item i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #edf8f1;
  color: #15803d;
  font-size: .82rem;
}

body.fwh-shell .fwh-nav-menu .dropdown-item span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.22;
}

body.fwh-shell .fwh-nav-menu .dropdown-item strong {
  color: #163047;
  font-size: .78rem;
  font-weight: 800;
}

body.fwh-shell .fwh-nav-menu .dropdown-item small {
  margin-top: 2px;
  color: #758698;
  font-size: .68rem;
}

body.fwh-shell .fwh-nav-menu .dropdown-item:hover,
body.fwh-shell .fwh-nav-menu .dropdown-item:focus {
  background: #f2f8f5;
}

body.fwh-shell .fwh-nav-menu .dropdown-divider {
  margin: 7px 4px;
  border-color: #e7edf2;
}

/* ---------- Header collision protection ---------- */
body.fwh-shell .fwh-topbar-spacer {
  min-width: 8px;
}
body.fwh-shell .fwh-topbar-actions,
body.fwh-shell .fwh-brand-link,
body.fwh-shell .fwh-global-tabs {
  flex-shrink: 0;
}
body.fwh-shell .fwh-search-wrap {
  min-width: 220px;
  max-width: 380px;
  flex: 0 1 380px;
}

/* ---------- Footer ---------- */
body.fwh-shell .fwh-footer-row {
  align-items: center;
}
body.fwh-shell .fwh-footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

/* ---------- Cart / checkout functional polish ---------- */
body.fwh-shell .fwh-client-cart-index .summary-card,
body.fwh-shell .fwh-client-cart-checkout .checkout-side-sticky {
  position: sticky;
  top: calc(var(--fwh-topbar) + 18px);
}

body.fwh-shell .fwh-client-cart-checkout .payment-option {
  position: relative;
  overflow: hidden;
}
body.fwh-shell .fwh-client-cart-checkout .payment-option.is-selected {
  border-color: #159447 !important;
  background: #f4fbf6;
  box-shadow: 0 0 0 3px rgba(21,148,71,.08);
}
body.fwh-shell .fwh-client-cart-checkout .payment-option .form-check-input {
  margin-top: .15rem;
}
body.fwh-shell .fwh-client-cart-checkout .payment-detail-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #dce7ee;
  border-radius: 11px;
  background: #f9fbfc;
}
body.fwh-shell .fwh-client-cart-checkout .checkout-primary-action {
  min-height: 50px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .55rem;
}
body.fwh-shell .fwh-client-cart-checkout .checkout-payment-unavailable {
  border: 1px solid #f0d7a5;
  background: #fff9ea;
  border-radius: 10px;
  padding: 1rem;
}
body.fwh-shell .fwh-client-cart-checkout .checkout-total-note,
body.fwh-shell .fwh-client-cart-index .cart-total-note {
  color: #6f7f90;
  font-size: .72rem;
}

/* ---------- Responsive shell ---------- */
@media (max-width: 1180px) {
  body.fwh-shell .fwh-global-tabs,
  body.fwh-shell .fwh-search-wrap {
    display: none !important;
  }
  body.fwh-shell .fwh-menu-button {
    display: inline-flex;
  }
  body.fwh-shell .fwh-brand-link {
    width: auto;
    min-width: 0;
  }
  body.fwh-shell .fwh-brand-context {
    display: none;
  }
  body.fwh-shell .fwh-sidebar {
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 20px 0 45px rgba(16,26,36,.18);
  }
  body.fwh-nav-open .fwh-sidebar {
    transform: translateX(0);
  }
  body.fwh-nav-open {
    overflow: hidden;
  }
  body.fwh-shell .fwh-main {
    margin-left: 0;
  }
}

@media (min-width: 1181px) {
  body.fwh-shell .fwh-menu-button {
    display: none !important;
  }
  body.fwh-shell .fwh-mobile-backdrop {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  body.fwh-shell .fwh-client-cart-index .summary-card,
  body.fwh-shell .fwh-client-cart-checkout .checkout-side-sticky {
    position: static;
  }
}

@media (max-width: 767.98px) {
  body.fwh-shell .fwh-content {
    min-height: calc(100dvh - var(--fwh-topbar));
  }
  body.fwh-shell .fwh-footer-row {
    align-items: flex-start;
    flex-direction: column;
  }
  body.fwh-shell .fwh-footer-links {
    gap: 4px 14px;
  }
  body.fwh-shell .fwh-client-cart-checkout .payment-option .d-flex {
    align-items: flex-start !important;
    gap: 10px;
  }
  body.fwh-shell .fwh-client-cart-checkout .payment-option img,
  body.fwh-shell .fwh-client-cart-checkout .payment-option .fa-2x {
    display: none;
  }
}

@media (max-height: 700px) and (min-width: 1181px) {
  body.fwh-shell .fwh-sidebar {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  body.fwh-shell .fwh-sidebar-section {
    margin-top: 10px;
  }
  body.fwh-shell .fwh-side-link {
    min-height: 36px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  body.fwh-shell .fwh-sidebar-footer {
    margin-top: 12px;
    padding-top: 9px;
  }
}
