/* ============================================================
   AtelierCox — Page Checkout (checkout.css)
   ============================================================ */

/* ---- Header minimal checkout ---- */
.ac-checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ac-space-md) var(--ac-space-xl);
  border-bottom: 1px solid var(--ac-border-light);
  background: var(--ac-white);
}
.ac-checkout-back-link {
  font-size: var(--ac-fs-sm);
  color: var(--ac-text-light);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--ac-transition);
}
.ac-checkout-back-link::before {
  content: '←';
  font-size: var(--ac-fs-base);
}
.ac-checkout-back-link:hover { color: var(--ac-text); }
.ac-checkout-header-logo {
  height: 36px;
}
.ac-checkout-header-right {
  display: flex;
  align-items: center;
  gap: var(--ac-space-xl);
}
.ac-checkout-user-link,
.ac-checkout-help-link {
  font-size: var(--ac-fs-sm);
  color: var(--ac-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ac-checkout-user-link:hover,
.ac-checkout-help-link:hover { color: var(--ac-green); }

/* ---- Progress bar ---- */
.ac-checkout-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ac-space-lg) var(--ac-space-xl);
  gap: 0;
  background: var(--ac-white);
  border-bottom: 1px solid var(--ac-border-light);
}
.ac-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  flex: 1;
  max-width: 140px;
}
.ac-progress-step::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 14px);
  right: calc(-50% + 14px);
  height: 2px;
  background: var(--ac-border);
  z-index: 0;
}
.ac-progress-step:last-child::after { display: none; }
.ac-progress-step--done::after,
.ac-progress-step--active::after {
  background: var(--ac-green);
}
.ac-progress-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--ac-border);
  background: var(--ac-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ac-fs-xs);
  font-weight: var(--ac-fw-bold);
  color: var(--ac-text-muted);
  position: relative;
  z-index: 1;
  transition: all var(--ac-transition);
}
.ac-progress-step--done .ac-progress-dot {
  background: var(--ac-green);
  border-color: var(--ac-green);
  color: var(--ac-white);
}
.ac-progress-step--done .ac-progress-dot::before {
  content: '✓';
  font-size: 13px;
}
.ac-progress-step--active .ac-progress-dot {
  background: var(--ac-green);
  border-color: var(--ac-green);
  color: var(--ac-white);
  box-shadow: 0 0 0 4px rgba(107,145,19,0.15);
}
.ac-progress-label {
  font-size: var(--ac-fs-xs);
  color: var(--ac-text-muted);
  text-align: center;
  white-space: nowrap;
}
.ac-progress-step--done .ac-progress-label,
.ac-progress-step--active .ac-progress-label {
  color: var(--ac-green);
  font-weight: var(--ac-fw-medium);
}

/* ---- Layout checkout ---- */
.woocommerce-checkout .woocommerce,
.ac-checkout-layout-wrap {
  max-width: var(--ac-container);
  margin: 0 auto;
  padding: 0 var(--ac-space-lg);
}

.ac-checkout-page {
  padding: var(--ac-space-xl) 0 var(--ac-space-2xl);
}

.ac-checkout-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--ac-space-xl);
  align-items: start;
}

/* ---- Titre page ---- */
.ac-checkout-title {
  font-family: var(--ac-font-title);
  font-size: var(--ac-fs-xl);
  font-weight: var(--ac-fw-bold);
  color: var(--ac-text);
  margin: 0 0 var(--ac-space-xl);
}

/* ============================================================
   COLONNE GAUCHE — Facturation & Paiement
   ============================================================ */

/* Section billing */
.ac-billing-section {
  margin-bottom: var(--ac-space-xl);
}
.ac-billing-section-title {
  font-size: var(--ac-fs-md);
  font-weight: var(--ac-fw-semi);
  color: var(--ac-text);
  margin: 0 0 var(--ac-space-md);
}
.ac-billing-address {
  font-size: var(--ac-fs-sm);
  color: var(--ac-text);
  line-height: 1.7;
  font-style: normal;
}
.ac-billing-edit-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--ac-fs-sm);
  color: var(--ac-green);
  text-decoration: none;
  font-weight: var(--ac-fw-medium);
  margin-top: var(--ac-space-sm);
}
.ac-billing-edit-link::before { content: '✏'; font-size: 11px; }
.ac-billing-edit-link:hover { text-decoration: underline; }

