/*
 * CBD Checkout – Style Shopify
 * Charte : vert #004437, jaune #FFD517, Neufile Grotesk Variable
 */

/* ========================================================================== */
/* Variables & Base                                                            */
/* ========================================================================== */
body#checkout {
  --cbd-primary: #004437;
  --cbd-accent: #FFD517;
  --cbd-font: "Neufile Grotesk Variable", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --cbd-line: #d9d9d9;
  --cbd-bg: #fff;
  --cbd-bg-sidebar: #fafafa;
  --cbd-text: #333333;
  --cbd-text-muted: #737373;
  --cbd-radius: 5px;
  font-size: 14px !important;
  line-height: 1.5 !important;
  font-family: var(--cbd-font) !important;
  color: var(--cbd-text) !important;
  background: var(--cbd-bg) !important;
  -webkit-font-smoothing: antialiased;
}

body#checkout a {
  color: var(--cbd-primary) !important;
  text-decoration: none;
  transition: color 0.2s ease;
}

body#checkout a:hover {
  color: #00332a !important;
  text-decoration: underline;
}

body#checkout #wrapper {
  padding: 0 !important;
  margin: 0 !important;
}

body#checkout #content,
body#checkout section#content {
  padding: 0 !important;
  margin: 0 !important;
}

body#checkout #wrapper > .container {
  max-width: 1200px;
  min-height: 0 !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

body#checkout #content-wrapper {
  padding: 0 !important;
  margin: 0 !important;
}

body#checkout #footer {
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* ========================================================================== */
/* Layout deux colonnes                                                        */
/* ========================================================================== */
body#checkout #content > .row {
  margin: 0;
}

body#checkout .cart-grid-body {
  padding: 40px 50px 40px 40px !important;
  background: var(--cbd-bg);
}

body#checkout .cart-grid-right {
  padding: 40px 40px 40px 50px !important;
  background: var(--cbd-bg-sidebar);
  border-left: 1px solid var(--cbd-line);
  position: relative;
}

/* ========================================================================== */
/* Stepper → Breadcrumb texte horizontal                                       */
/* ========================================================================== */
body#checkout .cart-grid-body {
  position: relative !important;
}

body#checkout section.checkout-step {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  background: transparent !important;
  margin: 0 !important;
  pointer-events: auto !important;
  z-index: auto !important;
}

body#checkout section.checkout-step:not(.-current) {
  position: relative !important;
}

body#checkout section.checkout-step:not(.-current) .content {
  display: none !important;
}

body#checkout section.checkout-step.-current .content {
  display: block !important;
}

body#checkout section.checkout-step .step-title {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px;
  padding: 14px 0 !important;
  margin: 0 !important;
  font-family: var(--cbd-font) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: var(--cbd-text-muted) !important;
  text-transform: none !important;
  cursor: pointer;
  text-align: left !important;
  border-bottom: 1px solid #eee !important;
  overflow: visible !important;
  min-height: auto !important;
  letter-spacing: 0 !important;
  line-height: 1.5 !important;
}

body#checkout section.checkout-step:first-child .step-title {
  border-top: none !important;
}

body#checkout section.checkout-step .step-title:before {
  display: none !important;
}

body#checkout section.checkout-step .step-title .step-number {
  display: none !important;
}

body#checkout section.checkout-step .step-title .done {
  display: none !important;
}

body#checkout section.checkout-step.-reachable.-complete .step-title .done {
  display: none !important;
}

body#checkout section.checkout-step.-reachable.-complete .step-title .done::before {
  display: none !important;
}

body#checkout section.checkout-step.-current .step-title {
  color: var(--cbd-text) !important;
  font-weight: 600 !important;
  border-bottom: 2px solid var(--cbd-primary) !important;
}

body#checkout section.checkout-step.-reachable.-complete .step-title {
  color: var(--cbd-primary) !important;
  font-weight: 400 !important;
}

body#checkout section.checkout-step .step-title .step-edit {
  display: none !important;
}

body#checkout section.checkout-step.-reachable.-complete .step-title .step-edit {
  display: inline !important;
  margin-left: auto;
  font-size: 12px !important;
  font-weight: 400 !important;
  color: var(--cbd-primary) !important;
  text-decoration: underline !important;
  order: 99;
}

body#checkout section.checkout-step.-reachable.-complete .step-title .step-edit i {
  display: none !important;
}

body#checkout section.checkout-step.-reachable.-complete .step-title .step-edit:hover {
  color: #00332a !important;
}

/* Padding top du contenu */
body#checkout .cart-grid-body .checkout-step {
  padding-top: 0 !important;
}

