/* HandwerkEasy — Cart-Drawer (S25)
 * ------------------------------------------------------------
 * Slide-In-Drawer fuer Multi-Service-Warenkorb.
 *  - Mobile (<=720px): Bottom-Sheet, slidet von unten, 92vh
 *  - Desktop (>=721px): Right-Drawer, slidet von rechts, 420px breit
 * Plus: Toast-Komponente fuer Add-Bestaetigung (3s, autodismiss)
 *
 * Z-Index-Ordnung:
 *  - Backdrop:    9000
 *  - Drawer:      9010
 *  - Toast:       9100 (immer above Drawer)
 *
 * State:
 *  body.he-cart-drawer-open  → kein Page-Scroll
 *  .he-cart-drawer.is-open   → Slide-In aktiv
 *  .he-cart-toast.is-visible → Toast visible
 */

.he-cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 9000;
  pointer-events: none;
  transition: background 240ms cubic-bezier(.4,0,.2,1);
}
.he-cart-backdrop.is-visible {
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.he-cart-drawer {
  position: fixed;
  background: #fff;
  z-index: 9010;
  display: flex;
  flex-direction: column;
  font-family: 'Nunito', -apple-system, system-ui, sans-serif;
  color: #0F1A14;
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.18);
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(.4,0,.2,1);
  visibility: hidden;
  pointer-events: none;
}

.he-cart-drawer.is-open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

/* Mobile (Bottom-Sheet) — default below 721px */
@media (max-width: 720px) {
  .he-cart-drawer {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: 92vh;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }
}

/* Desktop (Right-Drawer) — 721px and up */
@media (min-width: 721px) {
  .he-cart-drawer {
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    height: 100vh;
    transform: translateX(100%);
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.18);
  }
  .he-cart-drawer.is-open {
    transform: translateX(0);
  }
}

body.he-cart-drawer-open {
  overflow: hidden;
}

/* Drawer-Header */
.he-cart-drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .he-cart-drawer-header {
    padding: 14px 18px 12px;
    position: relative;
  }
  .he-cart-drawer-header::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #CBD5E1;
    border-radius: 2px;
  }
  .he-cart-drawer-header > div:first-child {
    margin-top: 12px;
  }
}

.he-cart-drawer-title {
  font-size: 17px;
  font-weight: 800;
  color: #0F1A14;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
@media (max-width: 720px) {
  .he-cart-drawer-title { font-size: 16px; }
}

.he-cart-drawer-sub {
  font-size: 12px;
  color: #64748B;
  margin-top: 3px;
}

.he-cart-drawer-close {
  width: 34px;
  height: 34px;
  border: none;
  background: #F1F5F9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #0F1A14;
  flex-shrink: 0;
  padding: 0;
  transition: background 160ms ease;
}
.he-cart-drawer-close:hover {
  background: #E2E8F0;
}
.he-cart-drawer-close svg {
  width: 14px;
  height: 14px;
}

/* Items-List */
.he-cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  -webkit-overflow-scrolling: touch;
}

