* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #fafafa;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== CHECKOUT CONTAINER ===== */
.checkout-page {
  min-height: 100vh;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .checkout-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== SUMMARY SECTION (Right on desktop, top on mobile) ===== */
.summary-section {
  background: #fafafa;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px;
}

@media (min-width: 768px) {
  .summary-section {
    order: 2;
    padding: 32px;
    min-height: 100vh;
    border-bottom: none;
    border-left: 1px solid #e5e7eb;
  }
}

.summary-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #000;
}

.summary-toggle i {
  font-size: 16px;
}

@media (min-width: 768px) {
  .summary-toggle {
    display: none;
  }
}

.summary-content {
  display: none;
  padding-top: 16px;
}

.summary-content.show {
  display: block;
}

@media (min-width: 768px) {
  .summary-content {
    display: block !important;
  }
}

.summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.summary-item-image {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.summary-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
}

/* Fallback si image ne charge pas */
.summary-item-image img[src=""],
.summary-item-image img:not([src]) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.summary-item-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #6b7280;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.summary-item-details {
  flex: 1;
  min-width: 0;
}

.summary-item-details h4 {
  font-size: 14px;
  font-weight: 400;
  color: #1a1a1a;
  margin: 0 0 4px 0;
}

.summary-item-info {
  font-size: 12px;
  color: #6b7280;
  margin: 2px 0;
}

.summary-item-price {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  flex-shrink: 0;
  margin-left: 12px;
}

.summary-totals {
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
  margin-top: 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
}

.summary-row.total {
  font-size: 18px;
  font-weight: 700;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

/* ===== FORM SECTION (Left on desktop) ===== */
.form-section {
  padding: 32px 16px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .form-section {
    order: 1;
    padding: 48px 32px;
  }
}

.form-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  margin-top: 32px;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

.form-section-title:first-child {
  margin-top: 0;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #4b5563;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
  background: white;
}

.form-control:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-control::placeholder {
  color: #9ca3af;
}

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

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 16px;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #000;
}

.checkbox-group label {
  font-size: 13px;
  font-weight: 400;
  color: #6b7280;
  margin: 0;
}

/* ===== PAYMENT SECTION ===== */
.payment-section {
  margin-top: 20px;
  margin-bottom: 24px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.card-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

.card-radio {
  width: 20px;
  height: 20px;
  border: 2px solid #000;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.card-radio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #000;
  border-radius: 50%;
}

.card-logos {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  padding: 10px 14px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
}

.more-cards {
  font-size: 11px;
  color: #737373;
  font-weight: 400;
  margin-left: 2px;
}

/* Card Fields */
.card-fields {
  padding: 20px;
  background: #fafafa;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
}

/* Mollie Components Styling */
.mollie-field,
#card-holder,
#card-number,
#expiry-date,
#verification-code {
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 12px 14px;
  background: white;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 48px;
  font-size: 14px;
  color: #1a1a1a;
}

.mollie-field:hover,
#card-holder:hover,
#card-number:hover,
#expiry-date:hover,
#verification-code:hover {
  border-color: #b3b3b3;
}

.mollie-field.is-focused,
#card-holder.is-focused,
#card-number.is-focused,
#expiry-date.is-focused,
#verification-code.is-focused {
  border-color: #005bd3;
  box-shadow: 0 0 0 1px #005bd3;
  outline: none;
}

.mollie-field.is-invalid,
#card-holder.is-invalid,
#card-number.is-invalid,
#expiry-date.is-invalid,
#verification-code.is-invalid {
  border-color: #d82c0d;
}

.mollie-error-message {
  color: #d82c0d;
  font-size: 12px;
  font-weight: 400;
  margin-top: 6px;
  min-height: 16px;
}

.payment-status {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  display: none;
}

.payment-status.success {
  display: block;
  background: #d1f4e0;
  color: #00783e;
  border: 1px solid #9dd9bd;
}

.payment-status.error {
  display: block;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* ===== BUTTON ===== */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: #000;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.btn-primary:hover:not(:disabled) {
  background: #1a1a1a;
}

.btn-primary:active:not(:disabled) {
  background: #2a2a2a;
}

.btn-primary:disabled {
  background: #b3b3b3;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-loader {
  font-size: 18px;
}

/* ===== SECURE BADGE ===== */
.secure-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
}

.secure-badge span:first-child {
  font-size: 14px;
  opacity: 0.8;
}

/* ===== FOOTER LINKS ===== */
.footer-links {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 13px;
  color: #6b7280;
}

.footer-link {
  text-decoration: underline;
  color: #6b7280;
  cursor: default;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .summary-section {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fafafa;
  }
}
