/* =========================
   HEADER
========================= */

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

.header,
.nav,
.nav-link,
.login-btn,
.mobile-nav-item span {
  font-family: "Inter", sans-serif;
}

.header {
  position: fixed;

  top: 0;

  left: 0;

  width: 100%;

  height: 72px;

  background: rgba(255, 255, 255, 0.82);

  backdrop-filter: blur(18px);

  -webkit-backdrop-filter: blur(18px);

  border-bottom: 1px solid rgba(0, 0, 0, 0.04);

  z-index: 1000;
}

/* =========================
   NAVBAR
========================= */

.nav {
  width: 100%;

  max-width: 1440px;

  height: 72px;

  margin: 0 auto;

  padding: 0 32px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 24px;
}

/* =========================
   LOGO
========================= */

.logo {
  font-size: 42px;
  flex-shrink: 0;

  font-weight: 800;

  letter-spacing: -2px;

  color: #4c0080;

  text-decoration: none;

  line-height: 1;
}

/* =========================
   NAV LINKS
========================= */

.nav-links {
  display: flex;

  align-items: center;

  gap: 8px;

  height: 100%;
}

.nav-link {
  position: relative;

  height: 72px;

  display: flex;

  align-items: center;

  padding: 0 18px;

  text-decoration: none;

  font-size: 15px;

  font-weight: 600;

  color: #5b5563;

  transition: 0.3s ease;
}

.nav-link:hover {
  color: #4c0080;
}

.nav-link.active {
  color: #6d28d9;
}

