/**
 * NUCLEAR CART DRAWER - GOD MODE REBUILD
 * Absolute visual parity with designer source of truth.
 * High-density design, zero side effects.
 */

:root {
  --ncd-bg: #0b0b0b;
  --ncd-border: rgba(255, 255, 255, 0.08);
  --ncd-text-muted: rgba(255, 255, 255, 0.4);
  --ncd-purple: #7c3aed;
  --ncd-font-primary: 'Inter', sans-serif;
  --ncd-font-impact: 'Oswald', sans-serif;
}

/* 1. LAYER OVERRIDE & CONTAINER */
#CartDrawer.drawer {
  position: fixed;
  z-index: 100000 !important; /* Above everything */
  right: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  display: flex !important;
  justify-content: flex-end;
  background-color: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

#CartDrawer.drawer.active {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto;
}

#CartDrawer .drawer__inner {
  height: 100%;
  width: 440px !important;
  max-width: 100vw;
  background-color: var(--ncd-bg) !important;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -20px 0 50px rgba(0,0,0,0.5);
  border: none !important;
  padding: 0 !important;
}

#CartDrawer.drawer.active .drawer__inner {
  transform: translateX(0);
}

/* 2. HEADER - "YOUR CART" */
#CartDrawer .drawer__header {
  padding: 32px 24px 24px !important;
  border-bottom: 1px solid var(--ncd-border) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  background: var(--ncd-bg);
}

#CartDrawer .drawer__heading-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#CartDrawer .drawer__heading {
  font-family: var(--ncd-font-impact) !important;
  font-style: italic !important;
  font-weight: 900 !important;
  font-size: 24px !important;
  letter-spacing: -0.02em !important;
  line-height: 1 !important;
  color: #fff !important;
  margin: 0 !important;
  text-transform: uppercase;
}

#CartDrawer .drawer__item-count {
  font-family: var(--ncd-font-primary);
  font-size: 11px;
  font-weight: 800;
  color: var(--ncd-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#CartDrawer .drawer__close {
  background: transparent !important;
  border: none !important;
  color: rgba(255,255,255,0.6) !important;
  cursor: pointer;
  padding: 4px;
  margin-top: -4px;
  transition: color 0.2s;
}

#CartDrawer .drawer__close:hover {
  color: #fff !important;
}

/* 3. CART ITEMS LIST */
#CartDrawer cart-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px;
  scrollbar-width: thin;
}

#CartDrawer .cart-item {
  display: flex !important;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

#CartDrawer .cart-item:last-child {
  border-bottom: none;
}

#CartDrawer .cart-item__media {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  background: #111;
  border-radius: 4px;
  overflow: hidden;
}

#CartDrawer .cart-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#CartDrawer .cart-item__details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#CartDrawer .cart-item__header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

#CartDrawer .cart-item__category {
  font-family: var(--ncd-font-primary);
  font-size: 10px;
  font-weight: 900;
  color: #a78bfa !important;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

#CartDrawer .cart-item__name {
  font-family: var(--ncd-font-impact) !important;
  font-style: italic !important;
  font-weight: 900 !important;
  font-size: 15px !important;
  color: #fff !important;
  text-transform: uppercase;
  line-height: 1.2;
  text-decoration: none;
  display: block;
}

#CartDrawer .product-option-meta {
  font-family: var(--ncd-font-primary);
  font-size: 11px;
  font-weight: 700;
  color: var(--ncd-text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

/* Remove button as Trash icon - Neutralized for God Mode */
#CartDrawer .cart-remove-button {
  color: rgba(255,255,255,0.15) !important;
  background: transparent !important; /* Kill the purple background */
  border: none !important;
  transition: all 0.2s;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#CartDrawer .cart-remove-button:hover {
  color: #ef4444 !important;
  transform: scale(1.1);
  background: transparent !important;
}

/* 4. QUANTITY & ROW PRICE */
#CartDrawer .cart-item__bottom-row {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
}

#CartDrawer .quantity.cart-quantity {
  display: flex !important;
  align-items: center;
  background: #151515;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  width: 100px;
  height: 36px;
}

#CartDrawer .quantity__button {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
}

#CartDrawer .quantity__button:hover {
  color: #fff;
}

#CartDrawer .quantity__input {
  width: 20px;
  background: transparent !important;
  border: none !important;
  color: #fff !important;
  text-align: center;
  font-family: var(--ncd-font-primary);
  font-weight: 900;
  font-size: 13px;
  padding: 0;
  appearance: textfield;
}

#CartDrawer .cart-item__price {
  font-family: var(--ncd-font-impact) !important;
  font-style: italic !important;
  font-weight: 900 !important;
  font-size: 16px !important;
  color: #fff !important;
  letter-spacing: 0.02em;
}

/* 5. FOOTER & CTAS */
#CartDrawer .drawer__footer {
  padding: 24px !important;
  background: var(--ncd-bg);
  border-top: 1px solid var(--ncd-border) !important;
  margin-top: auto;
}

#CartDrawer .totals {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-end !important;
  margin-bottom: 24px;
}

#CartDrawer .totals__label-group {
  display: flex;
  flex-direction: column;
}

#CartDrawer .totals__total {
  font-family: var(--ncd-font-primary);
  font-size: 14px;
  font-weight: 900;
  color: #fff !important; /* Changed from muted to white */
  letter-spacing: 0.1em;
  margin: 0 !important;
}

#CartDrawer .tax-note {
  font-family: var(--ncd-font-primary);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 2px;
}

#CartDrawer .totals__total-value,
#CartDrawer .totals__total-value .amount,
#CartDrawer .totals__total-value bdi {
  font-family: var(--ncd-font-impact) !important;
  font-style: italic !important;
  font-weight: 900 !important;
  font-size: 22px !important;
  color: #fff !important; /* Force white for subtotal value and all children */
  margin: 0 !important;
}

#CartDrawer .cart__ctas {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* THE BUTTON NUCLEAR DESTRUCTION OVERRIDE */
#CartDrawer .cart__checkout-button.checkout-nuke,
#CartDrawer .checkout-nuke.button {
  background: #ffffff !important;
  color: #000000 !important;
  width: 100% !important;
  height: 56px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: var(--ncd-font-primary) !important;
  font-weight: 900 !important;
  font-size: 15px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  border-radius: 4px !important;
  transition: all 0.3s ease !important;
  border: none !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transform: none !important;
}

#CartDrawer .cart__checkout-button.checkout-nuke:hover {
  background: #e5e5e5 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2) !important;
}

#CartDrawer .continue-shopping-nuke.button {
  background: transparent !important;
  color: #ffffff !important;
  width: 100% !important;
  height: 50px !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 4px !important;
  font-family: var(--ncd-font-primary) !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  cursor: pointer;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  opacity: 0.7;
  transform: none !important;
  box-shadow: none !important;
}

#CartDrawer .continue-shopping-nuke.button:hover {
  opacity: 1;
  background: rgba(255,255,255,0.03) !important;
  border-color: rgba(255,255,255,0.3) !important;
}

#CartDrawer .drawer__inner-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

#CartDrawer .cart-drawer__empty-content {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  text-align: center !important;
}

#CartDrawer .empty-icon-wrapper {
  margin: 0 auto 24px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  opacity: 0.3;
}

#CartDrawer .cart__empty-text {
  font-family: var(--ncd-font-impact) !important;
  font-style: italic !important;
  font-weight: 900 !important;
  font-size: 28px !important;
  color: #fff !important;
  text-align: center;
  margin-bottom: 24px !important;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  #CartDrawer .drawer__inner {
    width: 100% !important;
  }
}
