/* Logotipos oficiales FLAIRE TOOLS y cabecera de búsqueda persistente. */
html body.has-ecom-fixed-header > div.border-bottom.ecom-site-header:first-of-type {
  position: fixed !important;
  z-index: 1030 !important;
  top: 0 !important;
  right: 0 !important;
  left: 0 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  isolation: isolate;
}

body.has-ecom-fixed-header {
  padding-top: var(--ecom-fixed-header-height, 118px) !important;
}

html body.has-ecom-fixed-header .navbar-brand img.ecom-official-logo {
  display: block !important;
  width: 210px !important;
  max-width: 210px !important;
  height: auto !important;
  max-height: 60px !important;
  border-radius: 0 !important;
  object-fit: contain !important;
}

html body.has-ecom-fixed-header .navbar-brand img.ecom-official-logo-print {
  display: none !important;
}

.flaire-footer-logo {
  display: block;
  width: min(100%, 255px) !important;
  max-width: 255px !important;
  height: auto !important;
  max-height: none !important;
  margin-bottom: 1.25rem;
  border-radius: 0 !important;
  object-fit: contain;
}

@media (max-width: 1199.98px) {
  html body.has-ecom-fixed-header .navbar-brand img.ecom-official-logo {
    width: 185px !important;
    max-width: 185px !important;
  }
}

@media (max-width: 991.98px) {
  html body.has-ecom-fixed-header > div.border-bottom.ecom-site-header:first-of-type {
    box-shadow: 0 5px 18px rgba(0, 54, 95, .16) !important;
  }

  .ecom-site-header .navbar {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  .ecom-mobile-brand {
    overflow: hidden;
  }

  html body.has-ecom-fixed-header .ecom-mobile-brand img.ecom-official-logo {
    width: 168px !important;
    max-width: 168px !important;
    max-height: 45px !important;
  }

  .ecom-search-col {
    margin-top: 0 !important;
  }
}

@media (max-width: 575.98px) {
  html body.has-ecom-fixed-header .ecom-mobile-brand img.ecom-official-logo {
    width: 142px !important;
    max-width: 142px !important;
    max-height: 38px !important;
  }

  .ecom-site-header .ecom-search-col .input-group {
    height: 42px !important;
  }

  .ecom-site-header .ecom-search-col .input-group > .form-control,
  .ecom-site-header .ecom-search-col .input-group > .btn {
    height: 40px !important;
    min-height: 40px !important;
  }
}

/* Menú de cuenta compacto: en móvil funciona como una hoja inferior. */
@media (max-width: 767.98px) {
  #offcanvasAccount.offcanvas-start {
    top: auto !important;
    right: 10px !important;
    bottom: 10px !important;
    left: 10px !important;
    width: auto !important;
    height: auto !important;
    max-height: min(72dvh, 440px) !important;
    overflow: hidden !important;
    border: 1px solid #cbd6de !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 22px 60px rgba(0, 31, 56, .28) !important;
    transform: translateY(calc(100% + 20px)) !important;
  }

  #offcanvasAccount.offcanvas-start.show:not(.hiding),
  #offcanvasAccount.offcanvas-start.showing {
    transform: none !important;
  }

  #offcanvasAccount .offcanvas-header {
    min-height: 54px;
    padding: 12px 14px 8px !important;
    border-bottom: 1px solid #e5ebf0;
  }

  #offcanvasAccount .offcanvas-title {
    font-size: 1rem !important;
    font-weight: 800;
  }

  #offcanvasAccount .btn-close {
    width: 36px;
    height: 36px;
    margin: -5px -5px -5px auto !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background-color: #f1f5f8 !important;
    background-size: 12px !important;
  }

  #offcanvasAccount .offcanvas-body {
    flex: 0 1 auto !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding: 8px 10px 12px !important;
  }

  #offcanvasAccount .nav-pills {
    gap: 2px;
  }

  #offcanvasAccount .nav-pills .nav-link {
    display: flex;
    min-height: 40px;
    align-items: center;
    padding: 9px 11px !important;
    border-radius: 9px !important;
    font-size: .88rem;
  }

  #offcanvasAccount .nav-item hr {
    margin: 6px 0 !important;
  }

  body:has(#offcanvasAccount.show) > .offcanvas-backdrop.show,
  body:has(#offcanvasAccount.showing) > .offcanvas-backdrop.show {
    opacity: .28 !important;
    backdrop-filter: blur(2px);
  }
}