/* ========================================================================== */
/* Contenu de l'étape                                                          */
/* ========================================================================== */
body#checkout section.checkout-step .content {
  padding: 24px 0 !important;
  margin-top: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  font-family: var(--cbd-font) !important;
  box-shadow: none !important;
}

body#checkout section.checkout-step .content h2,
body#checkout section.checkout-step .content h3,
body#checkout section.checkout-step .content h4 {
  font-family: var(--cbd-font) !important;
  font-size: 1.15em !important;
  font-weight: 600 !important;
  color: var(--cbd-text) !important;
  margin: 0 0 16px !important;
  line-height: 1.4 !important;
}

body#checkout section.checkout-step .content .form-control-label,
body#checkout section.checkout-step .content label {
  font-family: var(--cbd-font) !important;
  color: var(--cbd-text) !important;
  font-weight: 400 !important;
  font-size: 13px !important;
  margin-bottom: 4px !important;
}

body#checkout section.checkout-step .content .small-text,
body#checkout section.checkout-step .content small {
  color: var(--cbd-text-muted) !important;
  font-size: 12px !important;
}

/* ========================================================================== */
/* Formulaires – Inputs bordés style Shopify                                   */
/* ========================================================================== */
body#checkout section.checkout-step .form-control,
body#checkout section.checkout-step .default-input,
body#checkout section.checkout-step input[type="text"],
body#checkout section.checkout-step input[type="email"],
body#checkout section.checkout-step input[type="tel"],
body#checkout section.checkout-step input[type="password"],
body#checkout section.checkout-step select,
body#checkout section.checkout-step textarea {
  padding: 10px 12px !important;
  border: 1px solid var(--cbd-line) !important;
  border-radius: var(--cbd-radius) !important;
  font-family: var(--cbd-font) !important;
  font-size: 14px !important;
  min-height: 44px !important;
  background: #fff !important;
  color: var(--cbd-text) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
}

body#checkout section.checkout-step .form-control:focus,
body#checkout section.checkout-step .default-input:focus,
body#checkout section.checkout-step input:focus,
body#checkout section.checkout-step select:focus,
body#checkout section.checkout-step textarea:focus {
  border-color: var(--cbd-primary) !important;
  outline: 0 !important;
  box-shadow: 0 0 0 2px rgba(0, 68, 55, 0.15) !important;
}

body#checkout section.checkout-step .form-control::placeholder,
body#checkout section.checkout-step input::placeholder {
  color: #aaa !important;
}

body#checkout section.checkout-step .form-group {
  margin-bottom: 14px !important;
}

body#checkout section.checkout-step .custom-radio input[type="radio"]:checked + span,
body#checkout section.checkout-step .custom-checkbox input[type="checkbox"]:checked + span {
  border-color: var(--cbd-primary) !important;
  background-color: var(--cbd-primary) !important;
}

/* ========================================================================== */
/* Bouton principal – Shopify style                                            */
/* ========================================================================== */
body#checkout section.checkout-step .btn-primary,
body#checkout section.checkout-step button.btn-primary,
body#checkout section.checkout-step .continue.btn-primary {
  display: inline-block !important;
  width: auto !important;
  max-width: none !important;
  float: right !important;
  padding: 14px 28px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  font-family: var(--cbd-font) !important;
  background: var(--cbd-primary) !important;
  border: none !important;
  border-radius: var(--cbd-radius) !important;
  color: #fff !important;
  margin-top: 8px !important;
  cursor: pointer;
  transition: background 0.2s ease;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body#checkout section.checkout-step .btn-primary:hover,
body#checkout section.checkout-step button.btn-primary:hover {
  background: #003329 !important;
  color: #fff !important;
}

/* Formulaire de connexion – footer */
body#checkout .form-footer {
  padding-top: 16px !important;
  display: block !important;
  height: auto !important;
  overflow: visible !important;
}

/* Lien retour */
body#checkout section.checkout-step .content a[href*="cart"],
body#checkout section.checkout-step .content a.btn-link {
  color: var(--cbd-primary) !important;
  font-size: 13px !important;
  text-decoration: underline !important;
}

/* Adresses */
body#checkout section.checkout-step .address-item.selected {
  border: 1px solid var(--cbd-primary) !important;
  background: rgba(0, 68, 55, 0.03) !important;
  border-radius: var(--cbd-radius) !important;
}

body#checkout section.checkout-step .address-item {
  border-radius: var(--cbd-radius) !important;
  padding: 14px !important;
  border: 1px solid var(--cbd-line) !important;
  margin-bottom: 10px !important;
}

body#checkout section.checkout-step .nav-item .nav-link {
  font-family: var(--cbd-font) !important;
  color: var(--cbd-primary) !important;
  font-weight: 500 !important;
}

