.kaiya-cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  font-family: "Arial Nova", Arial, sans-serif;
}

.kaiya-cart-drawer.is-open {
  pointer-events: auto;
  opacity: 1;
}

.kaiya-cart-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 8, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.kaiya-cart-drawer.is-open .kaiya-cart-drawer__overlay {
  opacity: 1;
}

.kaiya-cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: #fffdf8;
  box-shadow: -16px 0 40px rgba(20, 12, 8, 0.18);
  display: flex;
  flex-direction: column;
  --cart-drawer-offset: 100%;
  transform: translateX(var(--cart-drawer-offset));
  transition: transform 0.3s ease;
  will-change: transform;
}

.kaiya-cart-drawer.is-open .kaiya-cart-drawer__panel {
  --cart-drawer-offset: 0%;
}

.kaiya-cart-drawer__panel.is-dragging {
  transition: none;
}

.kaiya-cart-drawer__mobile-handle {
  display: none;
}

.kaiya-cart-drawer__header,
.kaiya-cart-drawer__footer {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid #f1e6d8;
}

.kaiya-cart-drawer__footer {
  border-bottom: 0;
  border-top: 1px solid #f1e6d8;
}

.kaiya-cart-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.kaiya-cart-drawer__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: #8c7d6a;
}

.kaiya-cart-drawer__header h2 {
  margin: 0.35rem 0 0;
  font-size: 1.2rem;
  color: #433e2c;
}

.kaiya-cart-drawer__count {
  font-weight: 600;
  margin-left: 0.35rem;
}

.kaiya-cart-drawer__close {
  border: none;
  background: #f1e6d8;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
  color: #433e2c;
  cursor: pointer;
}

.kaiya-cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.75rem;
  position: relative;
}

.kaiya-cart-drawer__loader {
  position: absolute;
  inset: 0;
  background: rgba(255, 253, 248, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  color: #433e2c;
}

.kaiya-cart-drawer__loader[hidden] {
  display: none !important;
}

.kaiya-cart-drawer__spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(67, 62, 44, 0.2);
  border-top-color: #433e2c;
  animation: kaiya-spin 0.8s linear infinite;
}

@keyframes kaiya-spin {
  to {
    transform: rotate(360deg);
  }
}

.kaiya-cart-empty {
  text-align: center;
  padding: 3rem 0;
  color: #433e2c;
}

.kaiya-cart-empty svg {
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  stroke: #8c9595;
  fill: none;
}

.kaiya-cart-items {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.kaiya-cart-item {
  display: flex;
  gap: 1rem;
}

.kaiya-cart-item__image {
  width: 96px;
  height: 124px;
  background: #f5f3f0;
  flex-shrink: 0;
  overflow: hidden;
}

.kaiya-cart-item__image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.kaiya-cart-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kaiya-cart-item__content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.kaiya-cart-item__title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.kaiya-cart-item__title h3 {
  margin: 0;
  font-size: 1rem;
  color: #433e2c;
}

.kaiya-cart-item__link {
  color: inherit;
  text-decoration: none;
}

.kaiya-cart-item__link:hover,
.kaiya-cart-item__link:focus {
  text-decoration: underline;
}

.kaiya-cart-item__meta {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.9rem;
  color: rgba(67, 62, 44, 0.65);
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  background: #f7f2eb;
  border-radius: 10px;
  line-height: 1.25;
}

.kaiya-cart-item__remove {
  border: none;
  background: transparent;
  color: #8c9595;
  cursor: pointer;
  transition: color 0.2s ease;
}

.kaiya-cart-item__remove:hover {
  color: #c07756;
}

.kaiya-cart-item__footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.kaiya-cart-item__qty {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.kaiya-cart-item__qty button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(67, 62, 44, 0.3);
  background: #fff;
  color: #433e2c;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.kaiya-cart-item__qty button:hover {
  border-color: #433e2c;
}

.kaiya-cart-item__qty span {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  font-weight: 600;
}

.kaiya-cart-item__price {
  font-weight: 600;
  color: #c07756;
}

.kaiya-cart-drawer__subtotal {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: #433e2c;
}

.kaiya-cart-drawer__note {
  margin: 0 0 1rem;
  color: rgba(67, 62, 44, 0.6);
  font-size: 0.9rem;
}

.kaiya-cart-drawer__checkout {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 1rem;
  background: #433e2c;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.kaiya-cart-drawer__checkout:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.kaiya-cart-drawer__checkout:not(:disabled):hover {
  background: #c07756;
}

.kaiya-cart-drawer__free {
  margin: 0.85rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(67, 62, 44, 0.7);
}

.kaiya-cart-drawer__view-cart {
  display: block;
  text-align: center;
  text-decoration: none;
  color: #433e2c;
  font-weight: 600;
}

.kaiya-cart-drawer__error {
  margin-top: 0.75rem;
  color: #b94747;
  text-align: center;
  font-size: 0.9rem;
}

body.kaiya-cart-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .kaiya-cart-drawer__panel {
    width: 100%;
    touch-action: pan-y;
  }
  .kaiya-cart-drawer__mobile-handle {
    display: flex;
    justify-content: center;
    padding: 0.75rem 0 0.25rem;
  }
  .kaiya-cart-drawer__mobile-handle::before {
    content: "";
    width: 3rem;
    height: 0.25rem;
    border-radius: 999px;
    background: rgba(67, 62, 44, 0.3);
  }
  .kaiya-cart-item__meta {
    font-size: 0.85rem;
    padding: 0.4rem 0.55rem;
    gap: 0.3rem;
  }
}
