/**
 * Navigation Component
 * Responsive navbar with sticky behavior and Bootstrap 5 integration
 */

.navbar {
  padding: 1rem 0;
  transition: all 0.3s ease;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar.scrolled {
  padding: 0.5rem 0;
  box-shadow: 0 4px 12px rgba(25, 12, 1, 0.15);
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
}

.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.navbar-brand:hover {
  opacity: 0.8;
}

.navbar-brand img {
  height: 50px;
  transition: height 0.3s ease;
}

.navbar.scrolled .navbar-brand img {
  height: 40px;
}

/* Navigation Links */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  color: #190C01;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
  text-decoration: none;
  border-radius: 4px;
  position: relative;
  /* Minimum touch target size */
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-link:hover {
  color: #9C7C3A;
}

.nav-link.active {
  color: #9C7C3A;
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background-color: #9C7C3A;
}

/* CTA Button */
.btn-cta {
  background-color: #B56C53;
  color: #fff;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  display: inline-block;
  /* Minimum touch target size */
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-cta:hover {
  background-color: #9C5A43;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(181, 108, 83, 0.3);
  color: #fff;
}

/* Mobile Hamburger Menu */
.navbar-toggler {
  border: none;
  background: transparent;
  padding: 0.5rem;
  cursor: pointer;
  display: none;
  /* Minimum touch target size */
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(156, 124, 58, 0.25);
}

.navbar-toggler-icon {
  display: block;
  width: 25px;
  height: 2px;
  background-color: #190C01;
  position: relative;
  transition: all 0.3s ease;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: '';
  display: block;
  width: 25px;
  height: 2px;
  background-color: #190C01;
  position: absolute;
  transition: all 0.3s ease;
}

.navbar-toggler-icon::before {
  top: -8px;
}

.navbar-toggler-icon::after {
  bottom: -8px;
}

/* Hamburger Animation */
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
  background-color: transparent;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
  transform: rotate(45deg);
  top: 0;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
  transform: rotate(-45deg);
  bottom: 0;
}

/* Navbar Collapse */
.navbar-collapse {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-grow: 1;
  position: relative;
}

/* Logo centered positioning */
.navbar-brand.mx-auto {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* CTA container */
.navbar-cta {
  display: flex;
  align-items: center;
}

/* Responsive Styles */
@media (max-width: 991px) {
  .navbar-toggler {
    display: flex;
  }

  .navbar-collapse {
    display: none;
    width: 100%;
    margin-top: 1rem;
    flex-direction: column;
  }

  .navbar-collapse.show {
    display: flex;
  }

  .navbar-brand.mx-auto {
    position: static;
    transform: none;
    order: -1;
    margin-bottom: 1rem;
  }

  .navbar-nav {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0;
    margin: 0 !important;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    display: flex;
    width: 100%;
    padding: 0.875rem 1rem;
    min-height: 48px;
  }

  .nav-link.active::after {
    display: none;
  }

  .navbar-cta {
    width: 100%;
    margin: 1rem 0 0 0 !important;
  }

  .btn-cta {
    display: flex;
    width: 100%;
    text-align: center;
    padding: 0.875rem 1.5rem;
    justify-content: center;
  }
}

/* Tablet specific adjustments (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
  .navbar {
    padding: 0.875rem 0;
  }
  
  .navbar-brand img {
    height: 45px;
  }
  
  .navbar.scrolled .navbar-brand img {
    height: 38px;
  }
}

/* Mobile specific adjustments (< 768px) */
@media (max-width: 767px) {
  .navbar {
    padding: 0.75rem 0;
  }
  
  .navbar-brand img {
    height: 40px;
  }
  
  .navbar.scrolled {
    padding: 0.5rem 0;
  }
  
  .navbar.scrolled .navbar-brand img {
    height: 35px;
  }
}

@media (min-width: 992px) {
  .navbar-collapse {
    display: flex !important;
  }
}

/* Sticky Behavior - Fixed navbar on scroll */
.navbar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1030;
}

/* Add padding to body to prevent content jump when navbar becomes fixed */
body {
  padding-top: 77px; /* Adjust based on navbar height */
}

@media (max-width: 991px) {
  body {
    padding-top: 72px;
  }
}

@media (max-width: 767px) {
  body {
    padding-top: 68px;
  }
}

/* Container Alignment */
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.navbar-nav.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Accessibility */
.nav-link:focus,
.btn-cta:focus,
.navbar-toggler:focus {
  outline: 2px solid #9C7C3A;
  outline-offset: 2px;
}

/* Skip to main content link for accessibility */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: #9C7C3A;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-main:focus {
  top: 0;
}
