/**
 * STYLES CHECKOUT & PANIER
 * Design inspiré d'Amazon & Shopify
 */

/* Checkout Wrapper */
.checkout-wrapper {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Progress Bar */
.checkout-progress {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 800px;
  margin: 0 auto;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.4;
  transition: all 0.3s ease;
}

.progress-step.active,
.progress-step.completed {
  opacity: 1;
}

.step-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #666;
  transition: all 0.3s ease;
}

.progress-step.active .step-icon {
  background: #d4af37;
  color: white;
}

.progress-step.completed .step-icon {
  background: #28a745;
  color: white;
}

.step-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #666;
}

.progress-connector {
  flex: 1;
  height: 2px;
  background: #e0e0e0;
  margin: 0 1rem;
}

/* Checkout Content Layout */
.checkout-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
}

.checkout-main {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.checkout-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

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

.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.cart-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cart-item-image {
  width: 100px;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-item-details h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: #1a1a2e;
}

.cart-item-author {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
}

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

.qty-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #d4af37;
  background: white;
  color: #d4af37;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.qty-btn:hover {
  background: #d4af37;
  color: white;
}

.qty-input {
  width: 60px;
  height: 32px;
  text-align: center;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 1rem;
}

.cart-item-price {
  text-align: right;
}

.item-price {
  font-size: 1.3rem;
  font-weight: bold;
  color: #d4af37;
  margin-bottom: 1rem;
}

.btn-remove {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-remove:hover {
  color: #c82333;
  text-decoration: underline;
}

/* Cart Actions */
.cart-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e0e0e0;
}

/* Shipping Form */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-section {
  padding: 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-section h3 {
  margin: 0 0 1.5rem 0;
  color: #1a1a2e;
  font-size: 1.2rem;
  font-weight: 600;
}

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

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

.form-group label {
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  padding: 0.75rem;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* Shipping Options */
.shipping-option {
  display: block;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shipping-option:hover {
  border-color: #d4af37;
  background: #fffef8;
}

.shipping-option input[type="radio"] {
  margin-right: 1rem;
}

.shipping-option input[type="radio"]:checked ~ .shipping-option-content {
  color: #d4af37;
}

.shipping-option-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shipping-option-name {
  font-weight: 500;
}

.shipping-option-details {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.shipping-days {
  color: #333; /* Darker for better contrast */
  font-weight: 500;
}

.shipping-price {
  font-weight: bold;
  color: #d4af37;
}

/* Payment Methods */
.payment-methods {
  margin-top: 2rem;
}

.payment-method-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.payment-tab {
  flex: 1;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.payment-tab:hover {
  border-color: #d4af37;
}

.payment-tab.active {
  border-color: #d4af37;
  background: #fffef8;
  color: #d4af37;
  font-weight: bold;
}

.payment-form {
  display: none;
  padding: 2.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.payment-form.active {
  display: block;
}

.stripe-element {
  padding: 1rem;
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  margin: 1rem 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.payment-errors {
  color: #dc3545;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.btn-pay {
  width: 100%;
  padding: 1.2rem;
  font-size: 1.1rem;
  margin-top: 1rem;
}

.trust-badges {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.security-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #e8f5e9;
  border-radius: 8px;
  margin-top: 2rem;
  color: #2e7d32;
}

/* Order Summary */
.order-summary {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.order-summary h3 {
  margin: 0 0 1.5rem 0;
  color: #1a1a2e;
}

.summary-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #333; /* Ensure visibility */
}

.summary-totals {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
}

.summary-total {
  font-size: 1.3rem;
  font-weight: bold;
  color: #d4af37;
  padding-top: 1rem;
  border-top: 2px solid #e0e0e0;
  margin-top: 0.5rem;
}

.trust-indicators {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0e0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #666;
}

.trust-item i {
  color: #28a745;
  font-size: 1.1rem;
}

/* Cart Notification */
.cart-notification {
  position: fixed;
  top: 100px;
  right: -400px;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10000;
  transition: right 0.3s ease;
}

.cart-notification.show {
  right: 20px;
}

.cart-notification-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cart-notification-content i {
  color: #28a745;
  font-size: 1.5rem;
}

/* Cart Badge */
.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

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

.empty-cart h2 {
  margin: 1rem 0;
  color: #1a1a2e;
}

.empty-cart p {
  color: #666;
  margin-bottom: 2rem;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e0e0e0;
}

/* Responsive */
@media (max-width: 1024px) {
  .checkout-content {
    grid-template-columns: 1fr;
  }
  
  .checkout-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  /* Checkout wrapper */
  .checkout-wrapper {
    padding: 0 0.5rem;
    margin: 1rem auto;
  }
  
  /* Progress bar */
  .checkout-progress {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .progress-steps {
    gap: 0.5rem;
  }
  
  .step-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .step-label {
    font-size: 0.75rem;
  }
  
  .progress-connector {
    margin: 0 0.25rem;
  }
  
  /* Main content */
  .checkout-main {
    padding: 1rem;
  }
  
  .checkout-main h2 {
    font-size: 1.5rem;
  }
  
  /* Cart items */
  .cart-item {
    grid-template-columns: 80px 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  .cart-item-image {
    width: 80px;
    height: 110px;
  }
  
  .cart-item-details h3 {
    font-size: 0.95rem;
  }
  
  .cart-item-price {
    grid-column: 1 / -1;
    text-align: left;
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  /* Forms */
  .form-section {
    padding: 1rem;
  }
  
  .form-section h3 {
    font-size: 1.1rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .form-group input,
  .form-group select {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  /* Shipping options */
  .shipping-option {
    padding: 0.75rem;
  }
  
  .shipping-option-content {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .shipping-option-details {
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start !important;
  }
  
  .shipping-option-name {
    font-size: 0.95rem;
  }
  
  .shipping-days,
  .shipping-price {
    font-size: 0.85rem;
  }
  
  /* Payment */
  .payment-method-tabs {
    flex-direction: column;
  }
  
  .payment-tab {
    font-size: 0.9rem;
    padding: 0.75rem;
  }
  
  .payment-form {
    padding: 1rem;
  }
  
  .trust-badges {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .trust-badges img {
    max-width: 150px;
  }
  
  /* Order summary */
  .order-summary {
    padding: 1rem;
    margin-top: 1rem;
  }
  
  .order-summary h3 {
    font-size: 1.1rem;
  }
  
  .summary-item {
    font-size: 0.85rem;
    flex-wrap: wrap;
  }
  
  .summary-row {
    font-size: 0.9rem;
  }
  
  .summary-total {
    font-size: 1.1rem;
  }
  
  /* Actions */
  .cart-actions,
  .form-actions {
    flex-direction: column;
    gap: 1rem;
  }
  
  .cart-actions .btn,
  .form-actions .btn {
    width: 100%;
  }
  
  /* Quantity controls */
  .cart-item-quantity {
    transform: scale(0.9);
  }
  
  /* Notifications */
  .cart-notification {
    right: -100%;
    left: auto;
    width: calc(100% - 2rem);
    max-width: 350px;
  }
  
  .cart-notification.show {
    right: 1rem;
  }
}
