/* cart island styles (plan 01, lane W2a). The drawer itself reuses .sheet / .cart-* from style.css;
   these are only the parts the live cart adds: notices, line problems, offers, coupon, free-delivery bar,
   totals, the checkout reason and the secondary WhatsApp link. */

/* Parts toggle with the hidden attribute; style.css gives several of them display:grid/flex. */
.cart [hidden] {
  display: none !important;
}

.cart[aria-busy="true"] .cart-list,
.cart[aria-busy="true"] .cart-totals {
  opacity: 0.6;
  transition: opacity 0.2s var(--ease);
}

.cart-notice {
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--r-md);
  background: var(--panel-2);
  color: var(--tx);
  font-size: 0.84rem;
  line-height: 1.45;
}
.cart-notice.is-error {
  background: rgba(193, 20, 16, 0.08);
  color: var(--brick);
}

.cart-line.has-problem .cart-thumb img {
  opacity: 0.55;
  filter: grayscale(0.6);
}
.cart-info p.cart-problem {
  color: var(--brick);
  font-weight: 700;
  font-size: 0.78rem;
}
.cart-info p {
  color: var(--tx-2);
}
.cart-mrp {
  font-size: 0.78rem;
  color: var(--tx-2);
}
.qty button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cart-offers {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}
.cart-offers li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: #245c1f;
  padding: 0.55rem 0.8rem;
  border-radius: var(--r-md);
  background: rgba(46, 107, 59, 0.08);
}
.cart-offers li strong {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.cart-offers .ic {
  width: 16px;
  height: 16px;
  flex: none;
}

.cart-coupon {
  margin-top: 1.1rem;
}
.cart-coupon-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.cart-coupon-row input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
}
.cart-coupon-row .btn {
  padding: 0.7rem 1.1rem;
  flex: none;
}
.cart-coupon-on {
  justify-content: space-between;
}
.cart-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-pill);
  background: var(--panel-2);
  border: 1px dashed var(--line-2);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.cart-link {
  border: 0;
  background: transparent;
  padding: 0.2rem;
  cursor: pointer;
  color: var(--tx-2);
  font: inherit;
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cart-link:hover {
  color: var(--tx);
}
.cart-coupon-msg {
  font-size: 0.8rem;
  color: #245c1f;
  min-height: 1.2em;
}
.cart-coupon-msg:empty {
  min-height: 0;
}
.cart-coupon-msg.is-error {
  color: var(--brick);
}

.cart-gap {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--tx);
}
.cart-gap-bar {
  display: block;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--panel-2);
  overflow: hidden;
}
.cart-gap-bar span {
  display: block;
  height: 100%;
  background: var(--flame);
  border-radius: inherit;
  transition: width 0.4s var(--ease);
}

.cart-pincode {
  margin-top: 1.1rem;
  padding-bottom: 1.2rem;
}
.cart-pincode:empty {
  display: none;
}

.cart-totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 1rem;
  font-size: 0.86rem;
  color: var(--tx-2);
  font-variant-numeric: tabular-nums;
}
.cart-totals dd {
  text-align: right;
  color: var(--tx);
}
.cart-totals .is-saving {
  color: #245c1f;
}
.cart-totals .is-total {
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  font-weight: 700;
  color: var(--tx);
}
.cart-totals dd.is-total {
  font-size: 1.35rem;
  color: var(--maroon);
}

.cart-blockers {
  font-size: 0.8rem;
  color: var(--brick);
  line-height: 1.45;
}
.cart-checkout .btn {
  justify-content: center;
  width: 100%;
}
.cart-checkout .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.cart-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--tx-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cart-wa:hover {
  color: var(--tx);
}
.cart-wa .ic {
  width: 15px;
  height: 15px;
}
.cart .cart-note {
  color: var(--tx-2);
}

/* The island builds the drawer at load (the old one was built on first open): keep it out of the
   accessibility tree and tab order while closed, without cutting the slide-out short. */
.sheet.cart:not(.open) {
  visibility: hidden;
  transition:
    transform 0.55s var(--ease),
    visibility 0s linear 0.55s;
}
.sheet.cart.open {
  visibility: visible;
}