/* Section paiement */
.ac-payment-section-title {
  font-size: var(--ac-fs-md);
  font-weight: var(--ac-fw-semi);
  color: var(--ac-text);
  margin: 0 0 var(--ac-space-md);
}

/* Methods liste */
.ac-payment-methods { display: flex; flex-direction: column; gap: 0; }

.ac-payment-method {
  border: 1.5px solid var(--ac-border);
  border-radius: var(--ac-radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color var(--ac-transition);
}
.ac-payment-method:last-child { margin-bottom: 0; }

.ac-payment-method-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--ac-space-md);
  cursor: pointer;
  user-select: none;
}
.ac-payment-method-header-left {
  display: flex;
  align-items: center;
  gap: var(--ac-space-md);
}
.ac-payment-method input[type=radio] { display: none; }

.ac-radio-custom {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--ac-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--ac-transition);
}
.ac-payment-method.is-active .ac-radio-custom {
  border-color: var(--ac-green);
}
.ac-radio-custom::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ac-green);
  opacity: 0;
  transform: scale(0);
  transition: all var(--ac-transition);
}
.ac-payment-method.is-active .ac-radio-custom::after {
  opacity: 1;
  transform: scale(1);
}
.ac-payment-method-name {
  font-size: var(--ac-fs-sm);
  font-weight: var(--ac-fw-medium);
  color: var(--ac-text);
}
.ac-payment-method-logos {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ac-payment-method-logos img {
  height: 24px;
}
.ac-payment-method-logo-text {
  font-size: var(--ac-fs-base);
  font-weight: var(--ac-fw-bold);
}
.ac-payment-method-logo-text.alma { color: #fa5022; }
.ac-payment-method-logo-text.fintecture { color: #00b2a9; }

/* Contenu méthode active */
.ac-payment-method.is-active {
  border-color: var(--ac-green);
}
.ac-payment-method-body {
  display: none;
  padding: var(--ac-space-md);
  border-top: 1px solid var(--ac-border-light);
  background: #fafafa;
}
.ac-payment-method.is-active .ac-payment-method-body { display: block; }

/* Formulaire carte */
.ac-card-form {
  display: flex;
  flex-direction: column;
  gap: var(--ac-space-md);
}
.ac-card-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--ac-space-md);
}
.ac-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ac-form-group label {
  font-size: var(--ac-fs-xs);
  font-weight: var(--ac-fw-medium);
  color: var(--ac-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ac-form-group input {
  padding: 12px var(--ac-space-md);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-sm);
  font-size: var(--ac-fs-sm);
  font-family: var(--ac-font-body);
  color: var(--ac-text);
  outline: none;
  transition: border-color var(--ac-transition);
  background: var(--ac-white);
}
.ac-form-group input:focus { border-color: var(--ac-green); }
.ac-form-group input::placeholder { color: var(--ac-text-muted); }
.ac-card-note {
  font-size: var(--ac-fs-xs);
  color: var(--ac-text-muted);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.5;
}
.ac-card-note::before { content: 'ⓘ'; flex-shrink: 0; }

/* CGV */
.ac-checkout-terms {
  text-align: center;
  font-size: var(--ac-fs-xs);
  color: var(--ac-text-muted);
  margin-top: var(--ac-space-md);
}
.ac-checkout-terms a {
  color: var(--ac-text-light);
  text-decoration: underline;
}

/* ============================================================
   SIDEBAR — RÉCAPITULATIF CHECKOUT
   ============================================================ */
.ac-checkout-sidebar {
  position: sticky;
  top: var(--ac-space-lg);
}
.ac-checkout-summary {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-md);
  padding: var(--ac-space-lg);
}
.ac-checkout-summary-title {
  font-family: var(--ac-font-title);
  font-size: var(--ac-fs-lg);
  font-weight: var(--ac-fw-bold);
  color: var(--ac-text);
  margin: 0 0 var(--ac-space-lg);
}

/* Article récap */
.ac-recap-items { display: flex; flex-direction: column; gap: var(--ac-space-md); }
.ac-recap-item {
  display: flex;
  align-items: flex-start;
  gap: var(--ac-space-md);
}
.ac-recap-item-img {
  width: 64px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--ac-radius-sm);
  flex-shrink: 0;
}
.ac-recap-item-details { flex: 1; }
.ac-recap-item-name {
  font-size: var(--ac-fs-sm);
  font-weight: var(--ac-fw-medium);
  color: var(--ac-text);
  line-height: 1.4;
  margin: 0 0 4px;
}
.ac-recap-item-price {
  font-size: var(--ac-fs-base);
  font-weight: var(--ac-fw-bold);
  color: var(--ac-price);
  margin: 0;
}