body#checkout section.checkout-step .nav-item .nav-link.active {
  font-weight: 600 !important;
}

/* ========================================================================== */
/* Sidebar – Récap commande (style Shopify)                                    */
/* ========================================================================== */
body#checkout #js-checkout-summary.card,
body#checkout .cart-grid-right .card.js-cart {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  font-family: var(--cbd-font) !important;
  box-shadow: none !important;
  overflow: visible;
}

body#checkout #js-checkout-summary hr,
body#checkout #js-checkout-summary .separator {
  display: none !important;
}

body#checkout #js-checkout-summary .card-block {
  padding: 0 !important;
  border: none !important;
}

body#checkout #js-checkout-summary .card-block.cart-summary-totals {
  padding: 0 !important;
  border: none !important;
}

/* Produits dans le récap */
body#checkout #js-checkout-summary .cart-summary-products {
  border-bottom: 1px solid var(--cbd-line) !important;
  border-top: none !important;
  padding-bottom: 16px;
  margin-bottom: 0;
}

body#checkout #js-checkout-summary .cart-summary-subtotals-container {
  padding: 16px 0 0 !important;
  border: none !important;
  margin: 0 !important;
}

body#checkout #js-checkout-summary .media-list .media {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

body#checkout #js-checkout-summary .media-list .media .media-left {
  position: relative;
  flex-shrink: 0;
}

body#checkout #js-checkout-summary .media-list .media .media-left img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}

body#checkout #js-checkout-summary .media-list .media .media-body {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--cbd-text);
}

body#checkout #js-checkout-summary .media-list .media .media-body .product-price {
  float: right;
  font-weight: 600;
  color: var(--cbd-text);
}

/* Titre récap */
body#checkout #js-checkout-summary .card-block h3,
body#checkout #js-checkout-summary .card-block h4 {
  font-family: var(--cbd-font) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--cbd-text) !important;
  margin: 0 0 16px !important;
  text-transform: none !important;
}

/* Lignes subtotals & totaux */
body#checkout #js-checkout-summary .cart-summary-line,
body#checkout .cart-grid-right .cart-summary-line {
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  padding: 4px 0 !important;
  margin-bottom: 0 !important;
  clear: none !important;
}

body#checkout #js-checkout-summary .cart-summary-line::after,
body#checkout .cart-grid-right .cart-summary-line::after {
  display: none !important;
  content: none !important;
}

body#checkout #js-checkout-summary .cart-summary-line .label,
body#checkout .cart-grid-right .cart-summary-line .label {
  float: none !important;
  font-weight: 400 !important;
  color: var(--cbd-text) !important;
  flex: 1 !important;
  padding: 0 !important;
  white-space: nowrap !important;
}

body#checkout #js-checkout-summary .cart-summary-line .value,
body#checkout .cart-grid-right .cart-summary-line .value {
  float: none !important;
  font-weight: 400 !important;
  color: var(--cbd-text) !important;
  text-align: right !important;
  margin-left: 16px !important;
  flex-shrink: 0 !important;
}

body#checkout .cart-summary-totals {
  padding: 0 !important;
  border: none !important;
}

body#checkout #js-checkout-summary .cart-summary-line.cart-total,
body#checkout #js-checkout-summary .cart-summary-totals .cart-total {
  padding-top: 16px !important;
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  border-top: 1px solid var(--cbd-line) !important;
  border-bottom: none !important;
  border-left: none !important;
  border-right: none !important;
}

body#checkout #js-checkout-summary .cart-summary-line.cart-total .label,
body#checkout #js-checkout-summary .cart-summary-totals .cart-total .label {
  font-family: var(--cbd-font) !important;
  font-weight: 400 !important;
  color: var(--cbd-text) !important;
  font-size: 14px !important;
}

body#checkout #js-checkout-summary .cart-summary-line.cart-total .value,
body#checkout #js-checkout-summary .cart-summary-totals .cart-total .value {
  font-family: var(--cbd-font) !important;
  font-weight: 700 !important;
  color: var(--cbd-text) !important;
  font-size: 1.4em !important;
  margin-left: 16px !important;
}

/* Taxes sous le total */
body#checkout #js-checkout-summary .cart-summary-line:not(.cart-total) .label.sub,
body#checkout #js-checkout-summary .cart-summary-line:not(.cart-total) .value.sub {
  font-size: 12px !important;
  color: var(--cbd-text-muted) !important;
  text-align: right !important;
}

/* Voucher / Code promo dans le checkout */
body#checkout .block-promo {
  border-top: 1px solid var(--cbd-line) !important;
  padding: 16px 0 0 !important;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
}

body#checkout .block-promo .promo-code-button.display-promo {
  padding-left: 0 !important;
  margin-bottom: 0 !important;
}

