.order-card {
  border: 1px solid #d9c6b7;
  border-radius: 16px;
  padding: 22px;
  margin: 20px 0;
  background: #fff;
  color: #3e2418;
  overflow-wrap: anywhere;
}
.order-card h3 {
  font-size: 1.05rem;
  margin-top: 0;
}
.order-card li {
  margin: 10px 0;
}
.order-card ul {
  padding-left: 20px;
}
.order-card form {
  margin-top: 18px;
}
.order-card select {
  display: block;
  max-width: 100%;
  padding: 12px;
  margin: 8px 0;
}
.order-actions,
.order-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.order-actions a {
  padding: 8px 0;
}
.order-pages {
  margin: 20px 0;
}
#order-notification:not(:empty) {
  padding: 16px;
  background: #fff0d4;
  border: 1px solid #c79343;
  border-radius: 10px;
}
#orders {
  margin-top: 30px;
}
#cart input {
  box-sizing: border-box;
  width: 100%;
  padding: 12px;
  margin: 10px 0;
}
@media (max-width: 600px) {
  .order-card {
    padding: 14px;
  }
  .order-card button {
    width: 100%;
  }
  .order-pages button {
    flex: 1;
  }
  main {
    min-width: 0;
  }
}
#cart {
  box-sizing: border-box;
  width: min(960px, calc(100% - 40px));
  max-width: 960px;
  max-height: calc(100dvh - 40px);
  padding: 30px;
  border: 1px solid #e2d1c3;
  border-radius: 24px;
  box-shadow: 0 32px 100px #20100955;
  overflow: auto;
  overscroll-behavior: contain;
}
#cart .cart-head {
  gap: 20px;
  position: sticky;
  top: -30px;
  background: var(--cream);
  z-index: 1;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--line);
}
#cart .cart-head h2 {
  font-size: clamp(26px, 4vw, 36px);
  margin: 0;
  line-height: 1.2;
}
#cart #close-cart {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  padding: 0;
  cursor: pointer;
}
#cart .cart-intro {
  max-width: 70ch;
  font-size: 14px;
  line-height: 1.65;
  margin: 18px 0 26px;
  color: #705c50;
}
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
#cart h3 {
  font-size: 18px;
  margin: 0 0 18px;
}
.cart-selection {
  min-width: 0;
}
#cart .cart-row {
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 0;
}
#cart .cart-row > div:first-child {
  flex: 1 1 150px;
  min-width: 0;
  overflow-wrap: anywhere;
}
#cart .cart-row strong {
  font-size: 15px;
  line-height: 1.4;
}
#cart .cart-row p {
  font-size: 13px;
  margin: 7px 0 0;
  color: #705c50;
}
#cart .quantity {
  flex: 0 0 auto;
  gap: 8px;
}
#cart .quantity span {
  min-width: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
#cart .quantity button {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  font-size: 20px;
  cursor: pointer;
}
.cart-account {
  display: inline-block;
  margin-top: 22px;
  font-size: 13px;
  line-height: 1.6;
  text-underline-offset: 4px;
}
.cart-summary {
  min-width: 0;
  border: 1px solid #e4d7cb;
  background: #fff;
  padding: 24px;
  border-radius: 18px;
}
#cart .total {
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
#cart .total span {
  font-size: 14px;
}
.total small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #705c50;
}
#cart .total strong {
  font-size: 26px;
  letter-spacing: -0.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cart-delivery {
  font-size: 12px;
  line-height: 1.7;
  color: #705c50;
  margin: 18px 0;
}
#cart #checkout label {
  font-size: 13px;
  margin: 18px 0;
}
#cart #checkout input {
  font-size: 16px;
  margin: 8px 0 0;
  border-radius: 10px;
  min-height: 48px;
}
#cart #submit {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border: 0;
  border-radius: 12px;
  background: #3f2418;
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#cart #submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#cart button:focus-visible,
#cart a:focus-visible,
#cart input:focus-visible {
  outline: 3px solid #b87c41;
  outline-offset: 3px;
}
#cart #message {
  margin: 16px 0 0;
  overflow-wrap: anywhere;
}
#cart #message:empty {
  display: none;
}
@media (max-width: 720px) {
  #cart {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    padding: 20px;
    border-radius: 18px;
  }
  #cart .cart-head {
    top: -20px;
  }
  .cart-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .cart-summary {
    padding: 20px;
  }
  #cart .cart-intro {
    margin: 16px 0 22px;
  }
  #cart .cart-row {
    padding: 14px 0;
  }
}
@media (max-width: 380px) {
  #cart {
    padding: 16px;
  }
  #cart .cart-head {
    top: -16px;
  }
  .cart-summary {
    padding: 16px;
  }
  #cart .total strong {
    font-size: 23px;
  }
}
#cart #submit:disabled {
  opacity: 1;
  background: #e3d5c6;
  color: #614b3c;
  box-shadow: none;
}
#cart #submit:not(:disabled) {
  box-shadow: 0 5px 14px #3f241822;
}
#cart #submit:not(:disabled):hover {
  background: #623c28;
}
.order-confirm-dialog {
  box-sizing: border-box;
  width: min(560px, calc(100% - 32px));
  max-width: 560px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 32px;
  border-radius: 22px;
  border: 1px solid #e2d1c3;
  box-shadow: 0 30px 90px #20100955;
  background: #faf5eb;
  color: #3f2418;
}
.order-confirm-dialog h2 {
  margin: 8px 0 16px;
  font-size: 30px;
  line-height: 1.2;
}
.order-confirm-dialog p {
  font-size: 14px;
  line-height: 1.7;
}
.order-confirm-dialog .confirmation-step {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #8b5e3c;
  margin: 0;
}
#confirm-order-items {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}
#confirm-order-items li {
  padding: 12px 0;
  border-bottom: 1px solid #e3d5c6;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.confirmation-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.confirmation-total strong {
  font-size: 28px;
  white-space: nowrap;
}
.confirmation-note {
  color: #786253;
}
.confirmation-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.confirmation-actions button {
  flex: 1;
  min-height: 50px;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
#cancel-order {
  background: transparent;
  border: 1px solid #bca38d;
  color: #3f2418;
}
#confirm-order-send {
  background: #3f2418;
  color: white;
  border: 1px solid #3f2418;
  font-weight: 600;
}
.order-confirm-dialog button:focus-visible {
  outline: 3px solid #b87c41;
  outline-offset: 3px;
}
@media (max-width: 480px) {
  .order-confirm-dialog {
    padding: 22px;
  }
  .order-confirm-dialog h2 {
    font-size: 26px;
  }
  .confirmation-actions {
    flex-direction: column-reverse;
  }
  .confirmation-actions button {
    width: 100%;
  }
}
/* Shop actions share the rounded shape, warm border and chocolate palette of the catalog. */
#cart #submit,
#confirm-order-send,
.order-history-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #3d231a;
  border-radius: 999px;
  background: #3d231a;
  color: #faf5eb;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.25px;
  line-height: 1.4;
  min-height: 52px;
  padding: 15px 24px;
  box-shadow: 0 4px 12px #3d231a14;
  text-decoration: none;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
  cursor: pointer;
}
#cart #submit:not(:disabled):hover,
#confirm-order-send:hover,
.order-history-button:hover {
  background: #ad633f;
  border-color: #ad633f;
  box-shadow: 0 6px 16px #ad633f26;
  transform: translateY(-1px);
}
#cart #submit:not(:disabled):active,
#confirm-order-send:active,
.order-history-button:active {
  transform: translateY(0);
  box-shadow: none;
}
#cart #submit:disabled {
  border: 1px dashed #ccb8a2;
  background: #f3ece2;
  color: #7c6655;
  box-shadow: none;
  font-size: 12px;
  font-weight: 400;
  opacity: 1;
}
#cancel-order,
#close-order-success {
  border: 1px solid #d0bca8;
  border-radius: 999px;
  color: #3d231a;
  background: transparent;
  min-height: 52px;
  padding: 15px 22px;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}