/* Adresse de livraison */
.ac-recap-shipping-section {
  margin-top: var(--ac-space-md);
  padding-top: var(--ac-space-md);
  border-top: 1px solid var(--ac-border-light);
}
.ac-recap-section-title {
  font-size: var(--ac-fs-sm);
  font-weight: var(--ac-fw-semi);
  color: var(--ac-text);
  margin: 0 0 var(--ac-space-sm);
}
.ac-recap-address {
  font-size: var(--ac-fs-sm);
  color: var(--ac-text-light);
  line-height: 1.7;
  font-style: normal;
  margin: 0;
}

/* Totaux checkout */
.ac-checkout-totals {
  margin-top: var(--ac-space-md);
  padding-top: var(--ac-space-md);
  border-top: 1px solid var(--ac-border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ac-checkout-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.ac-checkout-totals-row .label {
  font-size: var(--ac-fs-sm);
  color: var(--ac-text-light);
}
.ac-checkout-totals-row .value {
  font-size: var(--ac-fs-sm);
  font-weight: var(--ac-fw-medium);
  color: var(--ac-text);
}
.ac-checkout-totals-row.shipping .value {
  font-size: var(--ac-fs-sm);
  color: var(--ac-text);
}
.ac-checkout-totals-row.total {
  padding-top: var(--ac-space-sm);
  border-top: 1px solid var(--ac-border);
  margin-top: 4px;
}
.ac-checkout-totals-row.total .label {
  font-size: var(--ac-fs-md);
  font-weight: var(--ac-fw-bold);
  color: var(--ac-text);
}
.ac-checkout-totals-row.total .value {
  font-size: var(--ac-fs-lg);
  font-weight: var(--ac-fw-bold);
  color: var(--ac-price);
}
.ac-checkout-totals-tax {
  font-size: var(--ac-fs-xs);
  color: var(--ac-text-muted);
  text-align: right;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .ac-checkout-layout {
    grid-template-columns: 1fr 320px;
  }
}
@media (max-width: 768px) {
  .ac-checkout-layout { grid-template-columns: 1fr; }
  .ac-checkout-sidebar { position: static; order: -1; }
  .ac-checkout-header { padding: var(--ac-space-md); }
  .ac-progress-label { display: none; }
  .ac-checkout-progress { padding: var(--ac-space-md); }
  .ac-card-form-row { grid-template-columns: 1fr; }
}

/* ============================================================
   LIVRAISON — correctifs pixel-perfect (ajoutés juin 2026)
   ============================================================ */

/* Cacher footer Storefront sur checkout (overlay invisible) */
body.woocommerce-checkout .storefront-handheld-footer-bar,
body.woocommerce-checkout .footer-cart-contents { display: none !important; }

/* Modifier button avec icône crayon */
.ac-billing-edit-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--ac-fs-sm);
  color: var(--ac-green);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 10px;
  text-decoration: none;
}
.ac-billing-edit-link:hover { text-decoration: underline; }

/* Totaux sidebar — colonne droite empilée */
.ac-totals-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}
.ac-checkout-totals-row {
  align-items: flex-start;
}
.ac-recap-art-count,
.ac-recap-shipping-delay {
  font-size: 11px;
  color: var(--ac-text-muted);
  margin-top: 1px;
}

/* Adresse sauvegardée */
.ac-saved-address address { font-style: normal; line-height: 1.7; }

/* Enregistrer les modifications — largeur auto */
.ac-save-address-btn { width: auto; min-width: 220px; }

/* ============================================================
   LIVRAISON — pixel-perfect juin 2026
   ============================================================ */
body.woocommerce-checkout .storefront-handheld-footer-bar,
body.woocommerce-checkout .footer-cart-contents { display: none !important; }

.ac-billing-edit-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--ac-fs-sm);
  color: var(--ac-green);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 10px;
  text-decoration: none;
}
.ac-billing-edit-link:hover { text-decoration: underline; }

