﻿/* ---------------------------------------------------
   CART ICON (TOP RIGHT)
--------------------------------------------------- */
#cart-icon {
  position: fixed;
  top: 300px;
  right: 28px;
  z-index: 999999 !important;
  cursor: pointer;
  pointer-events: auto !important;
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.4));
}

#cart-svg {
  width: 60px;
  height: 60px;
}

#cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-red);
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------------------------------------------------
   SLIDE-IN CART PANEL
--------------------------------------------------- */
#cart-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 360px;
  height: 100vh; /* FIXED HEIGHT */
  background: #111;
  color: white;
  padding: 20px;
  box-shadow: -4px 0 12px rgba(0,0,0,0.4);
  z-index: 999998 !important;
  transition: right 0.35s ease;
  display: flex;
  flex-direction: column;
}

#cart-panel.open {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--accent-gold);
}

#close-cart {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

#cart-items {
  flex: 1;
  overflow-y: auto;
  margin-top: 20px;
}

.cart-item {
  border-bottom: 1px solid #333;
  padding: 12px 0;
}

.cart-item-name {
  font-size: 1.1rem;
  color: var(--accent-gold);
}

.cart-item-price {
  font-size: 1rem;
  margin: 4px 0;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-controls button {
  background: var(--accent-gold);
  border: none;
  padding: 4px 10px;
  cursor: pointer;
  color: black;
  font-weight: bold;
}

.remove-item {
  margin-top: 6px;
  background: none;
  border: none;
  color: var(--accent-red);
  cursor: pointer;
  font-size: 0.9rem;
}

.cart-footer {
  border-top: 1px solid #333;
  padding-top: 15px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.checkout-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent-gold);
  color: black;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  font-weight: bold;
}

.checkout-btn:hover {
  background: #e6c15a;
}

/* ---------------------------------------------------
   FULL-SCREEN CHECKOUT FORM
--------------------------------------------------- */
#checkout-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh; /* FIXED HEIGHT */
  background: #111;
  color: white;
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 30px;
  box-sizing: border-box;
  display: none;
  flex-direction: column;
}

#checkout-screen.open {
  display: flex;
}

.checkout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkout-header h2 {
  margin: 0;
  font-size: 2rem;
  color: var(--accent-gold);
}

#close-checkout {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

.checkout-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
}

.checkout-section label {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.checkout-section input,
.checkout-section textarea {
  background: #222;
  border: 1px solid #444;
  padding: 10px;
  color: white;
  font-size: 1rem;
}

#order-summary {
  height: 140px;
}

.checkout-submit-btn {
  margin-top: 30px;
  padding: 14px;
  background: var(--accent-gold);
  color: black;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  font-weight: bold;
}

/* ---------------------------------------------------
   CONFIRMATION SCREEN
--------------------------------------------------- */
#confirmation-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  color: white;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#confirmation-screen.open {
  display: flex;
}

.confirmation-content {
  background: #111;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  max-width: 420px;
  width: 100%;
}

.confirmation-btn {
  margin-top: 20px;
  padding: 12px;
  background: var(--accent-gold);
  color: black;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  font-weight: bold;
}

.confirmation-btn:hover {
  background: #e6c15a;
}

/* ---------------------------------------------------
   CART OVERLAY (FADE-IN BACKDROP)
--------------------------------------------------- */
#cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9990;
}

#cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ---------------------------------------------------
   SHAKE ANIMATION
--------------------------------------------------- */
@keyframes cart-shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

.cart-icon.shake {
  animation: cart-shake 0.35s ease;
}


#cart-panel {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow-y: auto !important;
  display: flex;
  flex-direction: column;
}

#cart-items {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.cart-header,
.cart-footer {
  flex-shrink: 0;
}




/* ---------------------------------------------------
   MOBILE
--------------------------------------------------- */
@media (max-width: 480px) {
  #cart-panel {
    width: 90vw;
  }
}

/* Ensure site content stays below cart layers */
header, nav, section, footer {
  position: relative;
  z-index: 1;
}
