/* Cart icon, slide-out panel, toast */
.agatha-cart-nav {
  display: flex;
  align-items: center;
}

.agatha-cart-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: #1c1c1c;
  cursor: pointer;
  transition: color 0.2s;
}

.agatha-cart-toggle:hover {
  color: #ff8e8e;
}

.agatha-cart-toggle__icon {
  width: 24px;
  height: 24px;
}

.agatha-cart-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #00c357;
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.agatha-cart-badge.is-hidden {
  display: none;
}

.agatha-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 10060;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.agatha-cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.agatha-cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100vh;
  background: #fff;
  z-index: 10070;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.agatha-cart-panel.is-open {
  transform: translateX(0);
}

.agatha-cart-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.agatha-cart-panel__title {
  margin: 0;
  font-family: 'Raleway', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #1c1c1c;
}

.agatha-cart-panel__close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: #666;
  cursor: pointer;
}

.agatha-cart-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.agatha-cart-panel__empty {
  text-align: center;
  color: #888;
  font-size: 15px;
  padding: 32px 0 16px;
}

.agatha-cart-panel__shop {
  display: block;
  text-align: center;
  color: #1c1c1c;
  font-weight: 600;
  text-decoration: underline;
}

.agatha-cart-panel__foot {
  padding: 20px 24px;
  border-top: 1px solid #eee;
}

.agatha-cart-panel__total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-family: 'Raleway', sans-serif;
  font-size: 16px;
}

.agatha-cart-panel__total-row strong {
  font-size: 22px;
  font-weight: 700;
}

.agatha-cart-panel__checkout {
  display: block;
  width: 100%;
  height: 48px;
  line-height: 48px;
  text-align: center;
  background: #00c357;
  color: #fff !important;
  border-radius: 10px;
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none !important;
  transition: opacity 0.2s;
}

.agatha-cart-panel__checkout:hover {
  opacity: 0.9;
  color: #fff !important;
}

.agatha-cart-item {
  display: grid;
  grid-template-columns: 72px 1fr 28px;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.agatha-cart-item__img {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #f8f8f8;
}

.agatha-cart-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agatha-cart-item__name {
  display: block;
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1c1c1c;
  line-height: 1.35;
  text-decoration: none;
  margin-bottom: 6px;
}

.agatha-cart-item__name:hover {
  color: #ff8e8e;
}

.agatha-cart-item__price {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.agatha-cart-item__remove {
  width: 28px;
  height: 28px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  color: #888;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.agatha-cart-item__remove:hover {
  background: #ffe8e8;
  color: #c00;
}

.agatha-cart-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1c1c1c;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  font-weight: 500;
  z-index: 10080;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.agatha-cart-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.agatha-cart-open {
  overflow: hidden;
}

/* Product page: Add to cart button */
.agatha-add-cart-btn {
  width: 100%;
  height: 50px;
  margin-top: 10px;
  margin-bottom: 10px;
  border: 2px solid #1c1c1c;
  border-radius: 0;
  background: #fff;
  font-family: 'Raleway', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #1c1c1c;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.agatha-add-cart-btn:hover {
  background: #1c1c1c;
  color: #fff;
}

.agatha-add-cart-btn.is-in-cart {
  border-color: #00c357;
  color: #00c357;
}

.agatha-add-cart-btn.is-in-cart:hover {
  background: #00c357;
  color: #fff;
}

.product-add__actions {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media screen and (max-width: 767px) {
  .agatha-cart-toggle {
    width: 36px;
    height: 36px;
  }

  .agatha-cart-toggle__icon {
    width: 22px;
    height: 22px;
  }

  .agatha-cart-badge {
    top: 0;
    right: -2px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    line-height: 16px;
  }

  .agatha-cart-panel {
    width: 100vw;
    max-width: 100vw;
  }

  .agatha-cart-panel__head,
  .agatha-cart-panel__body,
  .agatha-cart-panel__foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .agatha-cart-panel__foot {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .agatha-cart-toast {
    left: 16px;
    right: 16px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translateY(20px);
    text-align: center;
  }

  .agatha-cart-toast.is-visible {
    transform: translateY(0);
  }

  header .user-nav__item.agatha-cart-nav {
    margin: 0 !important;
    padding: 0 2px !important;
  }
}