.ac-checkout-totals-row { align-items: flex-start; }
.ac-totals-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}
.ac-recap-art-count,
.ac-recap-shipping-delay {
  font-size: 11px;
  color: var(--ac-text-muted);
  margin-top: 1px;
}
.ac-saved-address address { font-style: normal; line-height: 1.7; }
.ac-save-address-btn { width: auto; min-width: 220px; }

body.woocommerce-order-received span.woocommerce-Price-amount.amount {
    font-size: 25px;
    color: #8FBD46;
    font-family: 'Syne';
}
body.woocommerce-order-received span.woocommerce-Price-amount.amount span.woocommerce-Price-currencySymbol {
    top: 0.3em !important;
}

/* ---- Confirmation — regles du 16/10 ---- */
.ac-summary-help {
    padding: 30px;
    border: 1px solid #E5E5E2;
}
span.ac-help-link-title {
    font-size: 18px;
    color: #524235;
    text-decoration: none !important;
    font-weight: bold;
    margin: 0;
}
span.ac-help-link-sub {
    font-size: 15px;
    font-family: 'niveau-grotesk';
    color: #524235;
    text-decoration: none;
}
a.ac-help-link {
    text-decoration: none !important;
    margin-bottom: 10px;
    padding-bottom: 25px;
    align-items: center;
}
.ac-help-link img.ac-checkout-custom-icon {
    width: 32px !important;
    height: 39px !important;
}
body.woocommerce-checkout .ac-summary-help a.ac-btn-primary {
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    font-family: 'Syne' !important;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 35px !important;
}
.ac-confirmation-page {
    margin-top: 50px !important;
}
.ac-confirmation-page aside.ac-checkout-sidebar {
    margin-top: 20px;
}
.ac-confirmation-meta {
    padding: 32px;
}
.ac-order-detail {
    padding: 32px;
    border: 1px solid #E5E5E2;
}
p.ac-confirmation-item-name {
    color: #524235;
    font-size: 19px;
    font-family: 'niveau-grotesk';
}
.ac-cart-item-options, .ac-cart-item-options p, .ac-cart-item-options li {
    font-size: 17px !important;
    font-family: 'niveau-grotesk';
    color: #524235 !important;
    line-height: 1.2 !important;
}
p.ac-confirmation-shipping-name {
    font-size: 19px;
    font-family: 'niveau-grotesk';
    color: #524235;
}
.ac-confirmation-item, .ac-confirmation-shipping, .ac-confirmation-address, .ac-confirmation-payment {
    border-bottom: 1px solid #E5E5E2;
    padding: 0 0 32px 0;
    margin: 0 0 32px 0;
}
.ac-confirmation-payment {
    border: none !important;
    padding: 32px 0 0 0 !important;
    margin: 0 !important;
}
p.ac-confirmation-shipping-note {
    background: #F5F5F4;
    font-size: 17px;
    color: #524235;
    padding: 9px 15px;
    border-radius: 0;
    font-weight: 500;
}
.ac-confirmation-shipping-note::before {
    content: 'ⓘ';
    font-size: 16px !important;
    font-weight: 600;
    line-height: 1.4 !important;
    color: #524235 !important;
}
.ac-confirmation-address p, .ac-confirmation-address address {
    font-size: 17px !important;
    color: #524235 !important;
    line-height: 1.3 !important;
}
.ac-confirmation-shipping-left p {
    margin: 0 0 10px 0;
}
.ac-confirmation-shipping-left p.ac-confirmation-shipping-name {
    margin: 0 !important;
}
.ac-confirmation-shipping {
    border: none !important;
    border-bottom: none !important;
    padding: 0 !important;
}
span.ac-confirmation-payment-label {
    font-size: 17px !important;
    color: #524235 !important;
    line-height: 1.3 !important;
}
body.woocommerce-order-received .ac-progress-step--done .ac-progress-dot {
    background: #fff !important;
    border-color: #8fbd46 !important;
}
body.woocommerce-order-received .ac-progress-step--done .ac-progress-dot svg path {
    stroke: #8fbd46;
}
body.woocommerce-order-received .ac-progress-step--done + .ac-progress-step--done::before {
    background: #8fbd46 !important;
}
body.woocommerce-order-received .ac-progress-step--done + .ac-progress-step:not(.ac-progress-step--done)::before {
    background: #e0e0e0 !important;
}
body.woocommerce-order-received .ac-progress-step--active .ac-progress-dot {
    background: #8fbd46 !important;
    border-color: #8fbd46 !important;
    color: #fff !important;
}

