/* Critical CSS for consistent rendering across browsers and modes */

/* Font loading optimization - prevents FOIT/FOUT in incognito mode */
@font-face {
  font-family: 'system-ui-fallback';
  src: local('system-ui'), local('-apple-system'), local('BlinkMacSystemFont'), local('Segoe UI'), local('Roboto'), local('Oxygen'), local('Ubuntu'), local('Cantarell'), local('Open Sans'), local('Helvetica Neue'), local('sans-serif');
  font-display: swap;
  font-weight: 100 900;
  font-style: normal;
}

/* Base styles for consistent rendering */
html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Open Sans', 'Helvetica Neue', sans-serif, 'system-ui-fallback';
  font-display: swap;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-synthesis: none;
  background-color: #ffffff;
  color: #000000;
}

/* Prevent layout shifts during component loading */
* {
  box-sizing: border-box;
}

*::before,
*::after {
  box-sizing: border-box;
}

/* Critical navbar styles to prevent layout shifts */
.navbar-container {
  min-height: 64px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: #ffffff;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  contain: layout style;
  will-change: transform;
  backface-visibility: hidden;
}

/* Prevent flash of unstyled content */
.navbar-loading {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.navbar-loaded {
  opacity: 1;
}

/* Critical button styles */
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: fit-content;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  border: none;
  outline: none;
  font-family: inherit;
  letter-spacing: 0.025em;
}

.nav-button:focus-visible {
  outline: 2px solid #F59E0B;
  outline-offset: 2px;
}

.list-service-btn {
  border: 2px solid #F59E0B;
  color: #F59E0B;
  background: transparent;
}

.list-service-btn:hover {
  background-color: #F59E0B;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.book-now-btn {
  background-color: #335647;
  color: white;
  border: 2px solid #335647;
}

.book-now-btn:hover {
  background-color: #1C4332;
  border-color: #1C4332;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(28, 67, 50, 0.3);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .mobile-action-button {
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
  }
  
  .mobile-menu-item {
    min-height: 48px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    font-size: 16px;
  }
}

/* Ensure proper responsive breakpoints */
@media (min-width: 1024px) {
  .mobile-menu-button {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  .desktop-navigation {
    display: none !important;
  }
}

/* Loading skeleton for better perceived performance */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Improve accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .nav-button {
    border-width: 2px;
    border-style: solid;
  }
  
  .list-service-btn {
    border-color: #000000;
    color: #000000;
  }
  
  .book-now-btn {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
  }
}

/* Prevent common layout issues */
img {
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
}

/* Ensure consistent button heights across browsers */
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

/* Fix for Safari button styling */
button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}