/* SLA Custom Cart */
:root {
  --cart-accent: #ff855d;
  --cart-accent-hover: #e8703d;
  --cart-bg: #fff;
  --cart-text: #1a1a1a;
  --cart-gray: #f5f5f5;
  --cart-border: #e8e8e8;
  --cart-w: 380px;
}

/* Overlay */
#sla-cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99998;
  cursor: pointer;
}
#sla-cart-overlay.open { display: block; }

/* Panel */
#sla-cart {
  position: fixed;
  top: 0; right: 0;
  width: var(--cart-w);
  max-width: 100vw;
  height: 100dvh;
  background: var(--cart-bg);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
}
#sla-cart.open { transform: translateX(0); }

/* Header */
.sla-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--cart-border);
  flex-shrink: 0;
}
.sla-cart__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--cart-text);
  font-family: 'Unbounded', sans-serif;
}
.sla-cart__count {
  font-size: 13px;
  color: #888;
  margin-left: 6px;
  font-family: inherit;
}
.sla-cart__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #888;
  font-size: 22px;
  line-height: 1;
  transition: color .2s;
}
.sla-cart__close:hover { color: var(--cart-text); }

/* Items */
.sla-cart__items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sla-cart__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #aaa;
  font-size: 14px;
  padding: 40px 0;
}
.sla-cart__empty svg { opacity: .3; }

/* Item */
.sla-cart__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--cart-border);
}
.sla-cart__item:last-child { border-bottom: none; }
.sla-cart__item-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--cart-gray);
}
.sla-cart__item-body { flex: 1; min-width: 0; }
.sla-cart__item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--cart-text);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sla-cart__item-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--cart-accent);
  margin-bottom: 8px;
}
.sla-cart__item-controls {
  display: flex;
  align-items: center;
  gap: 0;
}
.sla-cart__qty-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--cart-border);
  background: var(--cart-gray);
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--cart-text);
  transition: background .15s;
  flex-shrink: 0;
}
.sla-cart__qty-btn:hover { background: #e8e8e8; }
.sla-cart__qty {
  width: 36px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--cart-text);
}
.sla-cart__item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  font-size: 18px;
  padding: 2px 4px;
  line-height: 1;
  transition: color .2s;
  flex-shrink: 0;
  align-self: flex-start;
}
.sla-cart__item-remove:hover { color: #e55; }

/* Footer */
.sla-cart__foot {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--cart-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sla-cart__total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--cart-text);
}
.sla-cart__total-sum { color: var(--cart-accent); font-size: 18px; }
.sla-cart__checkout-btn {
  width: 100%;
  padding: 14px;
  background: var(--cart-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  font-family: 'Unbounded', sans-serif;
}
.sla-cart__checkout-btn:hover { background: var(--cart-accent-hover); }
.sla-cart__checkout-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Cart button in nav */
#sla-cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 8px;
  color: rgba(255,255,255,.85);
  transition: background .2s, color .2s;
  flex-shrink: 0;
}
#sla-cart-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
#sla-cart-btn-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--cart-accent);
  color: #fff;
  border-radius: 50%;
  width: 17px; height: 17px;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  display: none;
  pointer-events: none;
}

/* Checkout Modal */
#sla-checkout-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#sla-checkout-overlay.open { display: flex; }
#sla-checkout-modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.sla-checkout__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  font-family: 'Unbounded', sans-serif;
  color: var(--cart-text);
}
.sla-checkout__close {
  position: absolute;
  top: 16px; right: 16px;
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  color: #888; line-height: 1;
}
.sla-checkout__close:hover { color: var(--cart-text); }
.sla-checkout__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.sla-checkout__field label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #888;
}
.sla-checkout__field input,
.sla-checkout__field textarea {
  padding: 11px 14px;
  border: 1px solid var(--cart-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--cart-text);
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
  resize: none;
}
.sla-checkout__field input:focus,
.sla-checkout__field textarea:focus {
  border-color: var(--cart-accent);
}
.sla-checkout__summary {
  background: var(--cart-gray);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}
.sla-checkout__submit {
  width: 100%;
  padding: 14px;
  background: var(--cart-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  font-family: 'Unbounded', sans-serif;
}
.sla-checkout__submit:hover { background: var(--cart-accent-hover); }
.sla-checkout__submit:disabled { background: #ccc; cursor: not-allowed; }
.sla-checkout__msg {
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
  min-height: 20px;
}
.sla-checkout__msg.ok { color: #2a9d2a; }
.sla-checkout__msg.err { color: #e53; }

@media (max-width: 420px) {
  #sla-cart { width: 100vw; }
}
