/*-- -------------------------- -->
<---       Cart Toggle          -->
<--- -------------------------- -*/
@keyframes cart-bounce {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.22);
  }
  70% {
    transform: scale(0.93);
  }
  100% {
    transform: scale(1);
  }
}
/* Shared — all breakpoints */
#cart-toggle {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(2.75rem, 6vw, 3rem);
  height: clamp(2.75rem, 6vw, 3rem);
  padding: 0;
  flex-shrink: 0;
  /* Cart bag icon */
  gap: 0.375rem;
}
#cart-toggle:before {
  content: '';
  display: block;
  width: 22px;
  height: 22px;
  background-color: var(--headerColor);
  mask-image: url("/assets/images/cart.svg");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("/assets/images/cart.svg");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  transition: background-color 0.3s;
}
#cart-toggle.cart-bounce {
  animation: cart-bounce 0.4s ease forwards;
}
#cart-toggle.has-items {
  background-color: var(--o2grey);
  border-radius: 6px;
}
#cart-toggle .cs-cart-label {
  display: none;
}
#cart-toggle:hover:before {
  background-color: #555;
}
#cart-toggle #cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  background: var(--primary);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  font-family: 'Outfit', Arial, sans-serif;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
/* Mobile — visible next to hamburger */
@media only screen and (max-width: 1023.5px) {
  #cart-toggle {
    order: 2;
    margin: 0;
  }
}
/* Desktop — inline in nav row, after Contact */
@media only screen and (min-width: 1024px) {
  #cart-toggle {
    margin: 0;
    width: auto;
    padding: 0 0.5rem;
  }
  #cart-toggle #cart-count {
    display: none;
  }
  #cart-toggle .cs-cart-label {
    display: inline;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bodyTextColor);
    font-family: 'Outfit', Arial, sans-serif;
    white-space: nowrap;
    transition: color 0.3s;
  }
  #cart-toggle.has-items .cs-cart-label {
    color: var(--headerColor);
  }
}
/*-- -------------------------- -->
<---       Cart Drawer          -->
<--- -------------------------- -*/
#cart-drawer {
  visibility: hidden;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  transition: visibility 0s linear 0.3s;
}
#cart-drawer.open {
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s;
}
#cart-drawer.open #cart-overlay {
  opacity: 1;
}
#cart-drawer.open #cart-panel {
  transform: translateX(0);
}
#cart-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
#cart-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}
#cart-panel header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--headerColor);
}
#cart-panel footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}
#cart-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  color: var(--headerColor);
  line-height: 1;
}
#cart-close-btn:hover {
  color: #555;
}
#cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cart-empty {
  color: var(--bodyTextColor);
  text-align: center;
  padding: 2rem 0;
  font-size: 0.9375rem;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 4px;
}
.cart-item .cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.cart-item .cart-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--headerColor);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item .cart-item-price {
  font-size: 0.875rem;
  color: var(--bodyTextColor);
}
.cart-item .cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cart-item .cart-item-qty span {
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 1.25rem;
  text-align: center;
}
.cart-item .cart-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 0.875rem;
  padding: 0.25rem;
  flex-shrink: 0;
}
.cart-item .cart-remove-btn:hover {
  color: var(--headerColor);
}
.qty-btn {
  background: none;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border-radius: 2px;
  line-height: 1;
}
.qty-btn:hover {
  background: #f5f5f5;
}
#cart-total {
  font-size: 1rem;
  color: var(--headerColor);
  text-align: right;
}
#cart-checkout-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Outfit', Arial, sans-serif;
  transition: opacity 0.2s;
}
#cart-checkout-btn:hover {
  opacity: 0.85;
}
#cart-checkout-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
/*-- -------------------------- -->
<---       Stock States         -->
<--- -------------------------- -*/
/* Add-to-cart and subscribe buttons when product is out of stock */
[data-add-to-cart].cs-out-of-stock,
[data-subscribe].cs-out-of-stock {
  background: #e0e0e0;
  color: #888;
  border-color: #e0e0e0;
  cursor: not-allowed;
  opacity: 1;
}
/* "Only N left in stock!" warning above the button group */
.cs-stock-warning {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #c0392b;
}
/* Cart conflict notice — out of stock due to cart contents */
.cs-stock-conflict {
  font-size: 0.8125rem;
  color: var(--bodyTextColor);
  margin: 0.75rem 0 0;
  line-height: 1.5;
}
.cs-conflict-remove {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  font-weight: 700;
  color: #c0392b;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cs-conflict-remove:hover {
  color: #962d22;
}
/* "Max available: N" message below button group */
.cs-qty-max-msg {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #c0392b;
  margin: 0.625rem 0 0;
  display: block;
  width: 100%;
}
/* Cart drawer stock limit notice */
@keyframes cart-notice-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#cart-notice {
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: 'Outfit', Arial, sans-serif;
  color: #c0392b;
  background: #fdf0ef;
  border-left: 3px solid #c0392b;
  margin: 0 1.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0 3px 3px 0;
  min-height: 0;
  animation: cart-notice-in 0.2s ease forwards;
}
#cart-notice:empty {
  display: none;
}
