/**
 * Task10 — Shopping Cart (Make → OpenCart).
 * @intent: 2-col layout, green banner, summary sidebar, card line items; scoped to #checkout-cart.
 * @see: Figma Make KG1ISsnSHrA5vLUPpao3Vf Task10.tsx
 */

#checkout-cart.f2p-cart-page-wrap {
  padding-bottom: 48px;
}

/* Dark green page banner — mockup */
.f2p-cart-page__banner {
  display: flex;
  align-items: center;
  margin: 0 0 20px;
  padding: 16px 22px;
  background: var(--color-action-primary, #1b3f2d);
  border-radius: 14px;
  color: #fff;
}

.f2p-cart-page__banner-title {
  margin: 0;
  font-family: var(--font-heading, inherit);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: #fff;
}

.f2p-cart-page__banner-count {
  font-weight: 400;
  opacity: 0.92;
}

.f2p-cart-page__continue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-action-primary, #184e3b);
  text-decoration: none;
  white-space: nowrap;
}

.f2p-cart-page__continue:hover,
.f2p-cart-page__continue:focus {
  color: var(--color-action-primary-hover, #123d2e);
  text-decoration: underline;
}

.f2p-cart-page__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.f2p-cart-page__main-col {
  min-width: 0;
}

.f2p-cart-page__sidebar {
  position: sticky;
  top: 96px;
}

/* Card line items */
#checkout-cart .f2p-cart-page__items {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

#checkout-cart .f2p-cart-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--color-border, #e2e8e5);
  border-radius: 16px;
  box-shadow: none;
}

#checkout-cart .f2p-cart-card--unavail {
  border-color: #fecaca;
  opacity: 0.92;
}

#checkout-cart .f2p-cart-page__thumb img,
#checkout-cart .f2p-cart-page__thumb-ph {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: none;
  object-fit: cover;
  background: #eef0ee;
}

#checkout-cart .f2p-cart-page__thumb-ph {
  background: #e8ebe9;
}

.f2p-cart-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.f2p-cart-card__info {
  flex: 1;
  min-width: 0;
}

#checkout-cart .f2p-cart-page__name {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

#checkout-cart .f2p-cart-page__name a {
  color: var(--color-text-primary, #1a1a1a) !important;
  text-decoration: none;
}

.f2p-cart-card__unit-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fde8d2;
  color: #c45f12;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.f2p-cart-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.f2p-cart-card__oos {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-feedback-error, #d92d20);
}

.f2p-cart-card__est-label {
  display: block;
  font-size: 10px;
  color: var(--color-text-muted, #98a39e);
  margin-bottom: 2px;
  text-align: right;
}

#checkout-cart .f2p-cart-page__options {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--color-text-secondary, #66736d);
}

#checkout-cart .f2p-cart-page__pricing {
  flex-shrink: 0;
  min-width: 88px;
  text-align: right;
}

#checkout-cart .f2p-cart-page__price-old {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 500;
  color: #9aa39e;
  text-decoration: line-through;
}

#checkout-cart .f2p-cart-page__total {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary, #1a1a1a);
  white-space: nowrap;
}

#checkout-cart .f2p-cart-page__qty-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 0;
  border-top: none;
  min-width: 0;
}

#checkout-cart .f2p-cart-qty--compact {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 4px 6px;
  background: #eef0ee;
  border-radius: 999px;
}

#checkout-cart .f2p-cart-qty--compact .f2p-cart-qty__btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-primary, #1a1a1a);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

#checkout-cart .f2p-cart-qty--compact .f2p-cart-qty__btn:hover,
#checkout-cart .f2p-cart-qty--compact .f2p-cart-qty__btn:focus {
  background: rgba(0, 0, 0, 0.06);
}

#checkout-cart .f2p-cart-qty--compact .f2p-cart-qty__input {
  width: 36px;
  min-width: 28px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary, #1a1a1a);
}

#checkout-cart .f2p-cart-qty--compact .f2p-cart-qty__unit {
  margin-right: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary, #66736d);
  white-space: nowrap;
}

#checkout-cart .f2p-cart-page__remove {
  flex: 0 0 auto;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #c45b5b !important;
  text-decoration: none !important;
}

#checkout-cart .f2p-cart-page__remove:hover,
#checkout-cart .f2p-cart-page__remove:focus {
  color: #a33f3f !important;
}

#checkout-cart .f2p-cart-line-vw-note {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: var(--color-text-muted, #98a39e);
}

