/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Body padding to account for fixed header */
body {
  padding-top: 120px; /* Adjust based on header height */
  transition: padding-top 0.3s ease;
  background: #f8f7ec;
}

/* When header-top is hidden, reduce body padding */
.header-container.scrolled ~ * body,
body.header-scrolled {
  padding-top: 80px;
}

/* Desktop only elements */
.desktop-only {
  display: block;
}

/* Mobile contact button - hidden by default */
.mobile-contact {
  display: none;
  padding: 20px;
  margin-top: 10px;
}

/* Mobile Menu Header - hidden by default on desktop */
.mobile-menu-header {
  display: none;
}

.mobile-menu-close {
  display: none;
}

.mobile-search-bar {
  display: none;
}

.mobile-menu-footer {
  display: none;
}

.mobile-menu-content {
  display: contents;
}

/* Contact Button Link Styles - Replaces button elements */
.contact-btn-link {
  display: inline-block;
  width: 112px !important;
  padding: 16px 0;
  font-size: 14px !important;
  font-weight: 600 !important;
  border: 1px solid #1f1f1f;
  background: #f8f7ec;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Montserrat", Arial, sans-serif;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
  color: #1f1f1f !important; /* Force black color, override browser defaults */
  text-align: center;
  line-height: normal !important;
}

.contact-btn-link:hover {
  background: #8e2929;
  color: #fff !important;
  border-color: #8e2929;
}

.contact-btn-link:visited {
  color: #1f1f1f !important;
}

.contact-btn-link:visited:hover {
  color: #fff !important;
}

/* Legacy button styles - kept for backwards compatibility if needed */
.mobile-contact button {
  width: 100%;
  padding: 18px;
  font-size: 14px;
  border: 1px solid #1f1f1f;
  background: #f8f7ec;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-family: "Montserrat", Arial, sans-serif;
  transition: background 0.2s, color 0.2s;
}

.mobile-contact button:hover {
  background: #8e2929;
  color: #fff;
  border-color: #8e2929;
}

/* Header Container - Fixed Position */
.header-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  transition: transform 0.3s ease;
}

/* Header container when scrolled - hide header-top */
.header-container.scrolled .header-top {
  transform: translateY(-100%);
  opacity: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
}

.header-container.scrolled {
  transform: translateY(0);
}

/* Header Top Bar */
.header-top {
  background: #1f1f1f;
  color: #fff;
  font-size: 16px;
  padding: 8px 160px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* border-bottom: 2px solid #289ff9; */
  transition: all 0.3s ease;
}

.header-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.header-top-left span {
  white-space: nowrap;
}

.header-top-right {
  display: flex;
  align-items: center;
}

.header-top-social {
  display: flex;
  gap: 12.842px;
  align-items: center;
}

.header-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #ffcc29;
  border-radius: 3.211px;
  color: #1f1f1f;
  text-decoration: none;
  transition: all 0.3s ease;
}

.header-social-link:hover {
  background: #f59e0b;
  transform: translateY(-2px);
}

.header-social-link svg {
  width: 19.263px;
  height: 19.263px;
}

.header-top-link {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
  cursor: pointer;
}

.header-top-link:hover {
  color: #ffcc29;
}

.schedule-call {
  color: #ffcc29;
  font-weight: 500;
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.schedule-call .arrow {
  font-size: 18px;
  color: #ffcc29;
}

/* Header Main Bar */
.header-main {
  background: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 160px;
  font-family: "Montserrat", Arial, sans-serif;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo img:first-child {
  width: 48px;
  height: 48px;
  background: #f8f7ec;
}

.header-logo .logo-text {
  height: 32px;
  width: auto;
  border-radius: 0;
  background: none;
}

.logo-title {
  display: flex;
  flex-direction: column;
}

.logo-main {
  font-size: 22px;
  font-weight: 700;
  color: #8e2929;
  letter-spacing: 1px;
}

.logo-sub {
  font-size: 10px;
  color: #444;
  font-weight: 500;
  letter-spacing: 1px;
}

.header-nav ul {
  display: flex;
  gap: 26px;
  list-style: none;
}

.header-nav a {
  color: #1f1f1f;
  text-decoration: none;
  font-size: 16px;
  font-weight: 400;
  transition: color 0.2s;
}

.header-nav .active > a {
  color: #8e2929;
  font-weight: 700;
  border-bottom: 0px solid #8e2929;
  padding-bottom: 2px;
}

.header-nav .dropdown-arrow {
  font-size: 10px;
  margin-left: 2px;
  transition: transform 0.3s ease;
}

/* Dropdown Menu Styles */
.header-nav .has-dropdown {
  position: relative;
}

.header-nav .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  min-width: 250px;
  padding: 10px 0;
  margin-top: 5px;
  z-index: 1000;
  list-style: none;
}

/* Create invisible bridge between menu and dropdown */
.header-nav .has-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px;
  display: none;
}

