/* cart.css */
.cart-layout, .checkout-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  margin-top: 2rem;
  margin-bottom: 4rem;
  align-items: start;
}

@media (max-width: 992px) {
  .cart-layout, .checkout-layout {
    grid-template-columns: 1fr;
  }
}

/* Common Card Styles */
.cart-card, .summary-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--glass-border, rgba(0,0,0,0.06));
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 1.5rem;
}

.summary-card {
  position: sticky;
  top: 100px;
  border-top: 4px solid #4A7CFF;
  border-image: linear-gradient(135deg, #4A7CFF, #FF6B9D) 1;
}

/* Cart Items */
.cart-items-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.cart-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(74, 124, 255, 0.1), rgba(255, 107, 157, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  flex-shrink: 0;
}

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

.cart-item-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary, #1a1a1a);
}

.cart-item-category {
  font-size: 0.85rem;
  color: var(--text-muted, #888888);
  margin-bottom: 0.5rem;
}

.cart-item-price {
  font-weight: 600;
  color: var(--primary-color, #4A7CFF);
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--glass-border, rgba(0,0,0,0.06));
  border-radius: 999px;
  overflow: hidden;
  background: #FFF8F0;
}

.qty-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: bold;
  color: #555555;
  transition: all 0.2s;
}

.qty-btn:hover {
  background: linear-gradient(135deg, rgba(74, 124, 255, 0.1), rgba(255, 107, 157, 0.1));
  color: #1a1a1a;
}

.qty-input {
  width: 40px;
  text-align: center;
  border: none;
  background: none;
  font-weight: 600;
  color: #1a1a1a;
  pointer-events: none;
}

.cart-item-total {
  font-weight: 700;
  color: #1a1a1a;
  min-width: 80px;
  text-align: right;
}

.remove-btn {
  background: none;
  border: none;
  color: #888888;
  cursor: pointer;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.remove-btn:hover {
  color: #e53e3e;
}

/* Empty State */
.empty-cart {
  text-align: center;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--glass-border, rgba(0,0,0,0.06));
}

.empty-cart-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
}

.empty-cart h2 {
  margin-bottom: 0.5rem;
  font-family: 'Dancing Script', cursive;
  font-size: 2.5rem;
}

.empty-cart p {
  color: var(--text-muted, #888888);
  margin-bottom: 2rem;
}

/* Free Shipping Bar */
.shipping-progress-container {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--glass-border, rgba(0,0,0,0.06));
}

.shipping-progress-text {
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shipping-progress-track {
  height: 8px;
  background: #f0f0f0;
  border-radius: 999px;
  overflow: hidden;
}

.shipping-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38a169, #48bb78);
  border-radius: 999px;
  transition: width 0.5s ease-out;
  width: 0%;
}

/* Order Summary */
.summary-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  color: var(--text-secondary, #555555);
}

.summary-row.total {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 1rem;
  margin-top: 1rem;
}

.summary-row.total .value {
  background: linear-gradient(135deg, #4A7CFF, #FF6B9D);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.summary-savings {
  color: #38a169;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: right;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

.btn-checkout {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #4A7CFF, #FF6B9D);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(74, 124, 255, 0.3);
  text-align: center;
  display: inline-block;
  text-decoration: none;
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 124, 255, 0.4);
}

.trust-badges {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted, #888888);
}

.trust-badge svg {
  width: 16px;
  height: 16px;
  color: #4A7CFF;
}

/* Checkout Form */
.checkout-section {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--glass-border, rgba(0,0,0,0.06));
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.checkout-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.step-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4A7CFF, #FF6B9D);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.checkout-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary, #1a1a1a);
}

.form-control {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--glass-border, rgba(0,0,0,0.06));
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: all 0.2s;
  background: #FFF8F0;
}

.form-control:focus {
  outline: none;
  border-color: #4A7CFF;
  box-shadow: 0 0 0 3px rgba(74, 124, 255, 0.2);
  background: white;
}

textarea.form-control {
  resize: vertical;
}

.delivery-estimate {
  font-size: 0.85rem;
  color: #38a169;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Payment Methods */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.payment-method-card {
  border: 1.5px solid var(--glass-border, rgba(0,0,0,0.06));
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all 0.2s;
  background: white;
}

.payment-method-card:hover {
  border-color: rgba(74, 124, 255, 0.4);
}

.payment-method-card input[type="radio"] {
  margin-top: 0.25rem;
  accent-color: #4A7CFF;
  width: 18px;
  height: 18px;
}

.payment-method-card.selected {
  border-color: #4A7CFF;
  background: rgba(74, 124, 255, 0.03);
}

.payment-method-details {
  flex-grow: 1;
}

.payment-method-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.payment-method-desc {
  font-size: 0.85rem;
  color: var(--text-muted, #888888);
}

.payment-logos {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 1.2rem;
}

.secure-notice {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted, #888888);
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Checkout Item list in summary */
.checkout-summary-items {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 1rem;
}

.checkout-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.checkout-summary-item-name {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1rem;
}

.checkout-summary-item-qty {
  color: var(--text-muted, #888888);
  margin-right: 1rem;
}

.checkout-summary-item-price {
  font-weight: 600;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  max-width: 400px;
  width: 90%;
  transform: translateY(20px);
  transition: transform 0.3s;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal-desc {
  color: var(--text-muted, #888888);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.modal-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #4A7CFF, #FF6B9D);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .cart-item {
    flex-wrap: wrap;
  }
  .cart-item-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 1rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
