/* =============================================================================
   TCB MOBILE BOTTOM DOCK TOOLBAR, DRAWER UTILITIES & RESPONSIVE LOCKING
   ============================================================================= */

/* 1. GLOBAL ROOT CANVAS & OVERFLOW FIXES */
html {
  background-color: #000000 !important;
  max-width: 100vw !important;
}

body {
  background-color: #ffffff !important;
  max-width: 100vw !important;
}

/* Force Header and Dock Above Drawers */
header#masthead,
.site-header.tcb-header-fixed {
  z-index: 1000005 !important;
}

.tcb-mobile-dock {
  z-index: 1000005 !important;
}

footer.tcb-slim-footer {
  z-index: 1000005 !important;
}

/* HARD BACKGROUND SCROLL LOCK (CLEAN OVERFLOW LOCK FOR BODY BEHIND OVERLAYS) */
html.tcb-no-scroll,
body.tcb-no-scroll,
body.tcb-drawer-open {
  overflow: hidden !important;
  height: 100% !important;
  max-height: 100% !important;
}

/* Container-level horizontal scrolling for wide data tables */
.tcb-portal-table-container,
.woocommerce-account table.shop_table,
table.invoice_table,
.tcb-container table {
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* 2. DEFAULT DOCK STATE (HIDDEN ON DESKTOP COMPUTERS) */
.tcb-mobile-dock {
  display: none !important;
}

/* Display drawer header container cleanly for titles and close buttons */
.tcb-drawer-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 16px 20px !important;
  background: #111111 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* =============================================================================
   DRAWER POSITIONING BASE & SCROLLING LOCK
   ============================================================================= */
aside.tcb-drawer,
aside#tcbCategoryDrawer,
aside#tcbAccountDrawer,
.tcb-drawer {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  z-index: 1000010 !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important; /* Permits vertical internal drawer scrolling while page behind is locked */
}

.tcb-drawer-body {
  flex: 1 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  padding: 12px 0 !important;
}

/* =============================================================================
   3. TOUCH-FIRST & MOBILE POINTER OVERRIDES (PHONES & TOUCH TABLETS ONLY)
   ============================================================================= */
@media screen and (hover: none) and (pointer: coarse) {

  /* HIDE SLIM FOOTER ENTIRELY ON MOBILE & TABLET DEVICES */
  footer.tcb-slim-footer {
    display: none !important;
  }

  /* SHOW MOBILE BOTTOM DOCK */
  .tcb-mobile-dock {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 60px !important;
    background-color: #000000 !important;
    border-top: 1px solid #1a1a1a !important;
    z-index: 1000005 !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 0 4px !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4) !important;
    box-sizing: border-box !important;
  }

  /* Add padding to body so fixed dock doesn't obscure page content */
  body {
    padding-bottom: 60px !important;
  }

  /* MOBILE DOCK BUTTON BASE STYLES */
  .tcb-mobile-dock .tcb-dock-btn,
  .tcb-mobile-dock .tcb-dock-btn:link,
  .tcb-mobile-dock .tcb-dock-btn:visited {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    color: #ffffff !important;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), filter 0.15s ease !important;
  }

  .tcb-mobile-dock .tcb-dock-btn svg {
    stroke: #ffffff !important;
    transition: stroke 0.15s ease, transform 0.15s ease !important;
  }

  .tcb-mobile-dock .tcb-dock-mro-btn img {
    transition: transform 0.15s ease, filter 0.15s ease !important;
  }

  /* INSTANT TOUCH PRESS FEEDBACK (MOBILE DOCK ONLY) */
  .tcb-mobile-dock .tcb-dock-btn:active {
    transform: scale(0.88) !important;
  }

  .tcb-mobile-dock .tcb-dock-btn:active svg {
    stroke: #00a8ff !important;
  }

  /* TAP FEEDBACK ANIMATION CLASS (TRIGGERED EXCLUSIVELY ON MOBILE DOCK BUTTONS) */
  .tcb-mobile-dock .tcb-dock-btn.tcb-dock-tapped {
    animation: tcbDockPulse 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  }

  .tcb-mobile-dock .tcb-dock-btn.tcb-dock-tapped svg {
    stroke: #00a8ff !important;
    filter: drop-shadow(0 0 6px rgba(0, 168, 255, 0.8)) !important;
  }

  .tcb-mobile-dock .tcb-dock-btn.tcb-dock-tapped img {
    filter: drop-shadow(0 0 6px rgba(0, 168, 255, 0.8)) !important;
  }

  @keyframes tcbDockPulse {
    0% {
      transform: scale(1);
    }
    40% {
      transform: scale(0.82) rotate(-3deg);
    }
    70% {
      transform: scale(1.12) rotate(3deg);
    }
    100% {
      transform: scale(1) rotate(0deg);
    }
  }

  /* Cart Wrapper & Badge */
  .tcb-dock-cart-wrap {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .tcb-dock-cart-count {
    position: absolute !important;
    top: -6px !important;
    right: -8px !important;
    background-color: #ef4444 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    padding: 3px 6px !important;
    border-radius: 10px !important;
    border: 2px solid #000000 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
  }

  /* Slot 5: MRO Hub Logo */
  .tcb-mro-dock-img {
    width: 30px !important;
    height: 30px !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* 4. MOBILE/TABLET HEADER LAYOUT (SINGLE ROW: LOGO LEFT + SEARCH SPANS REST) */
  .tcb-mobile-hide,
  .tcb-desktop-only-group {
    display: none !important;
  }

  .tcb-header-row-primary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 8px 12px !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

  /* Logo anchored to the far left with restored size */
  .tcb-left-group {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
  }

  .tcb-brand-logo {
    margin-left: 0 !important;
  }

  .tcb-brand-logo img,
  .tcb-header-logo-img {
    max-height: 50px !important;
    height: 50px !important;
    width: auto !important;
    display: block !important;
    object-fit: contain !important;
  }

  /* Search Container fills remaining horizontal space */
  .tcb-desktop-search-container {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .tcb-desktop-search-container .tcb-search-form {
    display: flex !important;
    width: 100% !important;
    position: relative !important;
  }

  .tcb-desktop-search-container .tcb-search-input {
    width: 100% !important;
    height: 40px !important;
    padding: 0 40px 0 12px !important;
    border-radius: 6px !important;
    font-size: 13.5px !important;
    box-sizing: border-box !important;
  }

  .tcb-desktop-search-container .tcb-search-submit {
    position: absolute !important;
    right: 4px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    padding: 6px !important;
    cursor: pointer !important;
  }
}

/* =============================================================================
   5. INJECTED UTILITY LINKS (INSIDE CATEGORY DRAWER - CLEAN TEXT LINKS)
   ============================================================================= */
.tcb-drawer-utility-section {
  padding: 12px 16px 24px 16px !important;
  margin-top: 12px !important;
}

.tcb-drawer-solid-divider {
  height: 2px !important;
  background-color: #0066cc !important;
  margin-bottom: 16px !important;
  width: 100% !important;
}

.tcb-drawer-utility-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

/* Restored clean text link styling */
.tcb-blue-utility-link,
.tcb-blue-utility-link:link,
.tcb-blue-utility-link:visited {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background-color: transparent !important;
  color: #0066cc !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  padding: 6px 0 !important;
  border-radius: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: color 0.15s ease !important;
}

.tcb-blue-utility-link:hover,
.tcb-blue-utility-link:active {
  background-color: transparent !important;
  color: #004488 !important;
  text-decoration: underline !important;
}

/* =============================================================================
   6. GLOBAL GUEST TERMS MODAL POPUP
   ============================================================================= */
.tcb-terms-backdrop {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.65) !important;
  z-index: 9999998 !important;
}

.tcb-terms-backdrop.active {
  display: block !important;
}

.tcb-terms-popup-card {
  display: none;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 90% !important;
  max-width: 680px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  padding: 24px !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25) !important;
  z-index: 9999999 !important;
  box-sizing: border-box !important;
}

.tcb-terms-popup-card.active {
  display: block !important;
}

.tcb-terms-popup-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-bottom: 2px solid #e2e8f0 !important;
  padding-bottom: 12px !important;
  margin-bottom: 16px !important;
}