.header-nav .dropdown-menu li {
  padding: 0;
  border-bottom: none;
}

.header-nav .dropdown-menu a {
  display: block;
  padding: 12px 20px;
  color: #1f1f1f;
  font-size: 15px;
  transition: background 0.2s, color 0.2s;
}

.header-nav .dropdown-menu .active a {
  color: #8e2929;
}

.header-nav .dropdown-menu a:hover {
  background: #f5f5f5;
  color: #8e2929;
}

/* Show dropdown on hover for desktop */
@media (min-width: 769px) {
  .header-nav .has-dropdown:hover .dropdown-menu,
  .header-nav .dropdown-menu:hover {
    display: block;
  }

  .header-nav .has-dropdown:hover::after {
    display: block;
  }

  .header-nav .has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
  }

  /* Show dropdown on click/tap for tablets and touch devices */
  .header-nav .has-dropdown.dropdown-active .dropdown-menu {
    display: block;
  }

  .header-nav .has-dropdown.dropdown-active::after {
    display: block;
  }

  .header-nav .has-dropdown.dropdown-active .dropdown-arrow {
    transform: rotate(180deg);
  }
}

/* Desktop Contact Button Styles */
.header-contact .contact-btn-link {
  display: inline-block;
  padding: 16px 0;
  font-size: 14px;
  border: 1px solid #1f1f1f;
  background: #f8f7ec;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-family: "Montserrat", Arial, sans-serif;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
  color: #1f1f1f !important;
}

.header-contact .contact-btn-link:hover {
  background: #8e2929;
  color: #fff !important;
  border-color: #8e2929;
}

.header-contact .contact-btn-link:visited {
  color: #1f1f1f !important;
}

.header-contact .contact-btn-link:visited:hover {
  color: #fff !important;
}

/* Legacy button styles */
.header-contact button {
  padding: 16px;
  font-size: 14px;
  border: 1px solid #1f1f1f;
  background: #f8f7ec;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-family: "Montserrat", Arial, sans-serif;
  transition: background 0.2s, color 0.2s;
}

