/* === Shopping Cart Drawer === */
#cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#cart-overlay.open {
  display: block;
  opacity: 1;
}

#cart-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: #111;
  border-left: 1px solid #333;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  overflow: hidden;
}
#cart-drawer.open {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #333;
}
.cart-header h3 {
  margin: 0;
  font-size: 18px;
  color: #fff;
}
.cart-close {
  background: none;
  border: none;
  color: #999;
  font-size: 28px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.cart-close:hover { color: #fff; }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.cart-empty {
  text-align: center;
  padding: 40px 0;
  color: #888;
}
.cart-empty p { margin-bottom: 20px; font-size: 15px; }
.cart-shop-btn {
  display: block;
  margin: 8px auto;
  padding: 10px 20px;
  background: linear-gradient(135deg, #d4a853, #f0c040);
  color: #0a0a0b;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #222;
}
.cart-item-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  background: #222;
}
.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-name {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-price {
  margin: 0 0 6px;
  font-size: 14px;
  color: #d4a853;
  font-weight: 700;
}
.cart-strike {
  text-decoration: line-through;
  color: #666;
  font-weight: 400;
  font-size: 12px;
}
.cart-sale-tag {
  display: inline-block;
  background: #d4a853;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
}
.cart-qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid #444;
  background: #222;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-qty-btn:hover { border-color: #d4a853; }
.cart-qty-val {
  font-size: 14px;
  color: #fff;
  min-width: 20px;
  text-align: center;
}
.cart-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: #666;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
}
.cart-remove:hover { color: #e55; }

/* Upsell section */
.cart-upsell {
  padding: 12px 20px;
  border-top: 1px solid #222;
  background: #0d0d0d;
}
.cart-shipping-msg {
  font-size: 12px;
  color: #d4a853;
  margin: 0 0 8px;
  text-align: center;
}
.cart-free-ship { color: #2d8a4e; }
.cart-upsell-title {
  font-size: 11px;
  color: #888;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cart-upsell-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cart-upsell-btn {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s;
}
.cart-upsell-btn:hover { border-color: #d4a853; }
.cart-upsell-btn span:first-child {
  font-size: 12px;
  font-weight: 600;
  color: #eee;
}
.cart-upsell-sub {
  font-size: 11px;
  color: #888;
}

/* Footer */
.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid #333;
  background: #0d0d0d;
}
.cart-bundle-msg {
  font-size: 12px;
  color: #2d8a4e;
  margin: 0 0 8px;
  text-align: center;
  font-weight: 600;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.cart-total-row span { font-size: 14px; color: #ccc; }
.cart-total-price { font-size: 18px; font-weight: 700; color: #fff; }
.cart-tax-note {
  font-size: 11px;
  color: #666;
  margin: 0 0 12px;
}
.cart-checkout-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #d4a853, #f0c040);
  color: #0a0a0b;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.1s;
}
.cart-checkout-btn:hover { transform: scale(1.02); }
.cart-checkout-btn:active { transform: scale(0.98); }
.cart-continue-btn {
  display: block;
  text-align: center;
  margin-top: 10px;
  color: #888;
  font-size: 13px;
  text-decoration: none;
}
.cart-continue-btn:hover { color: #d4a853; }

/* Bundle hint (when only 1 product type in cart) */
.cart-bundle-hint {
  font-size: 12px;
  color: #d4a853;
  margin: 0 0 8px;
  text-align: center;
  font-style: italic;
}

/* Email capture in cart */
.cart-email-capture {
  margin: 0 0 12px;
}
.cart-email-capture input {
  width: 100%;
  padding: 10px 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #e8e2d6;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.cart-email-capture input:focus {
  border-color: #d4a853;
}
.cart-email-capture input::placeholder {
  color: #666;
}

/* === Exit-Intent Popup === */
#exit-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: exitFadeIn 0.3s ease;
}
@keyframes exitFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.exit-popup {
  position: relative;
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 40px 32px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: exitSlideUp 0.35s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
@keyframes exitSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.exit-popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #666;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}
.exit-popup-close:hover {
  color: #fff;
}
.exit-popup-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.exit-popup h3 {
  margin: 0 0 12px;
  font-size: 22px;
  color: #fff;
  font-weight: 700;
}
.exit-popup p {
  margin: 0 0 20px;
  font-size: 14px;
  color: #aaa;
  line-height: 1.5;
}
.exit-popup p strong {
  color: #d4a853;
}
.exit-popup-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.exit-popup-email {
  width: 100%;
  padding: 14px 16px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #e8e2d6;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.exit-popup-email:focus {
  border-color: #d4a853;
}
.exit-popup-email::placeholder {
  color: #666;
}
.exit-popup-btn {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #d4a853, #f0c040);
  color: #0a0a0b;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.exit-popup-btn:hover {
  transform: scale(1.02);
}
.exit-popup-btn:active {
  transform: scale(0.98);
}
.exit-popup-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.exit-popup-status {
  margin: 8px 0 0;
  font-size: 13px;
  min-height: 18px;
}
.exit-popup-skip {
  margin: 16px 0 0 !important;
  font-size: 12px !important;
  color: #666 !important;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}
.exit-popup-skip:hover {
  color: #999 !important;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  .exit-popup {
    padding: 32px 20px 24px;
    border-radius: 12px;
  }
  .exit-popup h3 {
    font-size: 19px;
  }
  .exit-popup p {
    font-size: 13px;
  }
}

/* Cart icon in nav */
.cart-icon-btn {
  position: relative;
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
}
.cart-icon-btn:hover { color: #d4a853; }
.cart-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: #d4a853;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
