/* ==========================================================================
   TheCBD Design System — Cart Item Row & Slide-Over Drawer (Figma 7564:13903)
   ========================================================================== */

.cbd-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.cbd-cart-item__main {
  display: flex;
  align-items: center;
  gap: 31px;
  flex: 1 1 auto;
  min-width: 0;
}

.cbd-cart-item__media {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 4.167px;
  background: var(--color-bg-surface, #fafbf8);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
}

.cbd-cart-item__media img {
  width: 100%;
  height: 93.75px;
  object-fit: contain;
}

.cbd-cart-item__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 371px;
}

.cbd-cart-item__header {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cbd-cart-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cbd-cart-item__brand {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--color-text-secondary, #5b685f);
  white-space: nowrap;
}

.cbd-cart-item__rating {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-brand-primary, #317627);
  white-space: nowrap;
}

.cbd-cart-item__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text-primary, #202c25);
}

.cbd-cart-item__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast, 150ms ease);
}

.cbd-cart-item__title a:hover {
  color: var(--color-brand-primary, #317627);
}

.cbd-cart-item__meta {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--color-text-secondary, #5b685f);
}

.cbd-cart-item__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cbd-cart-item__prices {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cbd-cart-item__price {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-primary, #202c25);
  white-space: nowrap;
}

.cbd-cart-item__old-price {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-text-secondary, #5b685f);
  text-decoration: line-through;
  white-space: nowrap;
}

.cbd-cart-item__sale-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-pill, 999px);
  background: var(--color-card-beige, #f3eee3);
  color: var(--color-brand-primary, #317627);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
  white-space: nowrap;
}

.cbd-cart-item .cbd-cashback-wrap {
  flex-shrink: 0;
}

.cbd-cart-item .cbd-cashback-btn {
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.55;
}

.cbd-cart-item .cbd-cashback-btn img {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.cbd-cart-item__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 132px;
  flex-shrink: 0;
}

.cbd-cart-stepper {
  display: inline-flex;
  align-items: center;
  gap: 13px;
}

.cbd-cart-stepper__btn {
  width: 31px;
  height: 31px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast, 150ms ease), opacity var(--transition-fast, 150ms ease);
}

.cbd-cart-stepper__btn:hover {
  transform: scale(1.05);
}

.cbd-cart-stepper__btn:active {
  transform: scale(0.96);
}

.cbd-cart-stepper__btn img {
  width: 31px;
  height: 31px;
  max-width: none;
  display: block;
}

.cbd-cart-stepper__btn--plus img,
.cbd-cart-stepper__btn[data-cart-minus] img[src*="active"] {
  width: 33px;
  height: 33px;
}

.cbd-cart-stepper__qty {
  min-width: 14px;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  color: #000000;
}

.cbd-cart-item__remove {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity var(--transition-fast, 150ms ease), transform var(--transition-fast, 150ms ease);
}

.cbd-cart-item__remove:hover {
  opacity: 1;
  transform: scale(1.08);
}

.cbd-cart-item__remove img {
  width: 24px;
  height: 24px;
}

/* Empty cart state (shared by drawer & page) */
.cbd-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: 14px;
}

.cbd-cart-empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-brand-soft, #e6efe2);
  color: var(--color-brand-primary, #317627);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cbd-cart-empty__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary, #202c25);
}

.cbd-cart-empty__text {
  margin: 0;
  max-width: 340px;
  font-size: 14px;
  color: var(--color-text-secondary, #5b685f);
  line-height: 1.5;
}

.cbd-cart-empty__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px;
  border-radius: 12px;
  background: var(--color-brand-accent, #3f892c);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 6px;
  transition: background var(--transition-fast, 150ms ease);
}

.cbd-cart-empty__cta:hover {
  background: var(--color-brand-primary-hover, #275f1f);
}

/* ==========================================================================
   Slide-Over Cart Drawer (Figma 7564:13903 / 7564:15241)
   ========================================================================== */

body.cbd-drawer-open {
  overflow: hidden;
}

.cbd-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.cbd-drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.cbd-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 750px;
  max-width: 100vw;
  background: #ffffff;
  border-radius: 20px 0 0 20px;
  padding: 35px 31px 32px;
  z-index: 1201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), visibility 240ms ease;
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.14);
}

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

.cbd-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  margin-bottom: clamp(24px, 4.5vh, 54px);
}

.cbd-drawer__head-left {
  display: flex;
  align-items: baseline;
  gap: 38px;
}

.cbd-drawer__title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  color: #000000;
}

.cbd-drawer__count {
  font-size: 14px;
  font-weight: 500;
  line-height: 28px;
  color: #7c7c7c;
}