.header-contact button:hover {
  background: #8e2929;
  color: #fff;
  border-color: #8e2929;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: #1f1f1f;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Mobile Styles */
@media (max-width: 1024px) {
  .header-top,
  .header-main {
    padding: 15px 40px;
  }
}

@media (max-width: 900px) {
  /* Show header-top on mobile with centered layout */
  .header-top {
    display: flex;
    padding: 16px 20px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 8px;
  }

  .header-top-left {
    flex-direction: column;
    text-align: center;
    gap: 0;
    flex: none;
  }

  .header-top-left span {
    white-space: normal;
  }

  .header-top-right {
    margin: 0;
  }

  .header-top-social {
    gap: 12.842px;
  }

  .header-social-link {
    width: 32px;
    height: 32px;
  }

  .header-social-link svg {
    width: 19.263px;
    height: 19.263px;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 120px; /* Mobile with header-top */
  }

  /* When scrolled on mobile, reduce padding */
  .header-container.scrolled ~ * body,
  body.header-scrolled {
    padding-top: 65px;
  }

  .header-main {
    padding: 15px 20px;
    flex-wrap: wrap;
    position: relative;
  }

  .header-logo {
    flex: 1;
  }

  .mobile-menu-toggle {
    display: flex;
    order: 2;
  }

  /* Hide desktop contact button */
  .desktop-only {
    display: none;
  }

  /* Mobile Full Screen Menu */
  .header-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    /* Use dynamic viewport height that accounts for browser bars */
    height: 100dvh;
    background: #f8f7ec;
    z-index: 9999;
    overflow-y: auto;
    flex-direction: column;
    padding: 0;
    /* Smooth scrolling within menu */
    -webkit-overflow-scrolling: touch;
  }

  .header-nav.active {
    display: flex;
  }

  /* Mobile Menu Header */
  .mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 32px;
    background: #f8f7ec;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .mobile-header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-header-logo img:first-child {
    width: 44px;
    height: 44px;
    border-radius: 50%;
  }

  .mobile-header-logo .logo-text {
    height: 22.47px;
    width: auto;
  }

  .mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-close svg {
    width: 24px;
    height: 24px;
  }

  /* Mobile Search Bar */
  .mobile-search-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    margin: 0 32px 24px;
    border: 1px solid #cbcbd0;
    border-radius: 8px;
    background: #f8f7ec;
  }

  .mobile-search-bar svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  .mobile-search-bar input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 16px;
    color: #1f1f1f;
  }

  .mobile-search-bar input::placeholder {
    color: #cbcbd0;
  }

  /* Mobile Menu Content */
  .mobile-menu-content {
    flex: 1;
    padding: 0 32px;
    overflow-y: auto;
  }

  .header-nav ul {
    flex-direction: column;
    gap: 16px;
    padding: 24px 32px;
    margin-bottom: 0;
    list-style: none;
  }

  .header-nav li {
    border-bottom: none;
    padding: 0;
  }

  .header-nav li:last-child {
    border-bottom: none;
  }

  .header-nav a {
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    display: flex;
    width: 100%;
    color: #1f1f1f;
    text-decoration: none;
  }

  /* Mobile dropdown styles */
  .header-nav .has-dropdown > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .header-nav .dropdown-arrow {
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 10px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-nav .dropdown-menu {
    position: static;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
    margin: 10px 0 0 0;
    padding: 0;
    padding-left: 24px;
    min-width: auto;
    display: block;
    list-style: none;
  }

  .header-nav .dropdown-menu li {
    padding: 0;
  }

  .header-nav .dropdown-menu a {
    padding: 12px 0;
    font-size: 16px;
    border-bottom: none;
    background: transparent;
  }

  .header-nav .dropdown-menu li:last-child a {
    border-bottom: none;
  }

  /* Keep dropdown visible and arrow rotated by default on mobile */
  .header-nav .has-dropdown .dropdown-arrow {
    transform: rotate(180deg);
  }

  /* When collapsed (user clicks arrow), hide dropdown */
  .header-nav .has-dropdown.collapsed .dropdown-menu {
    display: none;
  }

  .header-nav .has-dropdown.collapsed .dropdown-arrow {
    transform: rotate(0deg);
  }

  /* Mobile Contact Button */
  .mobile-contact {
    display: block;
    padding: 0 32px;
    margin: 24px 0;
  }

  .mobile-contact a {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-contact button {
    width: 112px;
    padding: 16px 0;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #1f1f1f;
    background: #f8f7ec;
    border-radius: 8px;
    cursor: pointer;
    font-family: "Montserrat", Arial, sans-serif;
    transition: background 0.2s, color 0.2s;
    text-align: center;
  }

  .mobile-contact button:hover {
    background: #8e2929;
    color: #fff;
    border-color: #8e2929;
  }

  /* Mobile Footer */
  .mobile-menu-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px 32px;
    /* Add extra padding at bottom for mobile browser bars */
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 60px));
    margin-top: auto;
    /* Ensure footer is always accessible */
    flex-shrink: 0;
  }

  .mobile-social-icons {
    display: flex;
    gap: 16px;
    align-items: center;
  }

  .social-icon {
    width: 40px !important;
    height: 40px !important;
    background: #ffcc29;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }

  .social-icon:hover {
    background: #e6b824;
  }

  .social-icon svg {
    width: 24px;
    height: 24px;
  }

  .mobile-copyright {
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #1f1f1f;
    text-align: center;
    margin: 0;
  }

  .header-contact {
    display: none;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 130px; /* Small mobile with header-top */
  }

  /* When scrolled on small mobile, reduce padding */
  .header-container.scrolled ~ * body,
  body.header-scrolled {
    padding-top: 60px;
  }

  .header-top {
    padding: 16px 15px;
    flex-direction: column;
    gap: 8px;
  }

  .header-top-left {
    flex-direction: column;
    text-align: center;
    gap: 0;
  }

  .header-top-left span {
    font-size: 14px;
    white-space: normal;
  }

  .header-top-social {
    gap: 12.842px;
  }

  .header-social-link {
    width: 32px;
    height: 32px;
  }

  .header-social-link svg {
    width: 19.263px;
    height: 19.263px;
  }

  .header-main {
    padding: 12px 15px;
  }

  .header-logo img:first-child {
    width: 40px;
    height: 40px;
  }

  .header-logo .logo-text {
    height: 28px;
  }

  .logo-main {
    font-size: 18px;
  }

  .logo-sub {
    font-size: 9px;
  }

  /* Mobile menu adjustments for smaller screens */
  .mobile-menu-header {
    padding: 12px 20px;
  }

  .mobile-search-bar {
    margin: 0 20px 24px;
  }

  .mobile-menu-content {
    padding: 0 20px;
  }

  .mobile-contact {
    padding: 0 20px;
    margin: 24px 0;
  }

  .mobile-menu-footer {
    padding: 24px 20px;
    /* Add extra padding at bottom for mobile browser bars on small screens */
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 60px));
  }
}

/* Mobile menu animation */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}
