/* LIVIAN — Cart drawer (shared) */

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  margin-left: 4px;
  background: #111;
  color: #fff;
  border-radius: 980px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  vertical-align: top;
}
.cart-badge:empty { display: none; }

button[aria-label="Panier"] { position: relative; transition: transform .25s cubic-bezier(.2,.7,.2,1); }
button[aria-label="Panier"].is-flashed { transform: scale(1.18); }

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s cubic-bezier(.2,.7,.2,1);
  z-index: 280;
}
.cart-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 100%;
  background: #fff;
  z-index: 290;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
  box-shadow: -16px 0 40px rgba(0,0,0,0.10);
  -webkit-tap-highlight-color: transparent;
}
.cart-drawer.is-open {
  transform: none;
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid #e5e5e7;
  flex-shrink: 0;
}
.cart-head h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cart-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid #e5e5e7;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cart-close:hover { background: #f5f5f7; }

.cart-empty {
  padding: 60px 24px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.cart-empty[hidden] { display: none; }
.cart-empty p { color: #6e6e73; font-size: 14px; }

.cart-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cart-item {
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f0f0f0;
}
.cart-item:last-child { border-bottom: none; }

.cart-item-image {
  width: 88px;
  height: 110px;
  background: #f5f5f7;
  overflow: hidden;
  flex-shrink: 0;
}
.cart-item-image img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.cart-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cart-item-name { font-size: 14px; font-weight: 500; color: #111; }
.cart-item-variant { font-size: 12px; color: #6e6e73; letter-spacing: 0.02em; }

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.cart-item-price { font-size: 14px; font-weight: 500; color: #111; }
.cart-item-remove {
  margin-top: 2px;
  background: none;
  border: none;
  font-size: 12px;
  color: #6e6e73;
  text-decoration: underline;
  text-underline-offset: 3px;
  align-self: flex-start;
  padding: 0;
  cursor: pointer;
}
.cart-item-remove:hover { color: #111; }

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e5e5e7;
  border-radius: 980px;
  overflow: hidden;
}
.qty-control .qty-btn {
  width: 30px; height: 30px;
  background: #fff;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}
.qty-control .qty-btn:hover { background: #f5f5f7; }
.qty-control .qty-value {
  min-width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
}

.cart-summary {
  padding: 18px 24px calc(22px + env(safe-area-inset-bottom));
  border-top: 1px solid #e5e5e7;
  background: #fff;
  flex-shrink: 0;
}
.cart-shipping-hint {
  font-size: 12px;
  color: #6e6e73;
  background: #f5f5f7;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  text-align: center;
}
.cart-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
  color: #444;
}
.cart-line.cart-total {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  border-top: 1px solid #e5e5e7;
  padding-top: 12px;
  margin-top: 6px;
  margin-bottom: 14px;
}
.cart-cta-dark, .cart-cta-light {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: all .25s cubic-bezier(.2,.7,.2,1);
}
.cart-cta-dark {
  background: #111;
  color: #fff;
}
.cart-cta-dark:hover { background: #2a2a2a; }
.cart-cta-light {
  background: transparent;
  color: #111;
  border: 1px solid #111;
}
.cart-cta-light:hover { background: #111; color: #fff; }

body.cart-open { overflow: hidden; }

/* Mobile: bottom sheet style */
@media (max-width: 720px) {
  .cart-drawer {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -16px 40px rgba(0,0,0,0.15);
  }
  .cart-drawer.is-open { transform: none; }
  .cart-drawer::before {
    content: '';
    display: block;
    width: 44px;
    height: 4px;
    background: #e5e5e7;
    border-radius: 980px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }
  .cart-head { padding: 14px 22px; }
  .cart-list { padding: 12px 22px; }
  .cart-summary { padding: 16px 22px calc(20px + env(safe-area-inset-bottom)); }
}
