/* STICKY FOOTER REDEFINITION */
#cart-main-view .cart-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  padding: 20px 2%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: none;
}

.cart-header {
  display: flex;
  width: 100%;
  align-items: center;
  padding-bottom: 20px;
  margin-bottom: 0px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 200;
}

.header-spacer {
  width: 44px;
  /* Matches back-button width for centering */
}

.cart-header h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 2.2em;
  color: var(--color-gold);
}

#cart-overlay {
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  /* Move scroll to children views */
  overscroll-behavior: contain;
  padding-top: 0 !important;
  /* Control padding in children */
}

/* Slide container holds both views side by side */
.cart-slide-container {
  position: relative;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.cart-view {
  flex: 0 0 100%;
  width: 100%;
  height: 100vh;
  /* Fixed height for children scroll */
  overflow-y: auto;
  /* INDEPENDENT VIEW SCROLL */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  /* Restore overlay padding here */
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.45s ease;
  position: relative;
  /* Base for absolute edges */
}

/* Default: items visible, checkout offscreen to the right */
#cart-main-view {
  transform: translateX(0);
  opacity: 1;
}

#checkout-panel {
  transform: translateX(0);
  /* sits right after main-view in flex */
  opacity: 0;
  pointer-events: none;
}

/* Checkout active: slide items out left, bring form in */
#cart-overlay.checkout-active #cart-main-view {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

#cart-overlay.checkout-active #checkout-panel {
  transform: translateX(-100%);
  opacity: 1;
  pointer-events: auto;
}

#cart-items-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 20px 140px;
  /* Added large bottom padding for fixed footer */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 25px;
  min-height: -webkit-fill-available;
  align-content: start;
  align-items: start;
  justify-items: stretch;
}

@media (max-width: 900px) {
  #cart-items-container {
    grid-template-columns: 1fr;
  }
}

#cart-items-container:empty {
  display: flex !important;
  justify-content: center;
  align-items: center;
  min-height: 600px;
}

#cart-items-container:empty::after {
  content: "Your cart is empty.";
  font-size: 1.2em;
  color: #888;
  text-align: center;
  font-family: var(--font-body);
  opacity: 0.6;
}

.cart-item {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 5px;
  margin-left: 20px;
  padding: 14px 18px 14px 100px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-white);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  min-height: 110px;
  max-height: 130px;
}

.cart-item:hover {
  border-color: rgba(255, 215, 0, 0.25);
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(5px);
}

.cart-item-image {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 105px;
  height: 105px;
  flex-shrink: 0;
  z-index: 10;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-item:hover .cart-item-image {
  transform: translateY(-50%) scale(1.1) rotate(-3deg);
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  align-items: baseline;
}

.cart-item-header h4 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.15rem;
}

.design-name {
  color: var(--color-gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
  font-weight: 800;
  letter-spacing: 0.2px;
}

/* Rank stars in cart */
.cart-item .design-rank-stars {
  justify-content: flex-start;
  transform: scale(0.85);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
  margin-bottom: -8px;
}

.cart-item .design-star {
  font-size: 1rem;
}

.product-name {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgb(255 255 255 / 44%);
  font-weight: 500;
  margin-left: 4px;
}

.cart-item-edit {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--color-gold);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cart-item-edit:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.4);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cart-item-edit:active {
  transform: translateY(0);
}

.cart-item-design {
  font-size: 0.8rem;
  color: var(--color-gold);
  opacity: 0.9;
  font-weight: 500;
}

.cart-item-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
  margin-bottom: 2px;

}

.option-pill {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.cart-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quantity-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.qty-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qty-btn:hover {
  background: var(--color-gold);
  color: #000;
}

.qty-value {
  font-family: var(--font-body);
  font-size: 0.95rem;
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

.cart-item-price {
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: var(--color-gold);
  font-weight: bold;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-item-remove {
  padding: 6px 10px;
  border: none;
  background: rgba(231, 76, 60, 0.08);
  color: var(--color-danger);
  border-radius: 8px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-remove:hover {
  background: var(--color-danger);
  color: #fff;
  transform: scale(1.05);
}

.footer-cart-icon {
  display: none !important;
}

/* Cart Badge */
.cart-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #e74c3c;


  color: white;
  border-radius: 50%;
  min-width: 21px;
  height: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0 4px;
  border: 2px solid #1a1a1a;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-family: var(--font-body);
}

.cart-badge[hidden] {
  display: none !important;
  transform: scale(0);
}

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

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

  50% {
    transform: scale(1.4);
  }

  100% {
    transform: scale(1);
  }
}


/* =============================================================================
   18. CHECKOUT / PAYPAL
============================================================================= */
.checkout-panel {
  padding: 22px 24px 20px;
  overflow-y: auto;
  position: relative;
  /* Base for side edges */
}

/* Back button in checkout header */
.checkout-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: -8px;
  /* Counteract padding to align */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.checkout-back-btn:hover {
  transform: scale(1.15);
}

.checkout-back-btn img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Side navigation clickable areas */
.side-back-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6%;
  z-index: 100;
  pointer-events: auto;
  opacity: 0;
  transition: background 0.3s ease;
}

.side-back-edge:hover {
  background: rgba(255, 255, 255, 0.03);
}

.side-back-edge.left {
  left: 0;
}

.side-back-edge.right {
  right: 0;
}

#cart-overlay.checkout-active .checkout-back-edge {
  pointer-events: auto;
}

.checkout-panel__header {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 200;
}

.checkout-panel__title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.checkout-panel__header h3 {
  margin: 0 0 6px;
  color: var(--color-gold);
  font-family: var(--font-title);
  font-size: 1.55rem;
}

.checkout-panel__header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-body);
  line-height: 1.45;
}


.checkout-summary {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.checkout-summary__pill {
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font-body);
  font-size: 0.88rem;
  white-space: nowrap;
}

.checkout-summary__pill--total {
  color: var(--color-gold);
  border-color: rgba(255, 215, 0, 0.3);
  font-weight: bold;
}

.checkout-status {
  width: 100%;
  max-width: 840px;
  margin: 0 auto 14px;
  padding: 12px 14px;
  border-radius: 14px;
  font-family: var(--font-body);
  line-height: 1.45;
  text-align: center;
}

.checkout-status--info {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
}

.checkout-status--error {
  background: rgba(255, 107, 107, 0.12);
  color: #ffd4d4;
  border: 1px solid rgba(255, 107, 107, 0.28);
}

.paypal-button-container {
  min-height: 44px;
}

.checkout-note {
  margin: 14px 2px 0;
  color: rgba(255, 255, 255, 0.64);
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.45;
}

#cart-overlay.checkout-open #cart-items-container {
  padding-bottom: 360px;
}

.manual-checkout-actions {
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.instruction-text {
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  text-align: center;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.action-buttons-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.action-buttons-row .manual-btn {
  flex: 1;
}

.manual-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-white);
  font-family: var(--font-title);
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.manual-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  border-color: var(--color-gold);
}

.copy-btn {
  background: var(--color-gold) !important;
  color: #000 !important;
  border: none !important;
  font-weight: bold;
}

.copy-btn:hover {
  background: #ffbb00 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 140, 0, 0.4);
}


.email-btn {
  border-left: 4px solid #4a9eff;
}

.insta-btn {
  border-left: 4px solid #e1306c;
}

.copy-hint {
  margin: 15px auto;
  padding: 0 20px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  font-style: italic;
  max-width: 440px;
}

.checkout-disclaimer {
  margin: 14px auto 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  font-style: italic;
  line-height: 1.4;
  padding: 0 20px;
  max-width: 600px;
}