.order-portal { max-width: 1110px; }
.portal-heading, .portal-actions, .resume-checkout,
.customer-order-top, .customer-order-bottom, .cart-suggestions-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 22px;
}
.portal-heading { margin: 12px 0 26px; }
.portal-heading h1, .customer-form-page h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; }
.portal-actions { justify-content: flex-start; }
.portal-actions form { margin: 0; }
.resume-checkout {
  margin-bottom: 28px;
  padding: 20px 22px;
  border: 1px solid #ddd0aa;
  border-radius: 12px;
  background: #f5ecd6;
}
.resume-checkout strong { color: var(--dark); }
.resume-checkout p { margin: 2px 0 0; color: #514734; }
.order-entry { max-width: 640px; }
.order-entry p { margin-top: 0; }
.order-entry > .back-link { display: inline-block; margin-top: 22px; }
.order-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.order-tabs a {
  padding: 10px 1px 12px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 700;
}
.order-tabs a:hover, .order-tabs a[aria-current] { color: var(--green); }
.order-tabs a[aria-current] { border-bottom-color: var(--green); }
.order-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.customer-order { display: flex; flex-direction: column; padding: 20px; }
.customer-order-top { align-items: flex-start; }
.customer-order h2 { margin: 0 0 3px; font: 800 1.1rem/1.3 "DM Sans", sans-serif; }
.customer-order time { font-size: .9rem; color: var(--muted); }
.customer-order-items {
  flex: 1;
  padding-inline-start: 19px;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.customer-order-bottom {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.customer-order-bottom strong { color: var(--dark); }
.order-empty { grid-column: 1 / -1; }
.order-empty p { margin: 0 0 15px; }
.order-pagination { display: flex; gap: 10px; margin-top: 20px; }
.status-chip.order-cancelled { background: #f9e9e3; color: #8c3430; }

.customer-form-page { max-width: 600px; }
.customer-form-page h1 { margin-block: 12px 20px; }
.customer-form-page .panel { margin-bottom: 17px; }
.customer-form-page > p { color: var(--muted); margin-bottom: 16px; }
.customer-form-page .field label { font-size: .9rem; }
.field-help { margin-top: 6px; font-size: .875rem; color: var(--muted); }
.field-help ul { margin: 6px 0 0; padding-inline-start: 18px; }
.customer-form-page .alert-error ul { margin: 0; padding-inline-start: 20px; }

.order-progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 0; list-style: none; }
.order-step {
  border-top: 4px solid #dbdfd8;
  padding-top: 8px;
  color: var(--muted);
  font-size: .9rem;
}
.order-step.done { border-color: #79a389; color: var(--dark); }
.order-step.current { border-color: #b58a38; color: var(--dark); font-weight: 800; }
.order-progress-panel p { margin-block: 12px 0; }
.order-detail-layout { margin-top: 16px; }
.order-reference dl { margin: 0; }
.order-reference dt { color: var(--muted); font-size: .9rem; }
.order-reference dd { margin: 1px 0 12px; overflow-wrap: anywhere; }

.cart-suggestions {
  margin-top: 29px;
  padding: clamp(15px, 3vw, 26px);
  border: 1px solid #e3d8b9;
  border-radius: 14px;
  background: #f4eddb;
}
.cart-suggestions-heading { margin-bottom: 15px; }
.cart-suggestions-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
}
.cart-suggestions-heading p { margin: 0; color: #595039; font-size: .94rem; font-weight: 700; }
.cart-suggestion-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cart-suggestion {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e3dac6;
  border-radius: 9px;
  background: #fffdf9;
}
.cart-suggestion-photo { position: relative; display: grid; place-items: center; aspect-ratio: 2 / 1; background: #eaf0e5; }
.cart-suggestion-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
}
.cart-line .tiny-photo img { padding: 4px; object-fit: contain; }
.cart-suggestion-body { display: grid; flex: 1; grid-template-rows: 1fr auto auto; gap: 7px; padding: 11px; }
.cart-suggestion-body h3 { margin: 0; font-size: .96rem; line-height: 1.3; overflow-wrap: anywhere; }
.cart-suggestion-body h3 a:hover { text-decoration: underline; }
.cart-suggestion-body strong { color: var(--green); }
.cart-suggestion-body .button { min-height: 42px; padding-inline: 5px; font-size: .875rem; }

@media (max-width: 740px) {
  .cart-suggestion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-list { grid-template-columns: 1fr; }
}

@media (max-width: 575px) {
  .order-progress { grid-template-columns: 1fr; gap: 5px; }
  .order-step { border-top: 0; border-inline-start: 4px solid #dbdfd8; padding: 5px 10px; }
}

/* Product page */
#main-content:has(.product-page) {
  --product-glow: radial-gradient(ellipse 44rem 25rem at 77% 6rem, #cee4cf, transparent 80%);
  background: var(--product-glow), linear-gradient(180deg, #e9f2e6, #fffdf8 37rem);
}

.product-page {
  --product-gold: #efd092;
  padding-block: clamp(22px, 4vw, 44px) clamp(40px, 6vw, 75px);
}

.product-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.product-breadcrumbs a { padding-block: 7px; }
.product-breadcrumbs a:hover { text-decoration: underline; }

.product-page .detail-layout {
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: clamp(18px, 5vw, 66px);
  align-items: start;
  margin-top: 14px;
}

.product-page .detail-photo {
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 3;
  max-block-size: min(65vh, 36rem);
  border: 1px solid #e6dfcc;
  border-radius: 12px;
  background: #fff;
}

.product-page .detail-photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: clamp(10px, 2.6vw, 26px);
  object-fit: contain;
  object-position: center;
}

.product-page .detail-photo-empty {
  align-content: center;
  background: #f1eee3;
  gap: 12px;
  color: var(--muted);
  font-size: .875rem;
  text-align: center;
}

.product-page .detail-info {
  min-width: 0;
  padding-top: clamp(2px, 2.8vw, 33px);
}

.product-page .detail-info h1 {
  margin: 0 0 13px;
  font-size: clamp(2rem, 4.3vw, 3.6rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.product-page .detail-description {
  max-width: 58ch;
  margin: 0 0 17px;
  overflow-wrap: anywhere;
}

.product-buy-panel {
  display: grid;
  gap: 13px;
  padding: clamp(14px, 2.3vw, 25px);
  border: 1px solid #2b6048;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 100% 100%, #efd0922e, transparent 64%),
    linear-gradient(135deg, #123527, #1d543d);
  color: #fffdf7;
  box-shadow: 0 9px 24px #163e2d1a;
}

.product-buy-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 15px;
}

.product-page .detail-price {
  color: var(--product-gold);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
}

.product-buy-panel .status-chip { background: #e8f1e1; color: #204731; }
.product-buy-panel .status-warning { background: #f5dfa6; color: #49330f; }
.product-page .add-detail {
  display: grid;
  grid-template-columns: minmax(0, .42fr) minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  margin: 0;
}

.product-quantity { display: grid; gap: 4px; }
.product-quantity label { font-size: .875rem; font-weight: 700; }
.product-page .add-detail input {
  width: 100%;
  min-height: 47px;
  padding: 7px 10px;
  font: inherit;
}

.product-page .add-detail .button {
  min-height: 47px;
  padding-inline: 12px;
  background: var(--product-gold);
  color: #142e22;
}

.product-page .add-detail .button:hover { background: #ffe5ad; }
.product-buy-panel :is(input, button):focus-visible { outline-color: #fff; }
.product-delivery-note {
  margin-top: 15px;
  padding: 11px 14px;
  border-inline-start: 3px solid #5e8a70;
  background: linear-gradient(90deg, #e7f0e4, #f3f7ef);
}

.product-page .product-delivery-note p { margin: 4px 0 0; font-size: .875rem; }
.product-delivery-note a:hover { text-decoration: underline; }

@media (max-width: 690px) {
  #main-content:has(.product-page) {
    --product-glow: radial-gradient(ellipse 26rem 20rem at center min(52vh, 26rem), #d6e9d5, transparent 78%);
  }
  .product-page .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .product-page .detail-photo { aspect-ratio: 1; max-block-size: min(50vh, 24rem); }
}

.customer-account-page { max-width: 530px; }
.account-card { padding: clamp(20px, 4vw, 38px); }
.account-heading { margin-bottom: 22px; }
.account-heading h1 { margin: 0; }
.account-heading p { margin: 8px 0 0; color: var(--muted); }
.account-card .checkout-form { margin: 0; }
.account-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.account-links a { padding-block: 6px; color: var(--green); font-weight: 700; text-decoration: underline; }
.account-authenticator-qr { display: block; width: min(100%, 230px); height: auto; margin: 12px auto; }
.account-setup-key { overflow-wrap: anywhere; }
.account-backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin-block: 12px 20px; padding: 0; list-style: none; }
.account-backup-codes li { padding: 6px 8px; border-radius: 5px; background: var(--mint); overflow-wrap: anywhere; }
