.flow-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-header-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 12px;
  color: #171715;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.flow-header-link:hover {
  border-color: rgba(17, 17, 17, 0.3);
  background: #f7f7f4;
}

.flow-header-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.cart-page,
.checkout-page-form-only {
  padding-top: 24px;
  padding-bottom: 56px;
}

.flow-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 24px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.09);
}

.flow-hero h1 {
  margin: 0 0 7px;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.flow-hero p {
  max-width: 640px;
  margin: 0;
  color: #71716d;
  line-height: 1.5;
}

.flow-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cart-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 16px;
}

.cart-search {
  display: grid;
  flex: 1 1 auto;
  gap: 7px;
  max-width: 620px;
}

.cart-search span {
  color: #555550;
  font-size: 13px;
  font-weight: 750;
}

.cart-search input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid #deded9;
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

.cart-search input:focus {
  outline: 3px solid rgba(17, 17, 17, 0.08);
  border-color: #111;
}

.cart-toolbar-meta {
  display: flex;
  gap: 12px;
  color: #777773;
  font-size: 13px;
}

.cart-layout,
.checkout-order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.cart-list-panel,
.cart-summary,
.checkout-form-card {
  border: 1px solid #e4e4df;
  background: #fff;
  box-shadow: 0 12px 34px rgba(17, 17, 17, 0.05);
}

.cart-list-panel {
  padding: 16px;
  border-radius: 18px;
}

.cart-items {
  display: grid;
  gap: 12px;
}

.cart-empty {
  display: none;
  padding: 34px 20px;
  border: 1px dashed #d5d5cf;
  border-radius: 14px;
  color: #71716d;
  text-align: center;
}

.cart-empty.show {
  display: block;
}

.cart-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e9e9e5;
  border-radius: 14px;
}

.cart-item-image {
  display: block;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border: 1px solid #ededE9;
  border-radius: 10px;
  background: #fff;
}

.cart-item-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cart-item-body {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.cart-item-title {
  color: #171715;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.cart-item-meta,
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cart-item-meta {
  color: #777773;
  font-size: 12px;
}

.cart-qty-control {
  display: inline-grid;
  grid-template-columns: 36px 44px 36px;
  min-height: 38px;
  overflow: hidden;
  border: 1px solid #dcdcd7;
  border-radius: 10px;
}

.cart-qty-btn,
.cart-qty-input,
.cart-remove-btn {
  border: 0;
  background: #fff;
  font: inherit;
}

.cart-qty-btn {
  cursor: pointer;
  font-size: 18px;
}

.cart-qty-btn:hover {
  background: #f2f2ef;
}

.cart-qty-input {
  min-width: 0;
  width: 44px;
  border-right: 1px solid #e4e4df;
  border-left: 1px solid #e4e4df;
  text-align: center;
  -moz-appearance: textfield;
}

.cart-qty-input::-webkit-inner-spin-button,
.cart-qty-input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.cart-remove-btn {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #deded9;
  border-radius: 10px;
  color: #a62d2d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.cart-item-price {
  display: grid;
  min-width: 125px;
  gap: 4px;
  text-align: right;
}

.cart-item-price .unit {
  color: #777773;
  font-size: 12px;
}

.cart-item-price strong {
  font-size: 18px;
}

.cart-summary {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 18px;
}

.summary-title {
  font-size: 20px;
  font-weight: 850;
}

.summary-line,
.summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-line {
  color: #666662;
  font-size: 14px;
}

.summary-total {
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid #e8e8e3;
  font-size: 19px;
  font-weight: 850;
}

.cart-checkout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 12px;
  background: #111;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.cart-checkout-link[aria-disabled="true"] {
  pointer-events: none;
  background: #c9c9c5;
}

.checkout-order-layout {
  margin-top: 22px;
  grid-template-columns: minmax(0, 1fr) 300px;
}

.checkout-page-form-only .checkout-details {
  min-width: 0;
  margin: 0;
}

.checkout-page-form-only .checkout-form-card {
  max-width: none;
  margin: 0;
}

.checkout-order-summary {
  gap: 12px;
}

.checkout-order-preview {
  display: grid;
  gap: 10px;
  max-height: 300px;
  overflow: auto;
  padding-right: 3px;
}

.checkout-preview-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #eeeeea;
}