.he-cart-item {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 13px;
  margin-bottom: 10px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.he-cart-item-icon {
  width: 42px;
  height: 42px;
  background: #EDF7F1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #005319;
}
.he-cart-item-icon svg {
  width: 22px;
  height: 22px;
}

.he-cart-item-body {
  flex: 1;
  min-width: 0;
}

.he-cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.he-cart-item-name {
  font-size: 14px;
  font-weight: 800;
  color: #0F1A14;
  line-height: 1.3;
}

.he-cart-item-price {
  font-size: 14px;
  font-weight: 800;
  color: #005319;
  white-space: nowrap;
}
.he-cart-item-price small {
  font-size: 11px;
  color: #64748B;
  font-weight: 400;
  margin-left: 2px;
}

.he-cart-item-meta {
  font-size: 12px;
  color: #64748B;
  margin-top: 3px;
  line-height: 1.4;
}

.he-cart-item-actions {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}

.he-cart-item-action {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.he-cart-item-action--edit { color: #005319; }
.he-cart-item-action--remove { color: #94A3B8; }
.he-cart-item-action--remove:hover { color: #DC2626; }
.he-cart-item-action svg {
  width: 11px;
  height: 11px;
}

.he-cart-add-more {
  display: block;
  text-align: center;
  background: #EDF7F1;
  color: #005319;
  font-size: 13px;
  font-weight: 800;
  padding: 11px 12px;
  border-radius: 10px;
  text-decoration: none;
  margin-top: 6px;
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  transition: background 160ms ease;
}
.he-cart-add-more:hover {
  background: #DCEFE3;
}

/* Empty-State */
.he-cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 22px;
}
.he-cart-empty-icon {
  width: 64px;
  height: 64px;
  background: #EDF7F1;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: #005319;
}
.he-cart-empty-icon svg {
  width: 32px;
  height: 32px;
}
.he-cart-empty-title {
  font-size: 15px;
  font-weight: 800;
  color: #0F1A14;
  margin-bottom: 6px;
}
.he-cart-empty-text {
  font-size: 13px;
  color: #64748B;
  line-height: 1.5;
  max-width: 240px;
  margin-bottom: 18px;
}
.he-cart-empty-cta {
  background: #005319;
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
  transition: background 160ms ease;
}
.he-cart-empty-cta:hover {
  background: #003D12;
}

/* Footer */
.he-cart-drawer-footer {
  padding: 16px 22px 20px;
  border-top: 1px solid #E2E8F0;
  background: #F6F7F6;
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .he-cart-drawer-footer {
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  }
}

.he-cart-drawer-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.he-cart-drawer-total-label {
  font-size: 13px;
  color: #64748B;
}
.he-cart-drawer-total-value {
  font-size: 22px;
  font-weight: 800;
  color: #005319;
  letter-spacing: -0.01em;
}

.he-cart-drawer-checkout {
  width: 100%;
  background: #005319;
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  transition: background 160ms ease;
}
.he-cart-drawer-checkout:hover {
  background: #003D12;
}
.he-cart-drawer-checkout svg {
  width: 14px;
  height: 14px;
}

.he-cart-drawer-hint {
  font-size: 11px;
  color: #64748B;
  text-align: center;
  margin-top: 8px;
}

/* Bundle 2 v2 (S32) — Mixed-Cart-Hinweis (Option C/4) */
.he-cart-drawer-checkout.is-disabled,
.he-cart-drawer-checkout[disabled] {
  background: #B7C5BB;
  cursor: not-allowed;
}
.he-cart-drawer-checkout.is-disabled:hover {
  background: #B7C5BB;
}

.he-cart-mixed-hint {
  background: #FFF4E5;
  border: 1px solid #FFD699;
  border-radius: 12px;
  padding: 14px 14px 12px;
  margin: 12px 0 4px;
  font-family: 'Nunito', -apple-system, system-ui, sans-serif;
}
.he-cart-mixed-hint-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.he-cart-mixed-hint-emoji {
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
  margin-top: -2px;
}
.he-cart-mixed-hint-text strong {
  display: block;
  font-size: 14px;
  color: #7A4D00;
  margin-bottom: 4px;
}
.he-cart-mixed-hint-sub {
  font-size: 12.5px;
  color: #7A4D00;
  line-height: 1.45;
  opacity: 0.92;
}
.he-cart-mixed-hint-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.he-cart-mixed-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  padding: 10px 14px;
  background: #fff;
  color: #005319;
  border: 1.5px solid #005319;
  border-radius: 10px;
  font-family: 'Nunito', -apple-system, system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}
.he-cart-mixed-btn--primary {
  background: #005319;
  color: #fff;
}
.he-cart-mixed-btn--primary:hover {
  background: #003D12;
}
.he-cart-mixed-btn:not(.he-cart-mixed-btn--primary):hover {
  background: #EAF3DE;
}
.he-cart-mixed-btn-label {
  font-size: 13.5px;
  font-weight: 700;
}
.he-cart-mixed-btn-meta {
  font-size: 11.5px;
  font-weight: 600;
  opacity: 0.85;
}
.he-cart-mixed-hint-note {
  font-size: 11.5px;
  color: #7A4D00;
  text-align: center;
  margin-top: 10px;
  line-height: 1.4;
  opacity: 0.85;
}

/* Toast (post-Add) */
.he-cart-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: #0F1A14;
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9100;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  font-family: 'Nunito', -apple-system, system-ui, sans-serif;
  transform: translateY(calc(100% + 32px));
  opacity: 0;
  pointer-events: none;
  transition: transform 320ms cubic-bezier(.4,0,.2,1), opacity 200ms ease;
}
@media (min-width: 721px) {
  .he-cart-toast {
    left: auto;
    right: 24px;
    bottom: 24px;
    max-width: 380px;
  }
}
.he-cart-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.he-cart-toast-icon {
  width: 32px;
  height: 32px;
  background: #22C55E;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.he-cart-toast-icon svg {
  width: 16px;
  height: 16px;
}
.he-cart-toast-body {
  flex: 1;
  min-width: 0;
}
.he-cart-toast-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}
.he-cart-toast-sub {
  font-size: 12px;
  color: #94A3B8;
  margin-top: 2px;
}
.he-cart-toast-cta {
  background: transparent;
  color: #22C55E;
  border: none;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.he-cart-toast-cta:hover {
  text-decoration: underline;
}

/* Counter-Pulse beim Increment (animation aufm Badge) */
@keyframes he-cart-badge-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.nav-cart-badge.is-pulsing,
.svc-page-cart-badge.is-pulsing,
.he-nav-cart-badge.is-pulsing {
  animation: he-cart-badge-pulse 360ms cubic-bezier(.4,0,.2,1);
}

/* Reduce-Motion override */
@media (prefers-reduced-motion: reduce) {
  .he-cart-drawer,
  .he-cart-backdrop,
  .he-cart-toast {
    transition: none;
  }
  .nav-cart-badge.is-pulsing,
  .svc-page-cart-badge.is-pulsing,
  .he-nav-cart-badge.is-pulsing {
    animation: none;
  }
}


/* ════════════════════════════════════════════════════════════
   S25.5 — Layout D: Pill (Intervall) + Label-Value-Zeilen
   ════════════════════════════════════════════════════════════ */

.he-cart-item-titlewrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.he-cart-item-pill {
  display: inline-block;
  background: #005319;
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  align-self: flex-start;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.he-cart-item-price--stacked {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  white-space: nowrap;
  line-height: 1.1;
}
.he-cart-item-price--stacked small {
  font-size: 10px;
  color: #64748B;
  font-weight: 400;
  margin-top: 2px;
  margin-left: 0;
}

.he-cart-item-rows {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #0F1A14;
}
.he-cart-row {
  margin-bottom: 1px;
}
.he-cart-row:last-child {
  margin-bottom: 0;
}
.he-cart-row-label {
  color: #94A3B8;
  font-weight: 500;
  margin-right: 2px;
}
.he-cart-row-value {
  color: #0F1A14;
}
