/* ============================================================
   Station 27 Designs — Cart Styles
   Header icon + badge, slide-out drawer, line items
   ============================================================ */

/* ---------- Header Cart Icon + Badge ---------- */
.cart-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--heading, #fff);
  margin-right: 8px;
}

.cart-icon:hover {
  opacity: 0.8;
}

.cart-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.cart-icon__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #00b4ff;
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-body, system-ui, sans-serif);
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cart-icon__badge--visible {
  display: flex;
}

.cart-icon__badge--pulse {
  animation: cart-badge-pulse 0.4s ease-out;
}

@keyframes cart-badge-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ---------- Drawer Backdrop ---------- */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 200;
}

.cart-backdrop--open {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Drawer Panel ---------- */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: #06080d;
  color: #e2e8f0;
  z-index: 210;
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
}

.cart-drawer--open {
  transform: translateX(0);
}

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-drawer__title {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: 26px;
  font-weight: 400;
  margin: 0;
  color: #fff;
}

.cart-drawer__close {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-drawer__close:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ---------- Drawer Body (scrollable) ---------- */
.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* ---------- Line Items ---------- */
.cart-line {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-line__image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  background: linear-gradient(135deg, #1a2030, #0e131d);
}

.cart-line__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-line__title {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: 18px;
  font-weight: 500;
  margin: 0;
  color: #fff;
}

.cart-line__variant {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

.cart-line__price {
  font-size: 14px;
  color: #00b4ff;
  margin: 4px 0 8px;
}

.cart-line__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-line__qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-line__qty-btn {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-line__qty-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cart-line__qty-value {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
  color: #fff;
}

.cart-line__remove {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}

.cart-line__remove:hover {
  color: #fff;
}

/* ---------- Drawer Footer ---------- */
.cart-drawer__footer {
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-drawer__row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.cart-drawer__row--total {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  padding-top: 12px;
}

.cart-drawer__shipping-note {
  font-size: 13px;
  color: #94a3b8;
}

.cart-drawer__checkout-btn {
  width: 100%;
  padding: 16px;
  background: rgba(214, 141, 15, 0.3);
  color: rgba(255, 255, 255, 0.6);
  border: none;
  border-radius: 4px;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: not-allowed;
  margin-top: 16px;
  position: relative;
}

.cart-drawer__checkout-btn--active {
  background: #d68d0f;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(214, 141, 15, 0.25);
}

.cart-drawer__checkout-btn--active:hover {
  background: #b87a0d;
}

.cart-drawer__checkout-btn--active:disabled {
  background: rgba(214, 141, 15, 0.4);
  cursor: wait;
}

.cart-drawer__continue {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}

.cart-drawer__continue:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ---------- Empty State ---------- */
.cart-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  flex: 1;
}

.cart-drawer__empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.cart-drawer__empty-title {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: 22px;
  margin: 0 0 8px;
  color: #fff;
}

.cart-drawer__empty-text {
  color: #94a3b8;
  font-size: 14px;
  margin: 0 0 24px;
  max-width: 240px;
}

.cart-drawer__empty-cta {
  display: inline-block;
  padding: 12px 24px;
  background: #d68d0f;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cart-drawer__empty-cta:hover {
  background: #b87a0d;
}

/* ---------- Product Page: Size Selector ---------- */
.product-detail__size-selector {
  margin: 16px 0;
}

.product-detail__size-label {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.size-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.size-btn {
  min-width: 48px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-body, system-ui, sans-serif);
}

.size-btn:hover {
  border-color: #00b4ff;
}

.size-btn[aria-pressed="true"] {
  background: #00b4ff;
  color: #06080d;
  border-color: #00b4ff;
}

/* ---------- Product Page: Quantity Selector ---------- */
.product-detail__qty-selector {
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-detail__qty-label {
  font-size: 13px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.qty-control__btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 18px;
}

.qty-control__btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.qty-control__value {
  min-width: 36px;
  text-align: center;
  font-size: 14px;
  color: #fff;
}

/* ---------- PayPal Checkout Button ----------
   Color exception: PayPal Brand Guidelines mandate the Gold (#FFC439)
   button for PayPal Checkout. Do NOT restyle to burnt orange CTA.
   Ref: https://www.paypal.com/us/webapps/mpp/logo-center */
.cart-drawer__paypal-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: #FFC439;
  color: #111827;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  margin-top: 8px;
  letter-spacing: 0.02em;
  font-family: var(--font-body, system-ui, sans-serif);
  transition: background 0.15s;
}
.cart-drawer__paypal-btn:hover {
  background: #f0b429;
}
.cart-drawer__paypal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Mobile (< 600px) ---------- */
@media (max-width: 600px) {
  .cart-drawer {
    width: 100vw;
  }
  .cart-line {
    grid-template-columns: 80px 1fr;
  }
  .cart-line__image {
    width: 80px;
    height: 80px;
  }
}
