:root {
  --side-cart-bg: #ffffff;
  --side-cart-text: #173439;
  --side-cart-muted: #6b7b7c;
  --side-cart-accent: #014940;
  --side-cart-accent-soft: #eaf7ee;
  --side-cart-border: #e8efeb;
}

.side-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 20, 15, 0.58);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 999990 !important;
}

.side-cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.side-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 420px;
  background: var(--side-cart-bg);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.16);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 999995 !important;
  display: flex;
  flex-direction: column;
}

.side-cart-drawer.is-open {
  transform: translateX(0);
}

/* Header in #014940 brand color with inline 'Almost Yours' title */
.side-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  background: #014940;
  color: #ffffff;
  border-bottom: 1px solid #013730;
}

.side-cart-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.side-cart-bag-icon-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.side-cart-bag-svg {
  color: #ffffff;
  width: 24px;
  height: 24px;
}

.side-cart-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #014940;
  color: #ffffff;
  border: 1.5px solid #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  line-height: 1;
}

.side-cart-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  color: #ffffff;
  line-height: 1;
  white-space: nowrap;
}

.side-cart-close {
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 1.2rem;
  padding: 4px;
  cursor: pointer;
  box-shadow: none;
}

.side-cart-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.side-cart-items {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.side-cart-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid var(--side-cart-border);
  border-radius: 16px;
  background: #fcfdfc;
}

.side-cart-item-image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  background: #f4f8f6;
}

.side-cart-item-content {
  flex: 1;
  min-width: 0;
}

.side-cart-item-title {
  font-weight: 700;
  color: var(--side-cart-text);
}

.side-cart-item-variant {
  font-size: 0.8rem;
  color: var(--side-cart-muted);
  margin: 0;
}

.side-cart-remove-btn {
  border: 0;
  background: transparent;
  color: #c25252;
  padding: 0;
}

.side-cart-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.side-cart-original-price {
  text-decoration: line-through;
  color: #888888;
  font-size: 0.85rem;
}

.side-cart-item-price {
  font-weight: 700;
  color: var(--side-cart-accent);
}

.side-cart-save-badge {
  display: inline-block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.side-cart-quantity-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--side-cart-border);
  border-radius: 999px;
  padding: 0.2rem;
}

.side-cart-qty-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--side-cart-accent-soft);
  color: var(--side-cart-accent);
  font-size: 1rem;
}

.side-cart-qty-value {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

.side-cart-item-total {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--side-cart-text);
}

.side-cart-progress {
  border: 1px solid var(--side-cart-border);
  border-radius: 16px;
  padding: 0.9rem;
  background: #f8fcfa;
}

.side-cart-progress-text {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--side-cart-muted);
}

.side-cart-progress-text.success {
  color: #16724d;
}

.side-cart-progress-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7efeb;
}

.side-cart-progress-bar.success {
  background: #dff5e8;
}

.side-cart-progress-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #014940, #3aa96d);
}

.side-cart-summary {
  border-top: 1px solid var(--side-cart-border);
  padding: 8px 20px;
  background: var(--side-cart-bg);
}

.side-cart-savings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #166534;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed #d1d5db;
}

.side-cart-savings-row .savings-val {
  color: #166534;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: right;
}

.side-cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.side-cart-summary-row.total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--side-cart-text);
  padding-top: 0.3rem;
}

.side-cart-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.side-cart-empty-icon {
  width: 80px;
  height: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--side-cart-accent-soft);
  color: var(--side-cart-accent);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.side-cart-empty-state h4 {
  margin-bottom: 0.35rem;
  font-weight: 700;
  color: var(--side-cart-text);
}

.side-cart-empty-state p {
  color: var(--side-cart-muted);
  margin-bottom: 1rem;
}

.side-cart-return-btn {
  display: inline-block;
  background: #014940;
  color: #ffffff !important;
  font-weight: 600;
  padding: 0.65rem 1.75rem;
  text-decoration: none !important;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.side-cart-return-btn:hover {
  background: #013730;
}

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

@media (max-width: 767px) {
  .side-cart-drawer {
    max-width: 100%;
  }
}

@media (max-width: 575px) {
  .side-cart-header {
    padding: 1rem;
  }
  .side-cart-body {
    padding: 0.85rem;
  }
  .side-cart-item {
    padding: 0.8rem;
  }
}