/* Order summary sidebar */
.f2p-cart-summary {
  background: #fff;
  border: 1px solid var(--color-border, #e2e8e5);
  border-radius: 16px;
  overflow: hidden;
}

.f2p-cart-summary__head {
  padding: 16px 20px;
  background: var(--color-action-primary, #1b3f2d);
  border-bottom: none;
}

.f2p-cart-summary__title {
  margin: 0;
  font-family: var(--font-heading, inherit);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.f2p-cart-summary__body {
  padding: 18px 20px 8px;
}

.f2p-cart-summary__totals {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  gap: 12px;
}

#checkout-cart .f2p-order-review__total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

#checkout-cart .f2p-order-review__total-label {
  color: var(--color-text-primary, #1a1a1a);
  font-weight: 500;
}

#checkout-cart .f2p-order-review__total-value {
  font-weight: 600;
  color: var(--color-text-primary, #1a1a1a);
  text-align: right;
}

#checkout-cart .f2p-order-review__total-row--grand {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border, #e2e8e5);
}

#checkout-cart .f2p-order-review__total-row--grand .f2p-order-review__total-label,
#checkout-cart .f2p-order-review__total-row--grand .f2p-order-review__total-value {
  font-size: 16px;
  font-weight: 700;
}

.f2p-cart-summary__delivery-val {
  font-weight: 500 !important;
  color: var(--color-text-secondary, #8a948e) !important;
  font-size: 13px !important;
}

.f2p-cart-summary__vw-foot {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.4;
  color: var(--color-text-muted, #98a39e);
}

/* Promo block */
.f2p-cart-promo {
  padding: 8px 20px 16px;
}

.f2p-cart-promo__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary, #66736d);
  margin-bottom: 8px;
}

.f2p-cart-promo__row {
  display: flex;
  gap: 8px;
}

.f2p-cart-promo__field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 42px;
  border: 1px solid var(--color-border, #e2e8e5);
  border-radius: 12px;
  background: #f6f7f6;
}

.f2p-cart-promo--disabled .f2p-cart-promo__field {
  opacity: 0.9;
}

.f2p-cart-promo__icon {
  color: var(--color-text-muted, #98a39e);
  font-size: 13px;
}

.f2p-cart-promo__input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12px;
  outline: none;
  min-width: 0;
  color: var(--color-text-primary, #1d2923);
}

.f2p-cart-promo__apply {
  flex-shrink: 0;
  padding: 10px 16px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  min-height: 42px;
  background: var(--color-accent, #f68b1f) !important;
  border-color: var(--color-accent, #f68b1f) !important;
  color: #fff !important;
}

.f2p-cart-promo__apply:disabled {
  opacity: 0.85;
  cursor: not-allowed;
}

.f2p-cart-promo__hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--color-text-muted, #98a39e);
  line-height: 1.35;
}

.f2p-cart-summary__delivery-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px 16px;
  padding: 12px 14px;
  border-radius: 999px;
  background: #e8f3ec;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary, #1d2923);
}

.f2p-cart-summary__delivery-note .fa {
  color: var(--color-action-primary, #184e3b);
}

.f2p-cart-summary__checkout {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 40px);
  margin: 0 20px 20px;
  padding: 14px 16px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 14px !important;
  min-height: 52px;
}

.f2p-btn--accent,
#checkout-cart .f2p-btn--accent {
  background: var(--color-accent, #f68b1f) !important;
  border-color: var(--color-accent, #f68b1f) !important;
  color: #fff !important;
}

.f2p-btn--accent:hover,
.f2p-btn--accent:focus {
  background: #e07d15 !important;
  border-color: #e07d15 !important;
  color: #fff !important;
}

/* Empty cart + popular */
.f2p-empty-state--cart-full {
  max-width: 960px;
  margin: 48px auto 32px;
}

.f2p-empty-state__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.f2p-cart-empty-hits {
  text-align: left;
  margin-top: 8px;
}

.f2p-cart-empty-hits__title {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary, #1d2923);
}

.f2p-cart-empty-hits__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.f2p-cart-empty-hits__card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border, #e2e8e5);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.f2p-cart-empty-hits__thumb {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: var(--color-surface-brand-sub, #eef5f1);
}

.f2p-cart-empty-hits__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.f2p-cart-empty-hits__thumb .f2p-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
}

.f2p-cart-empty-hits__body {
  position: relative;
  padding: 12px 44px 12px 12px;
  flex: 1;
}

.f2p-cart-empty-hits__name {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.f2p-cart-empty-hits__name a {
  color: var(--color-text-primary, #1d2923);
  text-decoration: none;
}

.f2p-cart-empty-hits__price {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.f2p-cart-empty-hits__add {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 991px) {
  .f2p-cart-page__layout {
    grid-template-columns: 1fr;
  }

  .f2p-cart-page__sidebar {
    position: static;
    order: 2;
  }

  .f2p-cart-empty-hits__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #checkout-cart .f2p-cart-card {
    grid-template-columns: 64px 1fr;
    padding: 14px;
  }

  #checkout-cart .f2p-cart-page__thumb img,
  #checkout-cart .f2p-cart-page__thumb-ph {
    width: 64px;
    height: 64px;
  }

  .f2p-cart-card__head {
    flex-direction: column;
    gap: 8px;
  }

  #checkout-cart .f2p-cart-page__pricing {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  #checkout-cart .f2p-cart-page__price-old {
    margin-bottom: 0;
  }

  .f2p-cart-promo__row {
    flex-direction: column;
  }

  .f2p-cart-promo__apply {
    width: 100%;
  }

  .f2p-cart-empty-hits__grid {
    grid-template-columns: 1fr 1fr;
  }
}