.checkout-preview-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid #eeeeea;
  border-radius: 8px;
}

.checkout-preview-item div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.checkout-preview-item strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkout-preview-item span {
  color: #73736f;
  font-size: 11px;
}

.checkout-back-to-cart {
  color: #333330;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.delivery-schedule {
  display: grid;
  gap: 14px;
  margin-top: 2px;
  padding: 16px;
  border: 1px solid #e2e2de;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.05);
}

.delivery-schedule[hidden] {
  display: none;
}

.delivery-schedule-heading {
  display: grid;
  gap: 3px;
}

.delivery-schedule-heading strong {
  color: #333330;
  font-size: 15px;
}

.delivery-schedule-heading span {
  color: #777773;
  font-size: 12px;
}

.delivery-choice-group {
  display: grid;
  gap: 8px;
}

.delivery-choice-label {
  color: #646460;
  font-size: 12px;
  font-weight: 700;
}

.delivery-date-options,
.delivery-time-options {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 7px;
  scrollbar-width: thin;
}

.delivery-date-choice,
.delivery-time-choice {
  flex: 0 0 auto;
  min-height: 50px;
  border: 1px solid #deded9;
  border-radius: 11px;
  background: #f8f8f5;
  color: #3f3f3b;
  cursor: pointer;
  font: inherit;
}

.delivery-date-choice {
  display: grid;
  min-width: 102px;
  gap: 2px;
  padding: 9px 12px;
  text-align: left;
}

.delivery-date-choice strong {
  font-size: 13px;
}

.delivery-date-choice span {
  color: #777773;
  font-size: 11px;
}

.delivery-time-choice {
  min-width: 105px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 750;
}

.delivery-date-choice.is-selected,
.delivery-time-choice.is-selected {
  border-color: #111;
  background: #111;
  color: #fff;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.16);
}

.delivery-date-choice.is-selected span {
  color: rgba(255, 255, 255, 0.72);
}

.delivery-date-choice:focus-visible,
.delivery-time-choice:focus-visible {
  outline: 3px solid rgba(17, 17, 17, 0.18);
  outline-offset: 2px;
}

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

  .cart-summary {
    position: static;
  }

  .checkout-order-summary {
    grid-row: 1;
  }
}

@media (max-width: 700px) {
  .flow-header-actions {
    display: none;
  }

  .cart-page,
  .checkout-page-form-only {
    padding-top: 10px;
    padding-bottom: 92px;
  }

  .flow-hero {
    align-items: flex-start;
    padding: 14px 0 18px;
  }

  .flow-hero p {
    display: none;
  }

  .flow-hero h1 {
    font-size: 29px;
  }

  .cart-toolbar {
    align-items: stretch;
    flex-direction: column;
    margin-top: 16px;
  }

  .cart-search {
    max-width: none;
  }

  .cart-toolbar-meta {
    justify-content: space-between;
  }

  .cart-list-panel {
    padding: 9px;
    border-radius: 14px;
    box-shadow: none;
  }

  .cart-item {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 11px;
    padding: 10px;
  }

  .cart-item-image {
    width: 76px;
    height: 76px;
  }

  .cart-item-price {
    grid-column: 2;
    min-width: 0;
    text-align: left;
  }

  .cart-item-price .unit {
    display: none;
  }

  .cart-item-controls {
    align-items: stretch;
  }

  .checkout-order-summary {
    grid-row: auto;
  }

  .checkout-order-preview {
    max-height: 180px;
  }

  .delivery-schedule {
    margin-right: -2px;
    margin-left: -2px;
    padding: 13px;
  }
}
