/* =================================================================== */
/*    PARTIAL: NAVBAR                                                  */
/* =================================================================== */

.navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    /* Remove the solid background and blur to stop the corner bleed */
    background: transparent;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    z-index: 5;
}

/* Ensure the navbar links still look good on mobile without the bar background */
@media (max-width: 1023px) {
    .navbar {
        background: var(--navbar-bg);
        backdrop-filter: blur(10px);
        border: 1px solid var(--jet);
        border-radius: 12px 12px 0 0;
    }

    /* Surgical Adjustment: Shrink vertical footprint and tighten text for mobile */
    .navbar-link {
        padding: 12px 5px !important; /* Reduced from 20px */
        font-size: 11px !important;    /* Slightly smaller to prevent excessive wrapping */
    }
    
    .navbar-list {
        gap: 10px !important; /* Tighter gap between icons */
    }
}

.navbar-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
}

.navbar-link {
    color: var(--light-gray);
    font-size: var(--fs8);
    padding: 20px 7px;
    transition: color var(--transition1);
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px; /* Space between icon and text */
}

.navbar-link:hover, .navbar-link:focus {
  color: var(--light-gray70);
}

.navbar-link.active {
  color: var(--orange-yellow-crayola);
}

/* --- Animated Underline for Navbar Links --- */
/* FIX: Target only the text span, ignoring the icon and badge */
.navbar-link > span:not(.cart-badge)::after {
  content: '';
  position: absolute;
  bottom: 15px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--text-gradient-yellow);
  transform: translateX(-50%);
  transition: width 0.3s ease-in-out;
}

.navbar-link:hover > span:not(.cart-badge)::after,
.navbar-link.active > span:not(.cart-badge)::after {
  width: 100%;
}

/* Enhanced Active State for Desktop */
@media (min-width: 1024px) {
    .navbar-link.active {
        color: var(--orange-yellow-crayola) !important;
        background: rgba(243, 111, 33, 0.1);
        /* Match the inner curve of the navbar container */
        border-radius: 12px;
        padding-left: 15px;
        padding-right: 15px;
        margin: 2px 5px;
        /* Subtle inset shadow looks cleaner than a flat background */
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    }
    
    /* Ensure the first item (Home) doesn't peek past the parent radius */
    .navbar-item:first-child .navbar-link.active {
        border-top-left-radius: 20px;
    }
}

.navbar-link:hover,
.navbar-link.active {
  color: var(--white1);
}

/* --- Cart Badge Styles --- */
.cart-badge {
  position: absolute;
  top: -8px; 
  right: -10px; 
  background-color: var(--bittersweet-shimmer);
  color: white;
  font-size: 10px;
  font-weight: bold;
  height: 18px;
  min-width: 18px;
  border-radius: 9px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 4px;
  border: 2px solid var(--eerie-black2);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  display: none; 
  z-index: 2;
}

.cart-badge.bounce {
  animation: bounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Mobile Trigger */
.command-palette-trigger {
  display: block;
  font-size: 20px;
}
.command-palette-trigger .navbar-link {
  padding: 20px 10px;
}

/* Progressive labels for longer nav items.
   Default to the short label so the designed top-right nav never overflows. */
.nav-label-full {
  display: none;
}
.nav-label-short {
  display: inline;
}

/* Skip Link */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 10px;
  background: var(--text-gradient-yellow);
  color: var(--smoky-black);
  padding: 10px 15px;
  border-radius: 0 0 8px 8px;
  z-index: 1000;
  transition: top 0.3s ease-in-out;
  font-weight: var(--fw600);
}
.skip-to-content:focus { top: 0; }