.cbd-drawer__close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity var(--transition-fast, 150ms ease), transform var(--transition-fast, 150ms ease);
}

.cbd-drawer__close:hover {
  opacity: 0.8;
  transform: scale(1.06);
}

.cbd-drawer__close img {
  width: 32px;
  height: 32px;
}

.cbd-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 31px;
  padding-right: 4px;
  min-height: 120px;
}

.cbd-drawer__body::-webkit-scrollbar {
  width: 4px;
}

.cbd-drawer__body::-webkit-scrollbar-thumb {
  background: rgba(32, 44, 37, 0.18);
  border-radius: 999px;
}

.cbd-drawer__footer {
  flex-shrink: 0;
  border-top: 1px solid #d9d9d9;
  margin-top: clamp(20px, 3vh, 48px);
  padding-top: clamp(20px, 3vh, 42px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.cbd-drawer__summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cbd-drawer-promo-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cbd-drawer-promo {
  width: 253px;
  height: 50px;
  border: 1px dashed #000000;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: #ffffff;
  transition: border-color var(--transition-fast, 150ms ease);
}

.cbd-drawer-promo:focus-within {
  border-color: var(--color-brand-accent, #3f892c);
}

.cbd-drawer-promo img {
  width: 24px;
  height: 14px;
  flex-shrink: 0;
}

.cbd-drawer-promo input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: #000000;
  text-transform: uppercase;
}

.cbd-drawer-promo input::placeholder {
  color: #797979;
  text-transform: uppercase;
}

.cbd-drawer-promo__apply {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--color-brand-accent, #3f892c);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.cbd-drawer-promo__msg {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-brand-primary, #317627);
  min-height: 14px;
}

.cbd-drawer-promo__msg.is-error {
  color: var(--color-danger, #d63b3b);
}

.cbd-drawer-totals {
  display: flex;
  align-items: flex-start;
  gap: 44px;
  margin-left: auto;
}

.cbd-drawer-total-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cbd-drawer-total-col--right {
  text-align: right;
  align-items: flex-end;
}

.cbd-drawer-total-col__label {
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: #797979;
  text-transform: uppercase;
  white-space: nowrap;
}

.cbd-drawer-total-col__val {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  color: #000000;
  white-space: nowrap;
}

.cbd-drawer-total-col__val--green {
  color: var(--color-brand-accent, #3f892c);
}

.cbd-drawer__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.cbd-drawer-btn {
  height: 60px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 28px;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast, 150ms ease), color var(--transition-fast, 150ms ease), border-color var(--transition-fast, 150ms ease);
}

.cbd-drawer-btn--primary {
  background: var(--color-brand-accent, #3f892c);
  border: 1px solid var(--color-brand-accent, #3f892c);
  color: #ffffff;
}

.cbd-drawer-btn--primary:hover {
  background: var(--color-brand-primary-hover, #275f1f);
  border-color: var(--color-brand-primary-hover, #275f1f);
}

.cbd-drawer-btn--primary.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.cbd-drawer-btn--outline {
  background: #ffffff;
  border: 1px solid #000000;
  color: #000000;
}

.cbd-drawer-btn--outline:hover {
  background: #fafbf8;
}

/* Mobile responsiveness for Cart Item & Drawer */
@media (max-width: 767px) {
  .cbd-drawer-panel {
    left: 0;
    right: 0;
    width: auto;
    max-width: 100%;
    border-radius: 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .cbd-drawer__head {
    margin-bottom: 20px;
  }

  .cbd-drawer__head-left {
    gap: 14px;
  }

  .cbd-drawer__title {
    font-size: 22px;
  }

  .cbd-drawer__body {
    gap: 20px;
  }

  .cbd-cart-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f2ef;
  }

  .cbd-cart-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .cbd-cart-item__main {
    gap: 14px;
    align-items: flex-start;
  }

  .cbd-cart-item__media {
    width: 76px;
    height: 76px;
  }

  .cbd-cart-item__media img {
    height: 70px;
  }

  .cbd-cart-item__info {
    max-width: none;
  }

  .cbd-cart-item__price {
    font-size: 18px;
  }

  .cbd-cart-item__controls {
    width: 100%;
    padding-left: 90px;
  }

  .cbd-drawer__footer {
    margin-top: 16px;
    padding-top: 16px;
    gap: 14px;
  }

  .cbd-drawer__summary-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .cbd-drawer-promo {
    width: 100%;
    height: 44px;
  }

  .cbd-drawer-totals {
    margin-left: 0;
    justify-content: space-between;
    gap: 16px;
  }

  .cbd-drawer-total-col__val {
    font-size: 22px;
  }

  .cbd-drawer__actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cbd-drawer-btn {
    height: 48px;
    font-size: 14px;
  }
}