/* ==== Re-application regles utilisateur 16/10 ==== */
address.ac-billing-address {
    margin: 0;
}
button#ac-toggle-shipping-form {
    margin: 0;
}
button#ac-toggle-shipping-form svg {
    width: 17px;
    height: 17px;
}
.ac-shipping-method-card.is-active {
    border: 2px solid #8FBD46 !important;
    border-radius: 0;
    padding: 32px;
}
.ac-shipping-method-card.is-active .ac-radio-custom {
    border: 2px solid #8FBD46 !important;
    height: 22px;
    width: 22px;
    position: relative;
}
.ac-shipping-method-card.is-active .ac-radio-custom::after {
    content: "";
    width: 13px;
    height: 13px;
    background: #8fbd46 !important;
    display: block;
    position: absolute;
    transform: translate(-50%, -50%);
    top: 50% !important;
    left: 50% !important;
    opacity: 1;
}
span.ac-shipping-method-name {
    font-size: 18px;
    font-family: 'Syne';
    font-weight: bold;
}
span.ac-shipping-method-delay {
    font-size: 17px;
    color: #524235;
    font-family: 'niveau-grotesk';
}
.ac-shipping-method-left svg.ac-shipping-icon {
    margin: 0 14px;
}
span.ac-shipping-free {
    font-size: 17px;
    color: #524235;
    font-family: 'niveau-grotesk';
}
.ac-shipping-method-header {
    padding: 0 0 30px 0 !important;
    margin-bottom: 35px;
    border-bottom: 1px solid #E5E5E2;
}
.ac-shipping-details li {
    color: #524235 !important;
    font-size: 17px !important;
    font-family: 'niveau-grotesk';
    background: transparent;
}
ul.ac-shipping-details {
    padding: 0;
    background: transparent;
    border: none;
}
li.ac-shipping-detail--warning {
    background: #F5F5F4;
    padding: 8px 15px;
}
.ac-shipping-detail--warning::before {
    display: none;
}
.ac-shipping-details li::before {
    top: 6px !important;
}
body.woocommerce-checkout .ac-progress-dot {
    border-color: #95877A !important;
    color: #95877A !important;
}
.ac-summary-articles, .ac-summary-totals {
    padding: 30px;
    border: 1px solid #E5E5E2;
}
h2.ac-checkout-summary-title {
    font-size: 30px;
    margin-bottom: 10px;
}
.ac-checkout-summary {
    padding: 0 !important;
    border: none !important;
    gap: 15px !important;
    display: flex;
    flex-direction: column;
}
body.woocommerce-checkout .ac-recap-count, html body.woocommerce-checkout .ac-recap-count {
    font-size: 25px;
    font-family: 'Syne' !important;
    font-weight: bold;
}
p.ac-recap-item-name {
    font-size: 19px;
    line-height: 1.3;
}
img.ac-recap-item-img {
    width: 97px;
    height: 97px;
    border-radius: 0;
}
p.ac-recap-item-price {
    color: #8FBD46;
}
.ac-recap-item-details {
    height: stretch;
    justify-content: space-between;
    display: flex;
    flex-direction: column;
}
.ac-recap-item-details bdi {
    font-size: 25px !important;
}
html body.woocommerce-checkout .ac-checkout-summary .label {
    font-size: 18px;
    font-family: 'Syne' !important;
    font-weight: bold;
}
.ac-totals-right bdi {
    font-size: 18px !important;
    font-weight: bold;
}
.ac-checkout-totals-row {
    border-bottom: 1px solid #E5E5E2;
}
.ac-summary-totals .ac-checkout-totals, .ac-summary-totals .ac-checkout-totals-row.total {
    margin: 0;
    border: none;
    padding: 0;
}
.ac-summary-totals .ac-checkout-totals-row {
    padding: 0 0 19px 0;
    margin-bottom: 15px;
}
.total bdi {
    font-size: 25px !important;
}
address.ac-recap-address {
    font-size: 17px;
    line-height: 1.3;
    color: #524235;
}
p.ac-recap-section-title {
    font-size: 25px;
    color: #524235;
    font-family: "Syne";
    font-weight: bold;
}
a.ac-billing-edit-link {
    font-size: 16px;
    color: #8FBD46;
    text-decoration: none !important;
    font-weight: bold;
    font-family: 'niveau-grotesk', Arial, sans-serif !important;
}
