/* Shopping Cart Styles */
.cart-icon {
  position: relative;
  cursor: pointer;
  margin-left: 16px;
  font-size: 24px;
  transition: transform 0.2s;
}

.cart-icon:hover {
  transform: scale(1.1);
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -450px;
  width: 450px;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  background: var(--panel);
  box-shadow: -2px 0 20px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-sidebar.open {
  right: 0;
}

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
}

.cart-overlay.open {
  display: block;
}

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

.cart-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--accent);
}

.cart-close {
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: var(--text);
  line-height: 1;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-height: 0; /* Important for flex children to allow shrinking */
}

.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--panel);
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  align-items: center;
}

.cart-item-image {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.cart-item-price {
  color: var(--accent);
  font-weight: 600;
}

.cart-item-quantity {
  color: var(--text-muted);
  font-size: 14px;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 24px;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-remove:hover {
  color: #ff4444;
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.cart-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  flex-shrink: 0;
  background: var(--panel);
  position: sticky;
  bottom: 0;
}

.cart-subtotal,
.cart-vat,
.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text);
}

.cart-total {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.cart-total-amount {
  color: var(--accent);
}

.payment-methods {
  margin-bottom: 20px;
}

.payment-methods h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.payment-options {
  display: flex;
  gap: 12px;
}

.payment-option {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-weight: 600;
}

.payment-option:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.payment-option.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 4px 12px rgba(232, 139, 135, 0.4);
}

.checkout-button {
  width: 100%;
  padding: 16px;
  background: var(--brand-2, #c15b4f);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.checkout-button:hover {
  opacity: 0.9;
}

.checkout-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

  .cart-header {
    padding: 16px;
    flex-shrink: 0;
  }

  .cart-header h2 {
    font-size: 20px;
  }

  .cart-items {
    padding: 16px;
  }

  .cart-footer {
    padding: 16px;
  }

  .cart-total {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .checkout-button {
    padding: 14px;
    font-size: 15px;
  }
}

@media (max-height: 600px) {
  .cart-header {
    padding: 12px 16px;
  }

  .cart-header h2 {
    font-size: 18px;
  }

  .cart-close {
    font-size: 28px;
  }

  .cart-items {
    padding: 12px;
  }

  .cart-footer {
    padding: 12px;
  }

  .cart-subtotal,
  .cart-vat {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .cart-total {
    font-size: 16px;
    margin-bottom: 10px;
    padding-top: 8px;
  }

  .payment-methods {
    margin-bottom: 12px;
  }

  .checkout-button {
    padding: 12px;
    font-size: 14px;
  }
}
