/* ============================================================
   WPlama — Sidecart (vysouvací košík)
   ============================================================ */

.wpl-sidecart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 42, 66, 0.5);
  z-index: 100000;
  opacity: 0;
  transition: opacity 0.28s ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.wpl-sidecart-backdrop.is-open { opacity: 1; }

.wpl-sidecart {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(400px, 92vw);
  background: #fff;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 40px rgba(8, 42, 66, 0.18);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.wpl-sidecart.is-open { transform: translateX(0); }

/* ---- Hlavička ---- */
.wpl-sidecart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #E6EBEF;
  flex-shrink: 0;
}
.wpl-sidecart-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--wpl-navy, #082a42);
}
.wpl-sidecart-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--wpl-navy, #082a42);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.wpl-sidecart-close:hover,
.wpl-sidecart-close:focus-visible {
  background: #F1F4F6;
  outline: none;
}

/* ---- Tělo (fragment) ---- */
.wpl-sidecart-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.wpl-sidecart-items {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.wpl-sidecart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid #F1F4F6;
  transition: opacity 0.2s ease;
}
.wpl-sidecart-item.is-removing { opacity: 0.4; pointer-events: none; }

.wpl-sidecart-thumb {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: #F1F4F6;
  display: block;
}
.wpl-sidecart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wpl-sidecart-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.wpl-sidecart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--wpl-navy, #082a42);
  text-decoration: none;
  line-height: 1.35;
}
.wpl-sidecart-item-name:hover { color: var(--wpl-cta, #C2410C); }
.wpl-sidecart-item-qty {
  font-size: 13px;
  color: #6B7A85;
}

.wpl-sidecart-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #9AA7B0;
  font-size: 22px;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.wpl-sidecart-remove:hover,
.wpl-sidecart-remove:focus-visible {
  background: #FDECEC;
  color: var(--wpl-danger, #DC2626);
  outline: none;
}

/* ---- Patička panelu ---- */
.wpl-sidecart-footer {
  flex-shrink: 0;
  padding: 18px 22px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid #E6EBEF;
  background: #fff;
}
.wpl-sidecart-subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--wpl-navy, #082a42);
}
.wpl-sidecart-subtotal-amount {
  font-size: 18px;
  font-weight: 700;
}
.wpl-sidecart-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wpl-sidecart-actions .wpl-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* ---- Prázdný košík ---- */
.wpl-sidecart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 22px;
  text-align: center;
  color: #6B7A85;
}
.wpl-sidecart-empty svg { color: #C3CDD4; }
.wpl-sidecart-empty p { margin: 0; font-size: 15px; }

/* Busy stav (probíhá odebrání) */
.wpl-sidecart.is-busy { cursor: progress; }

/* Zamez scrollu pozadí, když je panel otevřený */
body.wpl-sidecart-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .wpl-sidecart { transition: none !important; }
  .wpl-sidecart-backdrop { transition: none !important; }
}
