/* Cart icon in header */
.header-cart {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  margin-left: 16px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.header-cart:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.cart-icon {
  width: 26px;
  height: 26px;
  color: #f5f5f5;
}

/* Count bubble */
.cart-count {
  position: absolute;
  top: -6px;
  right: -10px;
  background: #4ade80;
  color: #050608;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
}

/* Bump animation */
@keyframes cart-bump {
  0%   { transform: scale(1); }
  20%  { transform: scale(1.12); }
  60%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.header-cart.bump {
  animation: cart-bump 0.28s ease-out;
}

/* Drawer overlay + container */
#cartDrawerOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 900;
}

#cartDrawerOverlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100%;
  height: 100vh;
  background: #050608;
  color: #f5f5f5;
  box-shadow: -4px 0 18px rgba(0, 0, 0, 0.6);
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
  z-index: 950;
  display: flex;
  flex-direction: column;
}

.cart-drawer.visible {
  transform: translateX(0);
}

.cart-drawer.hidden {
  transform: translateX(100%);
}

#cartDrawerHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #1f2933;
}

#cartDrawerHeader h2 {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#cartDrawerClose {
  background: none;
  border: none;
  color: #f5f5f5;
  font-size: 1.6rem;
  cursor: pointer;
}

#cartDrawerItems {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
}

#cartDrawerFooter {
  padding: 14px 18px 18px;
  border-top: 1px solid #1f2933;
  display: flex;
  gap: 10px;
}

.view-cart-btn,
#checkoutBtn {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

.view-cart-btn {
  background: transparent;
  color: #f5f5f5;
  border: 1px solid #4ade80;
  text-align: center;
}

#checkoutBtn {
  background: #4ade80;
  color: #050608;
}

/* Header layout: nav left, cart right */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Adjust for mobile */
@media (max-width: 768px) {
  header {
    padding: 10px 14px;
  }

  header nav {
    gap: 12px;
    font-size: 14px;
  }

  .logo {
    font-size: 16px;
  }
}

/* OVERRIDE site.css mobile header layout */
@media (max-width: 800px) {

  header {
    flex-direction: row !important;   /* ← forces row layout */
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0 !important;
    flex-wrap: wrap !important;       /* ← allows nav to drop to row 2 */
  }

  /* Row 1: Gunpant left */
  .logo {
    order: 1;
    flex: 1 1 auto;
    text-align: left;
  }

  /* Row 1: Cart right */
  .header-cart {
    order: 2;
    margin-left: 0;
  }

  /* Row 2: Nav left-aligned under Gunpant */
  header nav {
    order: 3;
    width: 100%;
    justify-content: flex-start !important;
    margin-top: 0.5rem;
  }

  /* Fix nav spacing on mobile */
  header nav a {
    margin-left: 0;
    margin-right: 1rem;
  }
}
