/**
 * Checkout & suivi — immersion Vilain Garçon
 */

@media (prefers-reduced-motion: reduce) {
  .vg-checkout-cta,
  .vg-checkout-card,
  .vg-confirmation-icon {
    animation: none !important;
    transition: none !important;
  }
}

.vg-checkout-main .vg-checkout-breadcrumb {
  padding-top: 16px;
  padding-bottom: 8px;
}

.vg-checkout-section {
  position: relative;
}

.vg-checkout-hero {
  max-width: 720px;
}

.vg-checkout-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.vg-checkout-sticky {
  position: sticky;
  top: 96px;
}

.vg-checkout-recap {
  border-radius: 16px;
  border: 1px solid #ececec;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  padding: 28px 22px;
}

.vg-checkout-lines {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.vg-checkout-line {
  border: 1px solid #eeeeee;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  margin-bottom: 10px;
}

.vg-checkout-line:last-child {
  border: 1px solid #eeeeee;
  margin-bottom: 0;
  padding-bottom: 10px;
}

.vg-checkout-line .item-cart-image {
  flex: 0 0 72px;
  width: 72px;
  border-radius: 10px;
  overflow: hidden;
}

.vg-checkout-line .item-cart-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vg-checkout-cta {
  position: relative;
  overflow: hidden;
  border-radius: 12px !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
  transition: transform 0.22s ease, box-shadow 0.28s ease;
}

.vg-checkout-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

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

.vg-checkout-cta[aria-busy="true"] {
  pointer-events: none;
  opacity: 0.85;
}

.vg-checkout-cta[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 45%,
    transparent 70%
  );
  animation: vgCheckoutShine 1.1s ease-in-out infinite;
}

@keyframes vgCheckoutShine {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.vg-checkout-card {
  border: 1px solid #ececec;
  border-radius: 16px;
  padding: 24px 20px;
  background: #fff;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.05);
  animation: vgCardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

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

.vg-checkout-card:nth-of-type(2) {
  animation-delay: 0.05s;
}
.vg-checkout-card:nth-of-type(3) {
  animation-delay: 0.1s;
}
.vg-checkout-card:nth-of-type(4) {
  animation-delay: 0.14s;
}

#vg-map-section {
  position: relative;
  z-index: 2;
}

.vg-checkout-map {
  width: 100%;
  height: 280px;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  overflow: hidden;
}

.vg-map-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  z-index: 50;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  background: #fff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
  max-height: 13rem;
  overflow-y: auto;
}

.vg-map-suggest-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
}

.vg-map-suggest-item:last-child {
  border-bottom: 0;
}

.vg-map-suggest-item:hover,
.vg-map-suggest-item:focus {
  background: #fafafa;
}

.vg-map-tool {
  border-radius: 10px !important;
}

.vg-btn-live-active {
  background: #0e0e0e !important;
  color: #fff !important;
  border-color: #0e0e0e !important;
}

.vg-payment-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.vg-payment-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  margin: 0;
}

.vg-payment-option:hover {
  border-color: #0F172A;
}

.vg-payment-option .form-check-input {
  margin: 0;
  flex-shrink: 0;
  width: 1.15em;
  height: 1.15em;
}

.vg-payment-option .form-check-input:checked {
  background-color: #0F172A;
  border-color: #0F172A;
}

.vg-payment-option:has(.form-check-input:checked) {
  border-color: #0F172A;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.vg-payment-option-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.vg-payment-option-title {
  font-weight: 600;
  color: #0F172A;
  font-size: 15px;
}

.vg-payment-option-desc {
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.35;
}

.vg-payment-option-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: #0F172A;
  padding: 6px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

#vg-payment-online-hint {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  color: #334155;
}

.vg-co-field-error {
  border-color: #c41e3a !important;
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.18) !important;
}

label.vg-co-label-error {
  color: #b91c1c !important;
}

#vg-map-section.vg-co-field-error {
  border-color: #c41e3a !important;
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12);
}

#vg-payment-block.vg-co-field-error {
  outline: 2px solid rgba(196, 30, 58, 0.35);
  border-radius: 12px;
}

.vg-confirmation-main .vg-confirmation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(145deg, #1a1a1a, #333);
  color: #fff;
  font-size: 2rem;
  margin-left: auto;
  margin-right: auto;
  animation: vgPopIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes vgPopIn {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.vg-tracking-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: #0e0e0e;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.03em;
}

/* Frise d’étapes (statut commande) */
.vg-track-progress {
  overflow-x: auto;
  padding-bottom: 4px;
}

.vg-track-steps {
  display: flex;
  gap: 0;
  min-width: min(100%, 640px);
  margin: 0;
  padding: 0;
  position: relative;
}

.vg-track-step {
  flex: 1;
  position: relative;
  padding: 0 8px 0 28px;
  min-height: 44px;
}

.vg-track-step::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 22px;
  width: calc(100% - 22px);
  height: 2px;
  background: #e8e8e8;
  z-index: 0;
}

.vg-track-step:last-child::before {
  display: none;
}

.vg-track-step-marker {
  position: absolute;
  left: 0;
  top: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #cfcfcf;
  background: #fff;
  z-index: 1;
  box-sizing: border-box;
}

.vg-track-step.is-done .vg-track-step-marker {
  border-color: #0e0e0e;
  background: #0e0e0e;
  box-shadow: inset 0 0 0 3px #fff;
}

.vg-track-step.is-active .vg-track-step-marker {
  border-color: #0e0e0e;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(14, 14, 14, 0.2);
}

.vg-track-step-label {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  color: #666;
  padding-top: 2px;
}

.vg-track-step.is-done .vg-track-step-label,
.vg-track-step.is-active .vg-track-step-label {
  color: #0e0e0e;
  font-weight: 600;
}

@media (max-width: 576px) {
  .vg-track-steps {
    flex-direction: column;
    min-width: 0;
  }

  .vg-track-step {
    padding-left: 36px;
    min-height: auto;
    margin-bottom: 12px;
  }

  .vg-track-step::before {
    left: 10px;
    top: 28px;
    width: 2px;
    height: calc(100% + 4px);
  }

  .vg-track-step:last-child::before {
    display: none;
  }

  .vg-track-step-marker {
    top: 2px;
  }
}

.vg-track-order-lines {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.vg-track-order-lines .item-cart {
  align-items: flex-start;
}

.vg-track-timeline {
  position: relative;
  padding-left: 8px;
}

.vg-track-timeline-item {
  position: relative;
  padding-left: 22px;
  padding-bottom: 16px;
  border-left: 2px solid #ececec;
  margin-left: 6px;
}

.vg-track-timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.vg-track-timeline-dot {
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0e0e0e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e0e0e0;
}

.z-index-3 {
  z-index: 3;
  position: relative;
}

@media (max-width: 991px) {
  .vg-checkout-sticky {
    position: static;
  }
  .vg-checkout-lines {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}
