/* ---- CART DRAWER ---- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 46, 24, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: var(--color-base);
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.25, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}
.cart-panel.open {
  transform: translateX(0);
}
.cart-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(37, 51, 32, 0.1);
  background: var(--color-white);
}
.cart-panel__title {
  font-family: var(--font-hl);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-dark);
}
.cart-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--color-text-mid);
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}
.cart-close:hover {
  color: var(--color-text-dark);
  transform: scale(1.1);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: rgba(37, 51, 32, 0.5);
  gap: 1rem;
}
.cart-empty svg {
  width: 48px;
  height: 48px;
  stroke: rgba(37, 51, 32, 0.3);
  stroke-width: 1.5;
  fill: none;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--color-white);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(37, 51, 32, 0.08);
  position: relative;
}
.cart-item__swatch {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.cart-item__info {
  flex: 1;
}
.cart-item__name {
  font-family: var(--font-hl);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}
.cart-item__spec {
  font-size: 0.75rem;
  color: var(--color-text-mid);
  margin-bottom: 0.4rem;
}
.cart-item__price {
  font-family: var(--font-hl);
  font-weight: 700;
  color: var(--color-gold);
}
.cart-item__remove {
  background: rgba(0, 0, 0, 0.03);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--color-text-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: absolute;
  top: 1rem;
  right: 1rem;
}
.cart-item__remove:hover {
  background: #ff4d4f;
  color: white;
}

.cart-panel__footer {
  padding: 1.5rem;
  background: var(--color-white);
  border-top: 1px solid rgba(37, 51, 32, 0.1);
  box-shadow: 0 -5px 20px rgba(0,0,0,0.02);
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.cart-total-label {
  font-size: 0.95rem;
  color: var(--color-text-mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.cart-total-value {
  font-family: var(--font-hl);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-dark);
}
.cart-shipping {
  font-size: 0.75rem;
  color: #38a169;
  text-align: right;
  margin-bottom: 1.25rem;
  font-weight: 500;
}
.cart-checkout-btn {
  width: 100%;
  padding: 1rem;
  background: var(--color-gold);
  color: var(--color-text-dark);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cart-checkout-btn:hover:not(:disabled) {
  background: var(--color-gold-hover);
  transform: translateY(-2px);
}
.cart-checkout-btn:disabled {
  background: rgba(37, 51, 32, 0.1);
  color: rgba(37, 51, 32, 0.4);
  cursor: not-allowed;
}

/* Nav Badge Animations */
.nav__badge.bounce {
  animation: badgeBounce 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes badgeBounce {
  0%   { transform: scale(1) translate(50%, -50%); }
  50%  { transform: scale(1.4) translate(35%, -35%); background: var(--color-gold-hover); }
  100% { transform: scale(1) translate(50%, -50%); }
}

/* Button Added State */
.btn-add-cart.added {
  background: #38a169;
  border-color: #38a169;
  color: white;
}
.btn-add-cart.in-cart {
  background: var(--color-surface);
  color: var(--color-text-mid);
  border-color: rgba(37, 51, 32, 0.15);
  pointer-events: all; 
}

/* Floating Cart Button */
.floating-cart-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-gold);
  color: var(--color-forest);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(37, 51, 32, 0.2);
  border: none;
  cursor: pointer;
  z-index: 8999;
  transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}
.floating-cart-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.floating-cart-btn:hover {
  transform: translateY(-4px) scale(1.05);
}
.floating-cart-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.floating-cart-btn .floating-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e53e3e;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
