/* CAPDECO cart drawer */

.cd-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 9997;
  background: rgba(0, 0, 0, .55);
}

.cd-cart-overlay[hidden] {
  display: none !important;
}

.cd-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  width: min(460px, 100vw);
  height: 100vh;
  background: #fff;
  color: #111;
  box-shadow: -20px 0 50px rgba(0, 0, 0, .18);
  transform: translateX(102%);
  transition: transform .32s ease;
}

html.cd-cart-open .cd-cart-drawer {
  transform: translateX(0);
}

html.cd-cart-open {
  overflow: hidden;
}

.cd-cart-drawer__head {
  position: relative;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #e8e1d8;
  padding: 0 64px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.cd-cart-drawer__head strong {
  font-size: 18px;
  font-weight: 500;
}

.cd-cart-drawer__close {
  position: absolute;
  top: 50%;
  right: 22px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 30px;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.cd-cart-drawer__body {
  flex: 1;
  overflow: auto;
  padding: 28px 36px;
}

.cd-cart-item {
  position: relative;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 20px;
  margin-bottom: 26px;
}

.cd-cart-item__image {
  display: block;
  background: #f4f1ec;
}

.cd-cart-item__image img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.cd-cart-item__info {
  position: relative;
  min-width: 0;
  padding-right: 28px;
}

.cd-cart-item__remove {
  position: absolute;
  top: -6px;
  right: 0;
  width: 24px;
  height: 24px;
  border: 1px solid #ddd5cc;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 18px;
  line-height: 20px;
  cursor: pointer;
}

.cd-cart-item__name {
  display: block;
  margin: 0 0 8px;
  color: #111;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.cd-cart-item__attr,
.cd-cart-item__ref {
  margin-bottom: 6px;
  color: #5d554d;
  font-size: 13px;
  line-height: 1.35;
}

.cd-cart-item__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  color: #111;
  font-size: 14px;
}

.cd-cart-item__bottom strong {
  white-space: nowrap;
  font-size: 15px;
}

.cd-cart-drawer__empty {
  color: #555;
  font-size: 15px;
}

.cd-cart-drawer__foot {
  border-top: 1px solid #e8e1d8;
  padding: 26px 36px 30px;
  background: #fff;
}

.cd-cart-drawer__subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 4px;
  color: #111;
  text-transform: uppercase;
}

.cd-cart-drawer__subtotal span {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .04em;
}

.cd-cart-drawer__subtotal strong {
  font-size: 17px;
  font-weight: 700;
}

.cd-cart-drawer__tax {
  margin-bottom: 22px;
  color: #333;
  font-size: 13px;
}

.cd-cart-drawer__reassurance {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  color: #111;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.cd-cart-drawer__reassurance li::before {
  content: "✓";
  display: inline-block;
  width: 22px;
  color: #111;
}

.cd-cart-drawer__checkout {
  display: flex;
  width: 100%;
  height: 48px;
  align-items: center;
  justify-content: center;
  background: #050505;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.cd-cart-drawer__checkout:hover {
  color: #fff;
}

.page-product .add-to-cart.is-loading,
.page-product [data-button-action="add-to-cart"].is-loading {
  opacity: .65;
  cursor: wait;
}

@media (max-width: 560px) {
  .cd-cart-drawer {
    width: 100vw;
  }

  .cd-cart-drawer__body,
  .cd-cart-drawer__foot {
    padding-left: 22px;
    padding-right: 22px;
  }

  .cd-cart-item {
    grid-template-columns: 108px 1fr;
    gap: 16px;
  }
}

/* CAPDECO cart drawer v6 - anti CLS ouverture panier */
html {
  scrollbar-gutter: stable;
}

/* On évite le déplacement gauche/droite quand la scrollbar disparaît */
html.cd-cart-open {
  overflow: visible !important;
}

html.cd-cart-open body {
  overflow: hidden !important;
  padding-right: var(--cd-scrollbar-compensation, 0px) !important;
}

/* Les éléments fixes gardent la même compensation */
html.cd-cart-open header,
html.cd-cart-open .header-top,
html.cd-cart-open .cd-header,
html.cd-cart-open #header {
  padding-right: var(--cd-scrollbar-compensation, 0px) !important;
}

/* Le tiroir reste au-dessus, sans influencer le layout */
.cd-cart-overlay,
.cd-cart-drawer {
  contain: layout paint;
}

.cd-cart-drawer {
  will-change: transform;
}

/* CAPDECO direct checkout button */
.page-product .cd-direct-checkout {
  display: flex;
  width: 100%;
  height: 52px;
  align-items: center;
  justify-content: center;
  margin: 10px 0 0;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}

.page-product .cd-direct-checkout:hover {
  background: #f7f4ef;
  color: #111;
}

.page-product .cd-direct-checkout.is-loading {
  opacity: .65;
  cursor: wait;
}
