/* =========================
   Navbar Base
========================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  /* background: transparent; */
  background: #fff;
  height: 100px;
  box-shadow: none;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%; /* Add only when navbar is not transparent */
}

/* =========================
   Logo
========================= */
/* =========================
   Logo
========================= */
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 1;
  max-width: 100%;
  text-decoration: none;
}

.logo img {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin-top: 0;
  object-fit: contain;
}

/* =========================
   Text Logo
========================= */
.text-logo {
  font-style: italic;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 1px;
  text-decoration: none;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.text-logo span:not(:last-child) {
  margin-right: 6px; /* space between words */
}

/* Color control */
.logo-american,
.logo-manufacturer {
  color: #2a5d8f; /* blue */
}

.logo-refrigeration {
  color: #B00F0F; /* red */
}

/* Hover effect (optional but nice) */
.text-logo:hover {
  opacity: 0.9;
}


/* =========================
   Desktop Nav Links
========================= */
.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
  font-size: 1rem;
  font-weight: bold;
}

.nav-links li {
  position: relative;
}

.nav-links li a {
  color: #2a5d8f;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 5px;
  transition: all 0.3s ease-in-out;
}

/* Hover over nav links*/
/* .nav-links li a:hover {
  color: #fff;
  background-color: #2a5d8f;
  transform: scale(1.05);
} */

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 6px;

  position: relative;
  color: #2a5d8f;
  text-decoration: none;
  padding: 8px 0;
  font-weight: bold;
  line-height: 1; /* 🔑 normalize vertical alignment */
}


/* underline */
.nav-links li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background-color: #B00F0F;

  transform: scaleX(0);
  transform-origin: right; /* start from right */
  transition: transform 0.3s ease;
}

/* hover effect */
.nav-links li a:hover::after {
  transform: scaleX(1);
  transform-origin: left; /* slide to left */
}

/* optional: subtle color change */
.nav-links li a:hover {
  color: #2a5d8f;
}


/* =========================
   Dropdown Menu (Desktop)
========================= */
.dropdown-menu {
  position: absolute;
  top: 120%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border-radius: 10px;
  list-style: none;
  padding: 8px 0;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);

  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all 0.3s ease;
  z-index: 999;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li a {
  display: block;
  padding: 10px 20px;
  color: #2a5d8f;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.25s ease;
}

/* Hover effect */
.dropdown-menu li a:hover {
  background-color: #f0f4ff; /* subtle light blue */
  color: #1f4568; /* darker text on hover */
  transform: translateX(3px); /* slight slide right */
}

/* Chevron */
.dropdown i {
  font-size: 0.7rem;
  margin-left: 6px;
}

/* =========================
   Scrolled State
========================= */
.navbar.scrolled {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar.scrolled .nav-links li a {
  color: #000;
}

.navbar.scrolled .dropdown-menu {
  background: #fff;
}

.navbar.scrolled .dropdown-menu li a {
  color: #000;
}

.cart-count {
  background-color: #2a5d8f;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px; /* pill shape */
  line-height: 1;
  min-width: 20px;
  text-align: center;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* =========================
   Mobile Toggle
========================= */
.menu-toggle {
  display: none;
  font-size: 28px;
  color: #99CCFF;
  cursor: pointer;
  transition: color 0.3s ease;
}

.menu-toggle:hover {
  color: #2a5d8f;
}

/* =========================
   Mobile Styles
========================= */
@media (max-width: 768px) {

  .navbar {
    height: 80px;
  }

  .nav-container {
    padding: 0 18px;
  }

  /* Hamburger */

  .menu-toggle {
    display: block;
    font-size: 26px;
    margin-left: auto;
    z-index: 1001;
  }

  /* MOBILE MENU PANEL */
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 80px);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 24px 16px 30px;
    gap: 10px;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .nav-links,
  .nav-links *,
  .nav-links *::before,
  .nav-links *::after {
    box-sizing: border-box;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links > li > a {
    font-size: 1.02rem;
    padding: 16px 18px;
    border: 1px solid #e9eef5;
    border-radius: 14px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #2a5d8f;
    font-weight: 700;
    transition: all 0.25s ease;
  }

  .nav-links > li > a:hover {
    background: #f7faff;
    border-color: #d8e5f2;
  }

  .nav-links li a::after {
    display: none;
  }

  .dropdown > a i {
    font-size: 0.8rem;
    opacity: 0.75;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .dropdown.open > a i {
    transform: rotate(180deg);
    opacity: 1;
  }

  .dropdown-menu {
    display: none;
    position: static;
    margin-top: 8px;
    margin-bottom: 4px;
    margin-left: 8px;
    padding: 8px;
    background: #f8fbff;
    border: 1px solid #e3edf7;
    border-radius: 14px;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    min-width: unset;
  }

  .dropdown.open .dropdown-menu {
    display: block;
  }

  .dropdown-menu li a {
    font-size: 0.95rem;
    padding: 12px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #46627c;
    font-weight: 600;
    display: block;
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
  }

  .dropdown-menu li a:hover {
    background: #eef5fc;
    color: #2a5d8f;
    padding-left: 18px;
    transform: none;
  }

  /* CART BADGE */

  .cart-count {
    margin-left: 8px;
  }

  /* LOGO MOBILE */

  .text-logo {
    font-size: 0.9rem;
    max-width: 220px;
    line-height: 1.1;
    white-space: normal;
  }

  .nav-links li.cart-link a {
    justify-content: flex-start;
    gap: 8px;
  }

    /* LOGO MOBILE */
  .logo {
    max-width: 190px;
  }

  .logo img {
    max-width: 190px;
    width: 100%;
    height: auto;
  }
}