/* ===== NAVIGATION VARIABLES ===== */
:root {
  --primary-color: #2b6cb0;
  --primary-hover: #2c5282;
  --text-color: #4a5568;
  --text-light: #718096;
  --bg-color: #ffffff;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --white: #ffffff;
  --primary-dark: #1a3d6e;
}

/* ===== BASE NAVIGATION STYLES ===== */
.main-nav {
  background-color: var(--white);
  box-shadow: var(--shadow);
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.5rem 0;
}

.main-nav.scrolled {
  padding: 0.25rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.main-nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  min-height: 80px;
  max-width: 1400px;
  margin: 0 auto;
  transition: min-height 0.3s ease;
}

/* Logo Styles */
.nav-logo {
  display: flex !important;
  align-items: center;
  height: 100%;
  padding: 5px 0;
  text-decoration: none;
  gap: 12px;
  transition: transform 0.3s ease;
}

.nav-logo:hover {
  transform: translateX(3px);
}

.nav-logo img {
  height: 100% !important;
  width: auto !important;
  max-height: 60px !important;
  max-width: 220px !important;
  object-fit: contain !important;
  transition: all 0.3s ease;
}

.nav-logo-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
  margin-left: 8px;
  transform: translateY(1px);
}

.company-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-color);
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
  transition: color 0.3s ease;
}

.company-tagline {
  font-size: 0.7rem;
  color: #666;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.3px;
  transition: color 0.3s ease;
}

.nav-logo:hover .company-name {
  color: var(--primary-dark);
}

.nav-logo:hover .company-tagline {
  color: #444;
}

/* Adjust logo size on smaller screens */
@media (max-width: 1200px) {
  .company-name {
    font-size: 1rem;
  }
  .company-tagline {
    font-size: 0.65rem;
  }
}

@media (max-width: 992px) {
  .main-nav .container {
    min-height: 70px;
  }
  
  .nav-logo img {
    max-height: 50px !important;
    max-width: 200px !important;
  }
  
  .nav-logo-content {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-logo img {
    max-height: 45px !important;
    max-width: 180px !important;
  }
}

/* Navigation Links */
.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* CTA Button in Nav */
.nav-cta .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background-color: var(--primary-color);
  color: white;
  border-radius: 4px;
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
  border: 2px solid transparent;
}

.nav-cta .btn:hover,
.nav-cta .btn:focus {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(43, 108, 176, 0.2);
}

.btn-icon {
  width: 1rem;
  height: 1rem;
  transition: var(--transition);
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
  .main-nav .container {
    padding: 0 1.25rem;
  }
  
  .nav-links {
    gap: 1.25rem;
  }
}

@media (max-width: 992px) {
  .main-nav .container {
    min-height: 70px;
    padding: 0 1rem;
  }
  
  /* Mobile Menu Styles */
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--white);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-150%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
  }
  
  .nav-item {
    width: 100%;
    text-align: center;
  }
  
  .nav-link {
    padding: 0.75rem 1rem;
    justify-content: center;
    font-size: 1.1rem;
  }
  
  .nav-link::after {
    display: none;
  }
  
  .nav-cta {
    margin-top: 1rem;
    width: 100%;
  }
  
  .nav-cta .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--primary-color);
  margin: 5px 0;
  transition: all 0.3s ease;
  position: relative;
}

.mobile-menu-btn[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 992px) {
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-links {
    display: none;
  }
  
  .nav-links.active {
    display: flex;
  }
}

/* Sticky Navigation on Scroll */
.main-nav.sticky {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.loader {
  width: 48px;
  height: 48px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Body lock when menu is open */
body.menu-open {
  overflow: hidden;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

/* Fallback for browsers that don't support scroll-behavior */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Body padding to account for fixed header */
body {
  padding-top: 80px;
}

@media (max-width: 992px) {
  body {
    padding-top: 70px;
  }
}

/* WhatsApp Floating Button */
.whatsapp-float {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  color: white;
  border-radius: 50%;
  text-align: center;
  font-size: 2rem;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
  z-index: 998; /* One below scroll-to-top */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
  text-decoration: none;
  border: 3px solid white;
}

.whatsapp-float:hover {
  background-color: #128C7E;
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
}

.whatsapp-float:active {
  transform: scale(0.95);
}

.whatsapp-float i {
  transition: transform 0.3s ease;
}

.whatsapp-float:hover i {
  transform: rotate(10deg);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* WhatsApp Chat Widget */
.whatsapp-widget {
  position: fixed;
  bottom: 8rem;
  right: 2.5rem;
  width: 320px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 0;
  border: 1px solid #e0e0e0;
}

.whatsapp-widget.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  max-height: 500px;
  height: 70vh;
  max-height: 70vh;
}

/* Chat Header */
.chat-header {
  background: #25D366;
  color: white;
  padding: 15px;
  display: flex;
  align-items: center;
  position: relative;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  color: #25D366;
  font-size: 20px;
}

.chat-info h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chat-info p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.chat-close {
  position: absolute;
  right: 15px;
  top: 15px;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
}

.message {
  max-width: 80%;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  position: relative;
  line-height: 1.4;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.received {
  background: white;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.sent {
  background: #DCF8C6;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message-time {
  display: block;
  font-size: 10px;
  color: #888;
  margin-top: 4px;
  text-align: right;
}

/* Chat Input */
.chat-input {
  display: flex;
  padding: 12px;
  background: white;
  border-top: 1px solid #eee;
}

.chat-input input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 16px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.3s;
}

.chat-input input:focus {
  border-color: #25D366;
}

.chat-input button {
  background: #25D366;
  color: white;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin-left: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.chat-input button:hover {
  background: #128C7E;
}

/* Notification Badge */
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4444;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  animation: pulse 1.5s infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .whatsapp-widget {
    right: 1.5rem;
    bottom: 6.5rem;
    width: 90%;
    max-width: 320px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
  }
  
  .whatsapp-widget.active {
    transform: translateX(-50%) translateY(0);
  }
  
  .whatsapp-float {
    right: 1.5rem;
    bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  .whatsapp-widget {
    height: 80vh;
    max-height: 80vh;
    bottom: 6rem;
  }
  
  .whatsapp-float {
    right: 1rem;
    bottom: 1rem;
  }
}

/* Animation for new messages */
@keyframes newMessage {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.new-message {
  animation: newMessage 0.5s ease;
}

/* Scroll to Top Button */
.scroll-top {
  position: fixed;
  bottom: 5.5rem; /* Position above WhatsApp button */
  right: 2.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 999; /* Above WhatsApp button */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: none;
  outline: none;
}

.scroll-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-5px);
}

.scroll-top:active {
  transform: scale(0.95);
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .whatsapp-float {
    right: 1.5rem;
    bottom: 1.5rem;
  }
  
  .scroll-top {
    width: 50px;
    height: 50px;
    bottom: 5rem; /* Adjusted to be above WhatsApp button */
    right: 1.5rem;
  }
}

@media (max-width: 480px) {
  .whatsapp-float {
    width: 50px;
    height: 50px;
    font-size: 1.6rem;
    bottom: 1.25rem;
    right: 1.25rem;
  }
  
  .scroll-top {
    width: 45px;
    height: 45px;
    bottom: 4.5rem;
    right: 1.25rem;
    font-size: 1.25rem;
  }
}

/* Ensure buttons don't overlap with content */
@media (max-width: 400px) {
  .whatsapp-float {
    bottom: 1rem;
    right: 1rem;
  }
  
  .scroll-top {
    bottom: 4.25rem;
    right: 1rem;
  }
}