.nav-link.active::after {
  content: "";

  position: absolute;

  left: 16px;

  right: 16px;

  bottom: 0;

  height: 2px;

  border-radius: 999px;

  background: linear-gradient(90deg, #7c3aed 0%, #a855f7 100%);
}

/* =========================
   NAV ICONS
========================= */

.nav-icons {
  display: flex;
  flex-shrink: 0;
  align-items: center;

  gap: 10px;
}

.nav-icon {
  width: 42px;

  height: 42px;

  border-radius: 50%;

  display: flex;

  align-items: center;

  justify-content: center;

  color: #5b5563;

  transition: 0.3s ease;

  text-decoration: none;
}

.nav-icon svg {
  width: 21px;

  height: 21px;

  stroke-width: 1.8;
}

.nav-icon:hover {
  background: rgba(76, 0, 128, 0.06);

  color: #4c0080;

  transform: translateY(-1px);
}

/* =========================
   LOGIN BUTTON
========================= */

.login-btn {
  height: 42px;

  padding: 0 24px;

  border-radius: 999px;

  background: linear-gradient(135deg, #4c0080 0%, #6a0dad 100%);

  color: white;

  font-size: 14px;

  font-weight: 700;

  text-decoration: none;

  display: flex;

  align-items: center;

  justify-content: center;

  transition: 0.3s ease;

  box-shadow: 0 8px 20px rgba(76, 0, 128, 0.18);
}

.login-btn:hover {
  transform: translateY(-2px);

  box-shadow: 0 14px 24px rgba(76, 0, 128, 0.22);
}

/* =========================
   MOBILE BOTTOM NAV
========================= */

.mobile-bottom-nav {
  position: fixed;

  left: 16px;

  right: 16px;

  bottom: 16px;

  top: auto;

  height: 72px;

  background: rgba(255, 255, 255, 0.88);

  backdrop-filter: blur(24px);

  -webkit-backdrop-filter: blur(24px);

  border: 1px solid rgba(255, 255, 255, 0.7);

  border-radius: 28px;

  display: none;

  align-items: center;

  justify-content: space-around;

  z-index: 99999;

  box-shadow: 0 10px 40px rgba(17, 17, 17, 0.1);

  transform: translateZ(0);

  will-change: transform;
}

/* =========================
   MOBILE NAV ITEM
========================= */

.mobile-nav-item {
  flex: 1;

  height: 100%;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 4px;

  text-decoration: none;

  color: #6b7280;

  transition: 0.3s ease;

  position: relative;
}

.mobile-nav-item svg {
  width: 22px;

  height: 22px;

  stroke-width: 1.8;
}

.mobile-nav-item span {
  font-size: 11px;

  font-weight: 700;

  letter-spacing: 0.2px;
}

/* =========================
   ACTIVE MOBILE NAV
========================= */

.mobile-nav-item.active {
  color: #6d28d9;
}

.mobile-nav-item.active::before {
  content: "";

  position: absolute;

  top: 8px;

  width: 6px;

  height: 6px;

  border-radius: 50%;

  background: #7c3aed;
}

/* =========================
   TABLET
========================= */

@media (max-width: 992px) {
  .nav {
    padding: 0 20px;
  }

  .nav-links {
    gap: 0;
  }

  .nav-link {
    padding: 0 12px;

    font-size: 14px;
  }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {
  .header {
    height: 64px;
  }

  .nav {
    height: 64px;
    padding: 0 16px;
    gap: 8px;
  }

  .logo {
    font-size: 34px;
  }

  .nav-links {
    display: none;
  }

  .nav-icons {
    gap: 4px;
  }

  .nav-icon {
    width: 38px;

    height: 38px;
  }

  .nav-icon svg {
    width: 19px;

    height: 19px;
  }

  .login-btn {
    height: 38px;

    padding: 0 18px;

    font-size: 13px;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .inline-search-container.active {
    padding: 0 8px;
  }
}

/* =========================
   SMALL MOBILE
========================= */

@media (max-width: 480px) {
  .nav {
    padding: 0 12px;
    gap: 4px;
  }

  .inline-search-container.active {
    padding: 0 4px;
  }

  .logo {
    font-size: 30px;
  }

  .nav-icon {
    width: 34px;

    height: 34px;
  }

  .nav-icon svg {
    width: 18px;

    height: 18px;
  }

  .login-btn {
    height: 34px;

    padding: 0 14px;

    font-size: 12px;
  }
}
/* =========================
   FORCE IOS BOTTOM NAV FIX
========================= */

@media (max-width: 768px) {
  body {
    padding-bottom: 110px;
  }

  .mobile-bottom-nav {
    position: fixed !important;

    bottom: max(16px, env(safe-area-inset-bottom)) !important;

    left: 16px !important;

    right: 16px !important;

    top: auto !important;

    transform: none !important;

    margin: 0 !important;
  }
}

.header,
.main-content {
  transform: none !important;
}

/* =========================
   PREMIUM COUNT BADGES
========================= */

.nav-icon {
  position: relative;
}

/* Shared Badge Style */

.cart-count,
.wishlist-count {
  position: absolute;

  top: 2px;

  right: 0;

  min-width: 18px;
  height: 18px;

  padding: 0 5px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;

  background: linear-gradient(135deg, #603763 0%, #7c3aed 100%);

  color: #ffffff;

  font-size: 10px;
  font-weight: 700;
  line-height: 1;

  border: 2px solid #ffffff;

  box-shadow:
    0 4px 12px rgba(96, 55, 99, 0.28),
    0 2px 6px rgba(124, 58, 237, 0.22);

  z-index: 10;

  animation: badgePop 0.35s ease;
}

/* Hover */

.nav-icon:hover .cart-count,
.nav-icon:hover .wishlist-count {
  transform: scale(1.08);

  transition: 0.25s ease;
}

/* Count Change Animation */

@keyframes badgePop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }

  70% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* =========================
   INLINE SEARCH
========================= */

.nav-links {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-links.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  position: absolute;
}

.inline-search-container {
  flex: 1;
  max-width: 0;
  opacity: 0;
  visibility: hidden;
  overflow: visible;
  transition: max-width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              opacity 0.3s ease, padding 0.3s ease;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  position: relative;
}

.inline-search-container.active {
  max-width: 100%;
  opacity: 1;
  visibility: visible;
  padding: 0 24px;
}

.inline-search-form {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  padding: 8px 16px;
  border: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.inline-search-form:focus-within {
  background: #fff;
  border-color: #6a0dad;
  box-shadow: 0 4px 12px rgba(106, 13, 173, 0.1);
}

.inline-search-icon {
  color: #6b7280;
  width: 20px;
  height: 20px;
  margin-right: 12px;
}

.inline-search-form input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 16px;
  color: #111827;
  outline: none;
  font-family: "Inter", sans-serif;
}

.inline-search-form input::placeholder {
  color: #9ca3af;
}

.inline-search-close {
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.inline-search-close:hover {
  color: #111827;
}

/* Live Search Dropdown */
.live-search-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2000;
  overflow: hidden;
}

.live-search-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.live-search-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  max-height: 400px;
  overflow-y: auto;
}

.live-search-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
  gap: 12px;
}

.live-search-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.live-search-item img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f4f6;
}

.live-search-info {
  display: flex;
  flex-direction: column;
}

.live-search-name {
  font-size: 15px;
  font-weight: 500;
  color: #111827;
}

.live-search-price {
  font-size: 14px;
  font-weight: 600;
  color: #6a0dad;
  margin-top: 2px;
}

.live-search-empty {
  padding: 16px;
  text-align: center;
  color: #6b7280;
  font-size: 15px;
}