#cancel-order:hover,
#close-order-success:hover {
  background: #eee3d6;
  border-color: #ad633f;
}
#cart #message:not(:empty) {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 13px;
  background: #f6eee1;
  border: 1px solid #e0cdb8;
  color: #614329;
}
#cart #message[data-state='error']:not(:empty) {
  background: #fff0e9;
  border-color: #deac98;
  color: #7b3320;
}
.order-success-dialog {
  text-align: center;
  padding: 36px;
  max-width: 580px;
  width: min(580px, calc(100% - 32px));
}
.order-success-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: #e9eddf;
  border: 1px solid #c8d2b7;
  border-radius: 50%;
  color: #536542;
  font-size: 30px;
}
.order-success-dialog h2 {
  font-size: 30px;
  font-family: Georgia, serif;
  font-weight: 400;
  line-height: 1.2;
  margin: 12px 0 16px;
  letter-spacing: -0.4px;
}
.order-success-dialog > p {
  color: #70584c;
}
.order-receipt {
  margin: 24px 0;
  padding: 4px 20px;
  background: #fff;
  border: 1px solid #e5d8c9;
  border-radius: 16px;
  text-align: left;
}
.order-receipt > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
}
.order-receipt > div + div {
  border-top: 1px solid #eee3d6;
}
.order-receipt span {
  font-size: 12px;
  color: #70584c;
  flex: 0 0 auto;
}
.order-receipt strong {
  font-size: 14px;
  overflow-wrap: anywhere;
  text-align: right;
  min-width: 0;
}
#success-order-id {
  font-family: monospace;
  font-size: 12px;
  line-height: 1.5;
}
#success-order-total {
  font-size: 22px;
}
.order-receipt .order-pending-badge {
  font-size: 11px;
  font-weight: 600;
  color: #86612b;
  background: #f8efd9;
  border: 1px solid #e9d6aa;
  border-radius: 999px;
  padding: 6px 10px;
}
.order-success-dialog .confirmation-actions {
  align-items: stretch;
}
.order-success-dialog .confirmation-actions > * {
  flex: 1;
}
.order-history-button:focus-visible,
#close-order-success:focus-visible {
  outline: 3px solid #b87c41;
  outline-offset: 3px;
}
@media (max-width: 480px) {
  .order-success-dialog {
    padding: 26px 20px;
  }
  .order-success-dialog h2 {
    font-size: 26px;
  }
  .order-receipt {
    padding: 4px 14px;
  }
  .order-receipt > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .order-receipt strong {
    text-align: left;
  }
  .order-history-button {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  #cart #submit,
  #confirm-order-send,
  .order-history-button {
    transition: none;
    transform: none !important;
  }
}
.template-save-notice {
  padding: 12px 16px;
  background: #eff2e8;
  color: #465339;
  border: 1px solid #d0d8c1;
  border-radius: 12px;
  font-size: 13px;
}
.order-card button,
#refresh-orders,
.order-pages button {
  border-radius: 999px;
}
.order-card select {
  border: 1px solid #d8c4af;
  border-radius: 10px;
  background: #fffaf4;
  color: #3d231a;
}
.template-save-notice.is-error {
  background: #fff0e9;
  border-color: #dfb29e;
  color: #7b3320;
}