/* Menú general compacto del encabezado para celulares y tabletas. */
@media (max-width: 991.98px) {
  html body .ecom-mobile-backdrop {
    display: block !important;
    z-index: 1200 !important;
    background: rgba(0, 31, 56, .38) !important;
    backdrop-filter: blur(3px);
  }

  html body .ecom-mobile-backdrop[hidden] {
    display: none !important;
  }

  html body .ecom-mobile-drawer {
    display: flex !important;
    z-index: 1210 !important;
    top: auto !important;
    right: 10px !important;
    bottom: 10px !important;
    left: 10px !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: min(72dvh, 520px) !important;
    overflow: hidden !important;
    border: 1px solid #cbd6de !important;
    border-radius: 20px !important;
    background: #fff !important;
    box-shadow: 0 24px 70px rgba(0, 31, 56, .32) !important;
    transform: translateY(calc(100% + 24px)) !important;
  }

  html body .ecom-mobile-drawer.is-open {
    transform: none !important;
  }

  .ecom-mobile-drawer-header {
    position: relative;
    flex: 0 0 auto;
    min-height: 62px;
    padding: 16px 16px 11px !important;
    border-bottom: 1px solid #e4ebf0 !important;
  }

  .ecom-mobile-drawer-header::before {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: #c5d0d9;
    content: "";
    transform: translateX(-50%);
  }

  .ecom-mobile-drawer-header small {
    display: block;
    margin-bottom: 2px;
    color: #526779;
    font-size: .58rem;
    font-weight: 900;
    letter-spacing: .13em;
  }

  .ecom-mobile-drawer-header h2 {
    color: #00365f !important;
    font-size: 1.05rem !important;
    font-weight: 850;
  }

  .ecom-mobile-close {
    width: 38px !important;
    height: 38px !important;
    border: 0 !important;
    border-radius: 50% !important;
    color: #334b5e !important;
    background: #edf2f5 !important;
    font-size: 1.35rem;
    line-height: 1;
  }

  .ecom-mobile-drawer-content {
    flex: 0 1 auto !important;
    min-height: 0;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding: 10px 12px calc(14px + env(safe-area-inset-bottom)) !important;
  }

  .ecom-mobile-nav-main {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px !important;
  }

  .ecom-mobile-nav-main a {
    min-height: 58px !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center !important;
    justify-content: stretch !important;
    gap: 9px;
    padding: 8px 10px !important;
    border-color: #d9e2e9 !important;
    border-radius: 11px !important;
    font-size: .82rem;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 54, 95, .04);
  }

  .ecom-mobile-nav-main a:first-child,
  .ecom-mobile-nav-main a:nth-child(2) {
    border-color: #b7cce0 !important;
    background: #f3f8fc;
  }

  .ecom-mobile-nav-main a:nth-child(5) {
    grid-column: 1 / -1;
    border-color: #9dbbd3 !important;
    background: linear-gradient(135deg, #edf6fc, #f8fbfd);
  }

  .ecom-mobile-nav-main a > i {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 9px;
    color: #005ca9;
    background: #e7f1f9;
    font-size: .95rem;
  }

  .ecom-mobile-nav-main a > span {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #163047;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ecom-mobile-nav-main a > span > small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #64798b;
    font-size: .62rem !important;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 359.98px) {
  .ecom-mobile-nav-main {
    grid-template-columns: 1fr;
  }

  .ecom-mobile-nav-main a:nth-child(5) {
    grid-column: auto;
  }

  .ecom-mobile-nav-main a {
    min-height: 48px !important;
  }
}

@media print {
  body.has-ecom-fixed-header {
    padding-top: 0 !important;
  }

  html body.has-ecom-fixed-header > div.border-bottom.ecom-site-header:first-of-type {
    position: static !important;
    box-shadow: none !important;
  }

  html body.has-ecom-fixed-header .navbar-brand img.ecom-official-logo-screen {
    display: none !important;
  }

  html body.has-ecom-fixed-header .navbar-brand img.ecom-official-logo-print {
    display: block !important;
  }

  .ecom-site-header .ecom-search-col,
  .ecom-site-header .ecom-mobile-menu-toggle,
  .ecom-site-header .ecom-mobile-iconbar,
  .ecom-site-header .ecom-desktop-nav,
  .ecom-site-header .ecom-mobile-shop-dock {
    display: none !important;
  }
}
