.cart-panel {
  position: fixed;
  inset: 0;
  z-index: 10060;
  pointer-events: none;
}

.cart-panel.is-open {
  pointer-events: auto;
}

.cart-panel__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.cart-panel.is-open .cart-panel__overlay {
  opacity: 1;
  pointer-events: auto;
}

.cart-panel__drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100%;
  min-height: 0;
  background: #fff;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  visibility: hidden;
}

.cart-panel.is-open .cart-panel__drawer {
  transform: translateX(0);
  visibility: visible;
}

.cart-panel__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--fanat-border, #e2e8f0);
}

.cart-panel__title {
  margin: 0;
  font-family: var(--fanat-font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.cart-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #333;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.cart-panel__close:hover,
.cart-panel__close:focus {
  background: var(--fanat-bg-alt, #f5f8fc);
  outline: 0;
}

.cart-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 0 16px;
  -webkit-overflow-scrolling: touch;
}

.cart-panel__empty {
  margin: 24px;
  color: var(--fanat-text-muted, #5c6b7a);
}

.cart-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart-panel__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 24px;
  border-bottom: 1px solid var(--fanat-border, #e2e8f0);
}

.cart-panel__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border: 1px solid var(--fanat-border, #e2e8f0);
  border-radius: var(--fanat-radius, 0.75rem);
  overflow: hidden;
  background: var(--fanat-bg-alt, #f5f8fc);
}

.cart-panel__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-panel__info {
  flex: 1 1 auto;
  min-width: 0;
}

.cart-panel__name {
  display: block;
  margin-bottom: 4px;
  color: var(--fanat-text, #1a2332);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.35;
  text-decoration: none;
}

.cart-panel__name:hover {
  color: var(--fanat-brand, #004494);
  text-decoration: none;
}

.cart-panel__price,
.cart-panel__sum {
  font-size: 0.875rem;
  color: var(--fanat-text-muted, #5c6b7a);
  margin-bottom: 6px;
}

.cart-panel__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--fanat-border, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
}

.cart-panel__qty-btn {
  width: 32px;
  height: 32px;
  border: 0;
  background: #fff;
  color: var(--fanat-text, #1a2332);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.cart-panel__qty-btn:hover {
  background: var(--fanat-bg-alt, #f5f8fc);
}

.cart-panel__qty-input {
  width: 44px;
  height: 32px;
  border: 0;
  border-left: 1px solid var(--fanat-border, #e2e8f0);
  border-right: 1px solid var(--fanat-border, #e2e8f0);
  text-align: center;
  font-size: 0.875rem;
  -moz-appearance: textfield;
}

.cart-panel__qty-input::-webkit-outer-spin-button,
.cart-panel__qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-panel__remove {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #999;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.cart-panel__remove:hover {
  color: #d9534f;
  background: #fff5f5;
}

.cart-panel__totals {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 24px 0;
  padding-top: 12px;
  border-top: 1px solid var(--fanat-border, #e2e8f0);
  font-size: 1rem;
}

.cart-panel__foot {
  flex: 0 0 auto;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--fanat-border, #e2e8f0);
}

.cart-panel__checkout {
  min-height: 44px;
}

body.is-cart-panel-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .cart-panel__drawer {
    max-width: none;
  }
}