body#checkout .block-promo .promo-code-button a {
  font-size: 14px !important;
  color: var(--cbd-primary) !important;
  text-decoration: none !important;
}

body#checkout .block-promo .promo-code-button a:hover {
  text-decoration: underline !important;
}

body#checkout .block-promo .promo-code {
  padding: 16px 0 !important;
  background: transparent !important;
}

body#checkout .block-promo .promo-code form {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

body#checkout .block-promo .promo-input {
  flex: 1 !important;
  width: auto !important;
  height: 44px !important;
  min-height: 44px !important;
  border: 1px solid var(--cbd-line) !important;
  border-radius: var(--cbd-radius) !important;
  padding: 0 12px !important;
  font-size: 14px !important;
  font-family: var(--cbd-font) !important;
  background: #fff !important;
  text-indent: 0 !important;
  margin: 0 !important;
}

body#checkout .block-promo .promo-input:focus {
  border-color: var(--cbd-primary) !important;
  box-shadow: 0 0 0 2px rgba(0, 68, 55, 0.15) !important;
  outline: none !important;
}

body#checkout .block-promo .promo-code form button.btn,
body#checkout .block-promo .promo-input + button {
  height: 44px !important;
  width: auto !important;
  padding: 0 20px !important;
  margin: 0 !important;
  border-radius: var(--cbd-radius) !important;
  background: var(--cbd-primary) !important;
  color: #fff !important;
  border: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  font-family: var(--cbd-font) !important;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body#checkout .block-promo .promo-code form button.btn:hover,
body#checkout .block-promo .promo-input + button:hover {
  background: #003329 !important;
}

body#checkout .block-promo .promo-code .cancel-promo {
  display: inline-block !important;
  margin-top: 10px !important;
  font-size: 13px !important;
  color: var(--cbd-text-muted) !important;
  text-decoration: underline !important;
  cursor: pointer;
}

body#checkout .block-promo .promo-code .cancel-promo:hover {
  color: var(--cbd-text) !important;
}

body#checkout .block-promo .promo-code .alert-danger {
  margin-top: 10px !important;
  border-radius: var(--cbd-radius) !important;
  font-size: 13px !important;
}

body#checkout .block-promo.promo-highlighted {
  padding: 0 !important;
  margin: 0 !important;
}

/* ========================================================================== */
/* Bouton sidebar (hors formulaire promo)                                      */
/* ========================================================================== */
body#checkout .cart-grid-right > .btn-primary,
body#checkout #js-checkout-summary > .btn-primary {
  display: block !important;
  width: 100% !important;
  padding: 14px 20px !important;
  font-family: var(--cbd-font) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  background: var(--cbd-primary) !important;
  border: none !important;
  border-radius: var(--cbd-radius) !important;
  color: #fff !important;
}

body#checkout .cart-grid-right > .btn-primary:hover,
body#checkout #js-checkout-summary > .btn-primary:hover {
  background: #003329 !important;
  color: #fff !important;
}

/* Sticky sidebar desktop */
@media (min-width: 992px) {
  body#checkout .cart-grid-right #js-checkout-summary {
    position: sticky;
    top: 20px;
  }
}

/* ========================================================================== */
/* Reassurance dans checkout                                                   */
/* ========================================================================== */
body#checkout .block-reassurance {
  margin-top: 24px;
}

body#checkout .block-reassurance span,
body#checkout .block-reassurance .block-reassurance-item span {
  color: var(--cbd-text-muted) !important;
  font-size: 12px !important;
}

/* ========================================================================== */
/* Sélection texte                                                             */
/* ========================================================================== */
body#checkout ::selection {
  background: var(--cbd-primary);
  color: #fff;
}

body#checkout ::-moz-selection {
  background: var(--cbd-primary);
  color: #fff;
}

/* ========================================================================== */
/* Responsive                                                                  */
/* ========================================================================== */
@media (max-width: 991px) {
  body#checkout .cart-grid-body {
    padding: 24px 16px !important;
  }

  body#checkout .cart-grid-right {
    padding: 24px 16px !important;
    border-left: none;
    border-top: 1px solid var(--cbd-line);
  }
}

@media (max-width: 767px) {
  body#checkout section.checkout-step .step-title {
    font-size: 13px !important;
    padding: 12px 0 !important;
  }

  body#checkout section.checkout-step .btn-primary,
  body#checkout section.checkout-step button.btn-primary {
    display: block !important;
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Fix bouton Commander – étape Paiement */
  body#checkout #payment-confirmation {
    display: block !important;
    overflow: visible !important;
    margin-top: 16px;
  }

  body#checkout #payment-confirmation .ps-shown-by-js {
    display: block !important;
  }
}
