/* shop/cart.css — Cart Page */

/* ==========================================================================
   CONTAINER
   ========================================================================== */

.cart-container {
  max-width: 1100px;
  margin: 120px auto 60px;
  padding: 0 2rem;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.cart-header {
  margin-bottom: 2.5rem;
}

.cart-back {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d4af37;
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-block;
  margin-bottom: 1rem;
}

.cart-back:hover {
  color: #00e5ff;
}

.cart-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, #F5E6A0 0%, #C9973E 60%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ==========================================================================
   STATES
   ========================================================================== */

.cart-hidden {
  display: none !important;
}

.cart-spinner-lg {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(212, 175, 55, 0.15);
  border-left-color: #d4af37;
  border-radius: 50%;
  animation: cart-spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

.cart-loading {
  text-align: center;
  padding: 4rem 2rem;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: #9A7EB0;
  letter-spacing: 0.08em;
}

/* Auth prompt */
.cart-auth-card {
  text-align: center;
  background: #0d1117;
  border: 1px solid rgba(212, 175, 55, 0.15);
  padding: 3rem 2rem;
  background-image:
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37);
  background-repeat: no-repeat;
  background-size:
    20px 2px, 2px 20px,
    20px 2px, 2px 20px,
    20px 2px, 2px 20px,
    20px 2px, 2px 20px;
  background-position:
    0 0, 0 0,
    100% 0, 100% 0,
    0 100%, 0 100%,
    100% 100%, 100% 100%;
}

.cart-auth-card p {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: #e0d8ec;
  margin: 0 0 1.5rem 0;
}

.cart-auth-btn {
  display: inline-block;
  padding: 0.7rem 2rem;
  background: linear-gradient(135deg, #d4af37, #f5e6a0);
  color: #0d1117;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  margin-bottom: 1rem;
  transition: filter 0.2s ease;
}

.cart-auth-btn:hover {
  filter: brightness(1.1);
}

.cart-auth-link {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  color: #9A7EB0;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cart-auth-link:hover {
  color: #00e5ff;
}

/* Empty state */
.cart-empty {
  text-align: center;
  padding: 4rem 2rem;
}

.cart-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.cart-empty p {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: #9A7EB0;
  letter-spacing: 0.08em;
  margin: 0 0 1.5rem 0;
}

.cart-shop-btn {
  display: inline-block;
  padding: 0.6rem 1.6rem;
  border: 1px solid #00e5ff;
  color: #00e5ff;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.cart-shop-btn:hover {
  background-color: rgba(0, 229, 255, 0.05);
  box-shadow: inset 0 0 8px rgba(0, 229, 255, 0.3);
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
}

/* ==========================================================================
   CART ITEMS
   ========================================================================== */

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: #0d1117;
  border: 1px solid rgba(212, 175, 55, 0.1);
  padding: 1rem;
  background-image:
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37);
  background-repeat: no-repeat;
  background-size:
    16px 2px, 2px 16px,
    16px 2px, 2px 16px,
    16px 2px, 2px 16px,
    16px 2px, 2px 16px;
  background-position:
    0 0, 0 0,
    100% 0, 100% 0,
    0 100%, 0 100%,
    100% 100%, 100% 100%;
}

.cart-item-img-wrapper {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0814;
  border: 1px solid rgba(212, 175, 55, 0.1);
}

.cart-item-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.15));
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 0.2rem 0;
  letter-spacing: 0.03em;
}

.cart-item-price {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  color: #d4af37;
  font-weight: 600;
  margin: 0;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cart-qty-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: transparent;
  color: #d4af37;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.cart-qty-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: #d4af37;
}

.cart-qty-value {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  color: #e0d8ec;
  min-width: 28px;
  text-align: center;
}

.cart-item-remove {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 77, 77, 0.3);
  background: transparent;
  color: #ff4d4d;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  margin-left: 0.5rem;
}

.cart-item-remove:hover {
  background: rgba(255, 77, 77, 0.1);
  border-color: #ff4d4d;
}

.cart-item-subtotal {
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f5e6a0;
  min-width: 70px;
  text-align: right;
  flex-shrink: 0;
}

/* ==========================================================================
   SUMMARY
   ========================================================================== */

.cart-summary {
  background: #0d1117;
  border: 1px solid rgba(212, 175, 55, 0.15);
  padding: 1.6rem;
  position: sticky;
  top: 120px;
  background-image:
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37),
    linear-gradient(#d4af37, #d4af37);
  background-repeat: no-repeat;
  background-size:
    20px 2px, 2px 20px,
    20px 2px, 2px 20px,
    20px 2px, 2px 20px,
    20px 2px, 2px 20px;
  background-position:
    0 0, 0 0,
    100% 0, 100% 0,
    0 100%, 0 100%,
    100% 100%, 100% 100%;
}

.cart-summary-title {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d4af37;
  margin: 0 0 1.2rem 0;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.cart-summary-line {
  display: flex;
  justify-content: space-between;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  color: #c8b8d8;
  margin-bottom: 0.6rem;
}

.cart-summary-total {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #d4af37;
  margin-top: 0.4rem;
}

.cart-summary-divider {
  height: 1px;
  background: rgba(212, 175, 55, 0.15);
  margin: 0.8rem 0;
}

.cart-checkout-btn {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(135deg, #d4af37, #f5e6a0);
  color: #0d1117;
  border: none;
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.3s ease, transform 0.15s ease;
  margin-top: 1.2rem;
}

.cart-checkout-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.cart-checkout-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.cart-clear-btn {
  width: 100%;
  padding: 0.6rem;
  background: transparent;
  color: #ff4d4d;
  border: 1px solid rgba(255, 77, 77, 0.3);
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 0.8rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cart-clear-btn:hover {
  background: rgba(255, 77, 77, 0.05);
  border-color: #ff4d4d;
}

/* Spinner */
.cart-spinner {
  border: 2px solid rgba(13, 17, 23, 0.2);
  border-left-color: #0d1117;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: cart-spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes cart-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error */
.cart-error-message {
  color: #ff4d4d;
  margin-top: 1.5rem;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: bold;
  text-align: center;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
  .cart-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 768px) {
  .cart-container {
    margin-top: 100px;
    padding: 0 1rem;
  }

  .cart-item {
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .cart-item-img-wrapper {
    width: 60px;
    height: 60px;
  }

  .cart-item-subtotal {
    width: 100%;
    text-align: left;
    margin-top: 0.4rem;
  }
}

@media (max-width: 480px) {
  .cart-item-controls {
    gap: 0.3rem;
  }

  .cart-qty-btn,
  .cart-item-remove {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }
}