.tcb-terms-popup-header h3 {
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

.tcb-terms-popup-close-x {
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
  font-size: 24px !important;
  cursor: pointer !important;
}

.tcb-terms-popup-scrollbox {
  height: 360px !important;
  overflow-y: auto !important;
  padding: 16px 20px !important;
  font-size: 13px !important;
  color: #334155 !important;
  line-height: 1.6 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
  box-sizing: border-box !important;
}

.tcb-terms-popup-scrollbox h4 {
  font-size: 14px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 18px 0 6px 0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding-bottom: 4px !important;
  text-transform: uppercase !important;
}

.tcb-terms-popup-scrollbox h5 {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 12px 0 4px 0 !important;
}

.tcb-terms-notice-box {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  padding: 10px 14px !important;
  border-radius: 6px !important;
  color: #991b1b !important;
  font-weight: 600 !important;
  margin-bottom: 12px !important;
}

.tcb-terms-popup-footer {
  display: flex !important;
  justify-content: flex-end !important;
  margin-top: 16px !important;
  padding-top: 12px !important;
  border-top: 1px solid #e2e8f0 !important;
}

.tcb-terms-popup-btn-close {
  padding: 10px 22px !important;
  border-radius: 6px !important;
  border: none !important;
  background: #0066cc !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}