/* Custom Header Element Styles */

/* Reset and Base Styles */
.custom-header-wrapper {
  position: relative;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  z-index: 1000;
}

.custom-header-wrapper * {
  box-sizing: border-box;
}

/* Container */
.custom-header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Top Bar Styles */
.custom-header-top-bar {
  background-color: #2196F3;
  color: #ffffff;
  font-size: 14px;
  padding: 8px 0;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.top-bar-left,
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.top-bar-address,
.top-bar-email,
.top-bar-phone {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ffffff;
  text-decoration: none;
}

.top-bar-email a,
.top-bar-phone {
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.top-bar-email a:hover,
.top-bar-phone:hover {
  opacity: 0.8;
}

.top-bar-phone {
  background-color: #f44336;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 500;
}

.top-bar-divider {
  color: rgba(255, 255, 255, 0.5);
  margin: 0 5px;
}

/* Main Header Styles */
.custom-header-main {
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 15px 0;
  position: relative;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Logo Styles */
.header-logo {
  flex-shrink: 0;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.logo-image {
  max-height: 50px;
  width: auto;
}

.logo-default {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2196F3, #1976D2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: bold;
  font-size: 18px;
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
  color: #2196F3;
}

/* Navigation Styles */
.header-navigation {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 30px;
}

.header-menu li {
  position: relative;
}

.header-menu a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 10px 0;
  transition: color 0.3s ease;
  text-transform: uppercase;
}

.header-menu a:hover {
  color: #2196F3;
}

/* Dropdown Menu */
.header-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 10px 0;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.header-menu li:hover .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-menu .sub-menu a {
  padding: 8px 20px;
  display: block;
  font-size: 14px;
  text-transform: none;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Search Styles */
.header-search {
  position: relative;
}

.search-form {
  display: flex;
  align-items: center;
  position: relative;
}

.search-input {
  width: 250px;
  min-width: 200px;
  padding: 10px 40px 10px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 25px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
  flex-shrink: 0;
}

.search-input:focus {
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
  background-color: #ffffff;
}

.search-button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.search-button:hover {
  color: #2196F3;
  background-color: rgba(33, 150, 243, 0.1);
}

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

.hamburger-line {
  width: 28px;
  height: 3px;
  background-color: #333;
  transition: all 0.3s ease;
  border-radius: 2px;
  display: block;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

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

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

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.mobile-menu-overlay.active {
  pointer-events: auto;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background-color: #ffffff;
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu-content {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.mobile-logo .logo-default {
  gap: 8px;
}

.mobile-logo .logo-icon {
  width: 35px;
  height: 35px;
  font-size: 16px;
}

.mobile-logo .logo-text {
  font-size: 16px;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
  padding: 5px;
}

/* Mobile Search */
.mobile-search {
  margin-bottom: 20px;
}

.mobile-search .search-input {
  width: 100%;
}

/* Mobile Navigation */
.mobile-navigation {
  margin-bottom: 20px;
}

.mobile-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu li {
  border-bottom: 1px solid #f0f0f0;
}

.mobile-menu a {
  display: block;
  padding: 12px 0;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.mobile-menu a:hover {
  color: #2196F3;
}

/* Mobile Contact */
.mobile-contact {
  margin-top: auto;
}

.mobile-phone-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #f44336;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.mobile-phone-button:hover {
  background-color: #d32f2f;
}

/* Responsive Styles */

/* Tablet Styles */
@media (max-width: 1024px) {
  .custom-header-container {
    padding: 0 20px;
  }

  .header-menu {
    gap: 20px;
  }

  .search-input {
    width: 200px;
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  /* Top Bar Mobile */
  .top-bar-content {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .top-bar-left,
  .top-bar-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .top-bar-address {
    font-size: 12px;
  }

  .top-bar-phone {
    padding: 4px 10px;
    font-size: 12px;
  }

  /* Main Header Mobile */
  .custom-header-main {
    padding: 10px 0;
  }

  .header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 15px;
    width: 100%;
  }

  .header-logo {
    grid-column: 1;
    justify-self: start;
    flex-shrink: 0;
  }

  .header-navigation {
    display: none;
  }

  /* Search box on mobile - center position */
  .header-search {
    grid-column: 2;
    justify-self: center;
    width: 100%;
    max-width: 280px;
    min-width: 200px;
  }

  .header-search .search-input {
    width: 100%;
    min-width: 200px;
    padding: 10px 40px 10px 15px;
    font-size: 14px;
    border-radius: 25px;
    border: 1px solid #e0e0e0;
    background-color: #f8f9fa;
  }

  .header-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

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

  .logo-text {
    font-size: 16px;
  }

  .logo-icon {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
  .custom-header-container {
    padding: 0 10px;
  }

  .top-bar-content {
    padding: 5px 0;
  }

  .top-bar-address {
    display: none;
  }

  .mobile-menu-content {
    width: 280px;
  }

  .logo-text {
    font-size: 14px;
  }

  .logo-icon {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  /* Adjust search on very small screens */
  .header-content {
    gap: 8px;
    grid-template-columns: auto 1fr 50px;
  }

  .header-search {
    max-width: 180px;
    min-width: 150px;
  }

  .header-search .search-input {
    min-width: 150px;
    padding: 8px 35px 8px 12px;
    font-size: 13px;
  }

  .mobile-menu-toggle {
    padding: 6px;
  }

  .hamburger-line {
    width: 24px;
    height: 2px;
  }
}

/* Sticky Header */
.custom-header-wrapper.sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  animation: slideDown 0.3s ease;
}

.custom-header-wrapper.sticky .custom-header-top-bar {
  display: none;
}

.custom-header-wrapper.sticky .custom-header-main {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo-icon {
    background: linear-gradient(135deg, #2196F3, #1976D2);
  }
}

/* Print Styles */
@media print {
  .custom-header-wrapper {
    display: none;
  }
}

/* Focus Styles for Accessibility */
.header-menu a:focus,
.search-input:focus,
.search-button:focus,
.mobile-menu-toggle:focus,
.mobile-menu-close:focus,
.mobile-phone-button:focus {
  outline: 2px solid #2196F3;
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .custom-header-wrapper *,
  .custom-header-wrapper *::before,
  .custom-header-wrapper *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
