/**
 * Horizontal Traders - Responsive & Mobile Navigation Stylesheet
 */

/* ==========================================================================
   1. Mobile Off-Canvas Drawer & Overlay
   ========================================================================== */
.ht-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(3, 24, 48, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--ht-transition-base), visibility var(--ht-transition-base);
}

.ht-drawer-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.ht-mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(85vw, 380px);
  background-color: var(--ht-navy-950);
  color: var(--ht-white);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--ht-transition-base);
  box-shadow: var(--ht-shadow-lg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ht-mobile-drawer.is-active {
  transform: translateX(0);
}

.ht-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ht-drawer-header .ht-logo-img {
  max-height: 48px;
  max-width: 220px;
  filter: brightness(0) invert(1);
}

.ht-drawer-header .ht-logo-text {
  color: var(--ht-white);
  font-size: 20px;
}

.ht-drawer-close {
  width: 40px;
  height: 40px;
  border-radius: var(--ht-radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ht-white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ht-transition-fast);
}

.ht-drawer-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.ht-drawer-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.ht-drawer-nav__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ht-drawer-nav__item,
.ht-drawer-nav .ht-nav__item {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.ht-drawer-nav__link,
.ht-drawer-nav .ht-nav__link {
  display: block;
  flex-grow: 1;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 500;
  color: #D4E1EA;
  border-radius: var(--ht-radius-sm);
  transition: all var(--ht-transition-fast);
}

.ht-drawer-nav__link:hover,
.ht-drawer-nav .ht-nav__link:hover {
  color: var(--ht-white);
  background: rgba(255, 255, 255, 0.08);
}

.ht-drawer-nav__item--active > .ht-drawer-nav__link,
.ht-drawer-nav .ht-nav__item--active > .ht-nav__link,
.ht-drawer-nav .ht-nav__link[aria-current="page"] {
  color: var(--ht-white);
  font-weight: 700;
  background: rgba(7, 103, 122, 0.22);
  border-left: 3px solid var(--ht-teal-400);
}

.ht-drawer-nav .ht-nav__link::after {
	display: none;
}

.ht-drawer-nav__item .ht-nav__submenu-toggle,
.ht-drawer-nav .ht-nav__item .ht-nav__submenu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #D4E1EA;
  background: transparent;
  border-radius: var(--ht-radius-sm);
}

.ht-drawer-nav__item .ht-nav__submenu-toggle:hover,
.ht-drawer-nav .ht-nav__item .ht-nav__submenu-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ht-drawer-nav__item .ht-nav__chevron,
.ht-drawer-nav .ht-nav__item .ht-nav__chevron {
  transition: transform var(--ht-transition-fast);
}

.ht-drawer-nav__item.is-open > .ht-nav__submenu-toggle .ht-nav__chevron,
.ht-drawer-nav .ht-nav__item.is-open > .ht-nav__submenu-toggle .ht-nav__chevron {
  transform: rotate(180deg);
}

.ht-drawer-nav__sub-menu,
.ht-drawer-nav .ht-nav__sub-menu {
  display: none;
	position: static;
	opacity: 1;
	visibility: visible;
	transform: none;
	box-shadow: none;
	border: 0;
	background: transparent;
  width: 100%;
  padding-left: 16px;
  margin-top: 4px;
}

.ht-drawer-nav__item.is-open > .ht-drawer-nav__sub-menu,
.ht-drawer-nav .ht-nav__item.is-open > .ht-nav__sub-menu {
  display: block;
}

.ht-drawer-footer {
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: auto;
}

.ht-drawer-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #B5C6D4;
  font-size: 14px;
}

.ht-drawer-contact-item svg {
  color: var(--ht-teal-500);
  /* Without this the icon is squashed once the address beside it wraps,
     which happens in the drawer at very narrow widths. */
  flex-shrink: 0;
}

.ht-drawer-socials {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ht-drawer-faq-link {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 4px;
	padding: 12px 14px;
	border-radius: var(--ht-radius-sm);
	color: #d4e1ea;
	font-size: 16px;
	font-weight: 500;
}

.ht-drawer-faq-link:hover,
.ht-drawer-faq-link:focus-visible {
	color: #fff;
	background: rgba(255,255,255,.08);
}

.ht-drawer-faq-link svg { color: var(--ht-teal-400); }

.ht-drawer-book {
	width: 100%;
	margin-top: 22px;
}

/* ==========================================================================
   2. Mobile Bottom Navigation Bar
   ========================================================================== */
.ht-mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ht-white);
  border-top: 1px solid var(--ht-border);
  box-shadow: 0 -4px 20px rgba(3, 24, 48, 0.08);
  z-index: 999;
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

.ht-mobile-bottom-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  max-width: 500px;
  margin: 0 auto;
}

.ht-mobile-bottom-bar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  color: var(--ht-text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--ht-radius-sm);
  transition: color var(--ht-transition-fast);
}

.ht-mobile-bottom-bar__item svg {
  margin-bottom: 3px;
  color: currentColor;
}

.ht-mobile-bottom-bar__item:hover,
.ht-mobile-bottom-bar__item--active {
  color: var(--ht-teal-700);
}

/* Add padding to page bottom when mobile bottom bar is active */
body.ht-has-bottom-bar {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* ==========================================================================
   3. Breakpoints & Responsive Adaptations
   ========================================================================== */

/* Large Tablet / Small Laptop (1260px and below) */
@media (max-width: 1260px) {
  .ht-main-bar__inner {
    gap: 16px;
  }
  .ht-nav__list {
    gap: 4px;
  }
  .ht-nav__link {
    padding: 8px 10px;
    font-size: 14px;
  }
  .ht-header-actions .ht-btn {
    padding: 10px 16px;
    font-size: 13.5px;
  }
}

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
  .ht-top-bar {
    display: none; /* Hide top bar on smaller screens for clean presentation */
  }

  .ht-nav-desktop {
    display: none;
  }

  .ht-hamburger {
    display: flex;
  }

  .ht-footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ht-footer-col--brand {
    grid-column: span 2;
  }

  .ht-pre-footer-cta__inner {
    flex-direction: column;
    text-align: center;
    gap: 28px;
  }

  .ht-pre-footer-cta__actions {
    justify-content: center;
  }
}

/* Small Tablet / Large Phone (768px and below) */
@media (max-width: 768px) {
  .ht-logo-img,
  .custom-logo,
  .ht-logo-link img {
    height: 46px;
    max-width: 205px;
    max-height: 46px;
  }

  .ht-header-actions .ht-btn {
    padding: 10px 16px;
    font-size: 13.5px;
  }

  .ht-vehicle-grid {
    grid-template-columns: 1fr;
  }

  .ht-footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .ht-footer-col--brand {
    grid-column: span 1;
  }

  .ht-bottom-footer__inner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .ht-legal-menu {
    justify-content: center;
  }

  .ht-mobile-bottom-bar {
    display: block;
  }
}

/* Mobile Small (480px and below) */
@media (max-width: 480px) {
  .ht-logo-img,
  .custom-logo,
  .ht-logo-link img {
    height: 40px;
    max-width: 165px;
    max-height: 40px;
  }

  .ht-header-actions .ht-btn {
    display: none; /* Keep header clean: logo + hamburger */
  }

  .ht-hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .ht-hero__actions .ht-btn {
    width: 100%;
  }

  .ht-pre-footer-cta__actions {
    flex-direction: column;
    width: 100%;
  }

  .ht-pre-footer-cta__actions .ht-btn {
    width: 100%;
  }

  .ht-vehicle-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .ht-vehicle-card__footer .ht-btn {
    width: 100%;
  }
}
