/* ============================================================
   ALPARMOR — Panier
   ============================================================ */

/* ---- Overlay ---- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ---- Drawer ---- */
.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: #fff;
  z-index: 500;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
}
.cart-drawer.open {
  transform: translateX(0);
}

/* ---- Header ---- */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light, #e2e5eb);
  flex-shrink: 0;
}
.cart-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-dark, #0d0d0f);
  letter-spacing: -0.01em;
}
.cart-title svg { stroke: var(--accent, #eab308); }

.cart-close {
  width: 36px; height: 36px;
  background: var(--light, #f8f9fb);
  border: 1px solid var(--border-light, #e2e5eb);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--text-muted, #6b7280);
}
.cart-close:hover { background: var(--light2, #eef0f4); color: var(--text-dark, #0d0d0f); }

/* ---- Body ---- */
.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* ---- Empty ---- */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 240px;
  text-align: center;
  gap: 12px;
}
.cart-empty-icon svg {
  stroke: #d1d5db;
}
.cart-empty p {
  font-size: 0.95rem;
  color: var(--text-muted, #6b7280);
  font-weight: 500;
}

/* ---- Item ---- */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light, #e2e5eb);
}
.cart-item:last-child { border-bottom: none; }

.ci-thumb {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #78350f, #d97706);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ci-thumb svg { stroke: rgba(255,255,255,0.8); }

.ci-info { flex: 1; min-width: 0; }
.ci-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark, #0d0d0f);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ci-variant {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  margin-bottom: 10px;
}
.ci-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Qty controls */
.ci-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border-light, #e2e5eb);
  border-radius: 8px;
  overflow: hidden;
}
.ci-qty-ctrl button {
  width: 30px; height: 30px;
  background: var(--light, #f8f9fb);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark, #0d0d0f);
  cursor: pointer;
  transition: background 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.ci-qty-ctrl button:hover { background: var(--light2, #eef0f4); }
.ci-qty-ctrl span {
  width: 32px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark, #0d0d0f);
  border-left: 1.5px solid var(--border-light, #e2e5eb);
  border-right: 1.5px solid var(--border-light, #e2e5eb);
  line-height: 30px;
}

.ci-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-dark, #0d0d0f);
}

.ci-remove {
  background: none;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ci-remove:hover { color: #ef4444; background: #fef2f2; }

/* ---- Footer ---- */
.cart-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border-light, #e2e5eb);
  flex-shrink: 0;
}

.cart-totals {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted, #6b7280);
}
.cart-total-row.cart-total-final {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-dark, #0d0d0f);
  padding-top: 10px;
  border-top: 1px solid var(--border-light, #e2e5eb);
  margin-top: 4px;
}
.free-ship { color: #16a34a; font-weight: 600; }

.cart-checkout {
  font-size: 0.95rem;
  padding: 14px 20px;
  margin-bottom: 10px;
}
.cart-secure {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  text-align: center;
}

/* ---- Cart button in navbar ---- */
.cart-btn {
  position: relative;
  width: 38px; height: 38px;
  background: none;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.cart-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
}
.cart-btn svg { width: 18px; height: 18px; }

.cart-badge {
  position: absolute;
  top: -6px; right: -6px;
  width: 18px; height: 18px;
  background: var(--accent, #eab308);
  color: #1a1000;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--black, #080808);
}

/* ---- Pack selector synced highlight ---- */
.pack-option.active .po-price,
.ph-pack-opt.active .ph-po-price {
  color: var(--accent, #eab308);
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .cart-drawer { width: 100vw; }
  .cart-header { padding: 16px; }
  .cart-title  { font-size: 0.9rem; }
  .cart-close  { width: 44px; height: 44px; border-radius: 10px; }
  .cart-body   { padding: 16px; }

  .ci-qty-ctrl button {
    width: 44px; height: 44px;
    font-size: 1.1rem;
  }
  .ci-qty-ctrl span {
    width: 40px;
    font-size: 0.9rem;
    line-height: 44px;
  }
  .ci-remove { padding: 10px; min-width: 44px; min-height: 44px; }

  .cart-footer {
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .cart-checkout {
    padding: 16px 20px;
    font-size: 0.9rem;
    min-height: 50px;
  }
}

/* ---- Navbar cart-btn for light pages ---- */
.navbar-light .cart-btn {
  border-color: var(--border-light);
}
.navbar-light .cart-badge {
  border-color: var(--white);
}
