/* Cart Sidebar Styles (Dark Theme for Premium Feel) */
:root {
  --cart-bg: #1a0506; /* Dark background matching the brand */
  --cart-accent: #dcb360; /* Gold accent */
  --cart-border: rgba(220, 179, 96, 0.2);
  --cart-text: #f5f0eb;
  --cart-text-muted: rgba(245, 240, 235, 0.7);
}

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  transform: translateX(101%);
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--cart-bg);
  z-index: 1001;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  .cart-sidebar {
    max-width: 100%;
  }
}

.cart-sidebar.active {
  transform: translateX(0);
}

.cart-header {
  padding: 24px;
  border-bottom: 1px solid var(--cart-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--cart-text);
}

.cart-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: 1px;
}

.close-cart {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--cart-text);
  transition: transform 0.3s ease;
}

.close-cart:hover {
  transform: rotate(90deg);
}

.cart-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.cart-empty-msg {
  text-align: center;
  padding-top: 60px;
  color: var(--cart-text-muted);
  font-family: 'Montserrat', sans-serif;
}

.cart-item {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--cart-border);
  animation: slideIn 0.4s ease forwards;
}

.cart-item-main {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.cart-item-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  background: #f0f0f0;
}

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

.cart-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.cart-item-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: var(--cart-text);
  line-height: 1.2;
}

.cart-item-variant {
  font-size: 0.8rem;
  color: var(--cart-text-muted);
  margin: 0;
  font-family: 'Montserrat', sans-serif;
}

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

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

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--cart-border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}

.qty-btn {
  background: none;
  border: none;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--cart-text);
}

.qty-val {
  padding: 0 12px;
  font-size: 0.9rem;
  font-family: 'Montserrat', sans-serif;
}

.remove-item-btn {
  background: none;
  border: none;
  color: #e74c3c; /* Red color for removal */
  cursor: pointer;
  padding: 4px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-item-btn:hover {
  color: #c0392b;
  transform: scale(1.1);
}

.item-price {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--cart-accent);
}

.cart-footer {
  padding: 24px;
  border-top: 1px solid var(--cart-border);
  background: var(--cart-bg);
  color: var(--cart-text);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.checkout-btn {
  width: 100%;
  background: var(--cart-accent);
  color: #1a0506; /* Dark text on gold button */
  border: none;
  padding: 16px;
  font-family: 'Cinzel', serif;
  letter-spacing: 2px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.checkout-btn:hover {
  background: #f0ebce; /* Lighter gold/cream on hover */
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 179, 96, 0.3);
  letter-spacing: 3px;
}

.checkout-btn:active {
  transform: translateY(0);
}

.checkout-btn:disabled {
  background: #555;
  color: #888;
  cursor: not-allowed;
}

/* Navbar Cart Toggle Styling */
.nav-cart-btn {
  position: fixed;
  top: 16px;
  right: 4rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #dcb360; /* Gold color for navbar icon */
  display: flex;
  align-items: center;
  z-index: 1001; /* Above navbar */
  transition: var(--transition-smooth, all 0.4s cubic-bezier(0.25, 1, 0.5, 1));
}

body.cart-open .nav-cart-btn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.8) translateY(20px);
}

.nav-cart-btn:hover {
  color: #f0ebce;
  transform: scale(1.1);
  filter: drop-shadow(0 0 10px rgba(220, 179, 96, 0.4));
}

@media (max-width: 1024px) {
  .nav-cart-btn {
    right: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-cart-btn {
    position: fixed !important;
    top: auto !important; /* Reset top */
    bottom: 25px !important;
    right: 25px !important;
    width: 60px !important;
    height: 60px !important;
    background: #dcb360 !important; /* Premium Gold FAB */
    color: #1a0506 !important; /* Dark icon on gold */
    border-radius: 50% !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
    z-index: 1500 !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    transform: scale(1);
    animation: fabAppear 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  }

  .nav-cart-btn:hover {
    background: #f0ebce !important;
    transform: scale(1.1);
  }

  .nav-cart-btn:active {
    transform: scale(0.9);
  }

  .cart-count-badge {
    top: 2px !important;
    right: 2px !important;
    background: #1a0506 !important;
    border: 2px solid #dcb360 !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 0.75rem !important;
  }
}

@keyframes fabAppear {
  from { transform: scale(0) rotate(-45deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.cart-count-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #2c2c2c;
  color: #fff;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cart-count-badge.visible {
  opacity: 1;
}

/* Add to Cart Button Animations */
@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.btn-added {
  animation: successPulse 0.4s ease;
  background: var(--cart-accent, #dcb360) !important;
  border-color: var(--cart-accent, #dcb360) !important;
  color: #1a0506 !important;
}

/* Add to Cart Button Premium Style */
.btn-cart {
  width: 100%;
  padding: 14px 28px;
  background: transparent;
  color: #dcb360;
  border: 1px solid #dcb360;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  margin-top: 10px;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.btn-cart svg {
  stroke: #dcb360; /* Explicitly set icon color to gold */
}

.btn-cart:hover svg {
  stroke: #1a0506; /* Match dark text color on hover */
}

.btn-cart::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(220, 179, 96, 0.2), transparent);
  transition: 0.5s;
}

.btn-cart:hover::after {
  left: 100%;
}

.btn-cart:hover {
  background: #dcb360;
  color: #1a0506;
  box-shadow: 0 0 20px rgba(220, 179, 96, 0.4);
  transform: translateY(-2px);
}

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

/* --- ADD TO CART ANIMATIONS --- */
.flying-item {
  position: fixed;
  z-index: 9999;
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid #dcb360;
  box-shadow: 0 0 20px rgba(220, 179, 96, 0.6);
  transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
  transform: scale(1);
  opacity: 1;
}

.nav-cart-btn.pulse {
  animation: fabPulse 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fabPulse {
  0% { transform: scale(1); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
  50% { transform: scale(1.3); box-shadow: 0 0 35px #dcb360; }
  100% { transform: scale(1); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
}
