/* Cart & checkout pages — onboarding kit */

body:has(.cart-page) {
  background: #f3f4f6;
  font-family: "Roboto", system-ui, sans-serif;
  color: #0f172a;
}

.cart-page {
  padding: 0 0 64px;
}

.cart-breadcrumb {
  position: relative;
  min-height: 220px;
  margin-bottom: 28px;
  overflow: hidden;
  background:
    linear-gradient(
      100deg,
      rgba(15, 23, 42, 0.88) 0%,
      rgba(15, 23, 42, 0.72) 42%,
      rgba(15, 23, 42, 0.35) 68%,
      rgba(15, 23, 42, 0.15) 100%
    ),
    var(--cart-crumb-image) right center / cover no-repeat;
  border-bottom: 1px solid #e5e7eb;
}

.cart-breadcrumb-inner {
  position: relative;
  z-index: 1;
  padding-top: 28px;
  padding-bottom: 32px;
  color: #fff;
}

.cart-crumb-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 550;
  margin-bottom: 14px;
}

.cart-crumb-nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
}

.cart-crumb-nav a:hover {
  color: #fff;
  text-decoration: underline;
}

.cart-crumb-nav span[aria-current="page"] {
  color: #fff;
  font-weight: 700;
}

.cart-continue {
  display: inline-flex;
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 14px;
  text-decoration: none;
}

.cart-continue:hover {
  text-decoration: underline;
}

.cart-title-row h1 {
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  color: #fff;
  margin-bottom: 4px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.cart-subtitle {
  color: rgba(255, 255, 255, 0.86);
  margin-bottom: 0;
}

.cart-body {
  padding-top: 4px;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 22px;
  align-items: start;
}

.cart-card {
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  margin-bottom: 16px;
}

.cart-card h2 {
  font-size: 1.05rem;
  color: #0f172a;
  margin-bottom: 12px;
}

.cart-rest-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 8px;
}

.cart-rest-head img,
.cart-rest-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.cart-rest-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f9ef;
  font-weight: 700;
  color: #0f172a;
}

.cart-rest-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cart-rest-title strong {
  color: #0f172a;
}

.cart-tag {
  background: #fffbeb;
  color: #f59e0b;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.cart-rest-head p {
  color: #6b7280;
  font-size: 0.82rem;
  margin-top: 2px;
}

.cart-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #e5e7eb;
}

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

.cart-item-media {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  overflow: hidden;
  background: #e8f9ef;
}

.cart-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-media span {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0f172a;
}

.cart-item-body h3 {
  font-size: 1rem;
  color: #0f172a;
  margin-bottom: 4px;
}

.cart-item-body p {
  color: #6b7280;
  font-size: 0.82rem;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-body strong {
  color: #0f172a;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.qty-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8f9ef;
  border-radius: 999px;
  padding: 4px;
}

.qty-pill button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

.qty-pill span {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  color: #0f172a;
}

.cart-remove {
  border: 0;
  background: transparent;
  color: #22c55e;
  cursor: pointer;
  padding: 4px;
}

.cart-add-more {
  margin-top: 8px;
  background: #e8f9ef;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-add-more strong {
  display: block;
  color: #0f172a;
}

.cart-add-more p {
  color: #6b7280;
  font-size: 0.82rem;
}

.cart-notes-card textarea {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
  min-height: 110px;
  background: #ffffff;
}

.cart-notes-count {
  text-align: right;
  color: #6b7280;
  font-size: 0.78rem;
  margin-top: 6px;
}

.cart-aside {
  position: sticky;
  top: 88px;
}

.cart-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.cart-summary-head span {
  color: #6b7280;
  font-size: 0.85rem;
}

.cart-summary-lines {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.cart-summary-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #6b7280;
  font-size: 0.88rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: #6b7280;
  font-size: 0.92rem;
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 700;
}

.cart-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.link-btn {
  border: 0;
  background: transparent;
  color: #f59e0b;
  font-weight: 650;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.cart-address-box {
  background: #e8f9ef;
  border-radius: 12px;
  padding: 12px 14px;
  color: #6b7280;
  font-size: 0.9rem;
}

.cart-address-edit {
  display: grid;
  gap: 10px;
}

.cart-address-edit input,
.checkout-form input[type="text"],
.checkout-form input[type="tel"],
.checkout-layout input[type="text"],
.checkout-layout input[type="tel"] {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
}

.checkout-layout input[type="text"]:focus,
.checkout-layout input[type="tel"]:focus {
  outline: 2px solid rgba(34, 197, 94, 0.28);
  border-color: #22c55e;
}

.cart-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  background: #fff;
}

.cart-option.is-selected {
  border-color: #22c55e;
  background: #e8f9ef;
}

.cart-option input {
  margin-top: 3px;
}

.cart-option strong {
  display: block;
  color: #0f172a;
  font-size: 0.92rem;
}

.cart-option small {
  color: #6b7280;
  font-size: 0.8rem;
}

.cart-fee-note {
  color: #6b7280;
  font-size: 0.78rem;
  line-height: 1.4;
}

.cart-promo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #6b7280;
}

.btn-cart-primary,
.btn-cart-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  font: inherit;
}

.btn-cart-primary {
  background: #22c55e;
  color: #fff !important;
}

.btn-cart-primary:hover {
  background: #16a34a;
}

.btn-cart-outline {
  background: #fff;
  color: #22c55e !important;
  border-color: #22c55e;
}

.btn-checkout {
  width: 100%;
  padding: 14px 18px;
}

.btn-sm {
  padding: 10px 16px;
  width: fit-content;
}

.cart-empty {
  background: #fff;
  border-radius: 20px;
  padding: 48px 24px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.cart-empty h2 {
  color: #0f172a;
  margin-bottom: 8px;
}

.cart-empty p {
  color: #6b7280;
  margin-bottom: 18px;
}

.cart-trust {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.cart-trust li {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.cart-trust strong {
  display: block;
  color: #0f172a;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.cart-trust span {
  color: #6b7280;
  font-size: 0.8rem;
}

.checkout-form {
  display: grid;
  gap: 14px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkout-form label {
  display: grid;
  gap: 6px;
}

.checkout-form label > span {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.88rem;
}

.checkout-form label small {
  font-weight: 500;
  color: #6b7280;
}

.checkout-pay {
  border: 0;
  margin: 8px 0 0;
  padding: 0;
}

.checkout-pay legend {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.checkout-error {
  background: #fdecee;
  color: #16a34a;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.88rem;
}

.checkout-rest {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.checkout-rest strong {
  color: #0f172a;
}

.checkout-rest p {
  color: #6b7280;
  font-size: 0.82rem;
}

.checkout-success {
  max-width: 560px;
  margin: 12px auto 0;
  text-align: center;
  padding: 36px 24px;
}

.checkout-success h2 {
  margin-bottom: 8px;
}

.checkout-order-id {
  margin: 14px 0 20px;
  color: #6b7280;
}

.checkout-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.header-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.header-cart:hover {
  color: #f59e0b;
}

.header-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #22c55e;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.meal-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 120;
}

.meal-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-aside {
    position: static;
  }

  .cart-trust {
    grid-template-columns: 1fr 1fr;
  }

  .checkout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .cart-breadcrumb {
    min-height: 180px;
    background:
      linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.82) 0%,
        rgba(15, 23, 42, 0.55) 55%,
        rgba(15, 23, 42, 0.35) 100%
      ),
      var(--cart-crumb-image) center 35% / cover no-repeat;
  }

  .cart-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .cart-item-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .cart-add-more {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-trust {
    grid-template-columns: 1fr;
  }
}
