.returns-content {
  display: grid;
  gap: 20px;
}

.returns-list,
.return-detail {
  display: grid;
  gap: 14px;
}

.return-detail[hidden] {
  display: none;
}

.guest-return-detail-layout {
  --return-section-nav-size: 74px;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

body.guest-returns-shell .guest-returns-content,
body.guest-returns-shell .return-wizard-panel,
body.guest-returns-shell .guest-return-detail-layout {
  max-width: 100%;
  min-width: 0;
}

body.guest-returns-shell .return-wizard-panel:has(.guest-return-detail-layout) {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.guest-return-detail-sections {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 7px;
  margin: -7px;
}

.return-secondary-grid,
.return-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: stretch;
  min-width: 0;
}

.return-lower-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.return-secondary-grid > *,
.return-lower-grid > * {
  min-width: 0;
}

body.guest-returns-shell .guest-return-detail-layout .order-info-panel,
body.guest-returns-shell .guest-return-detail-layout .return-wizard-review-section,
body.guest-returns-shell .guest-return-detail-layout .return-important-section {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 22px;
  border: 1px solid #e8e5da;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(15, 30, 25, 0.07);
  box-sizing: border-box;
}

body.guest-returns-shell .guest-return-detail-layout .return-reference-card {
  padding: 18px;
  border-color: #b8c5b4;
  background: #fff;
}

body.guest-returns-shell .guest-return-detail-layout .return-important-section {
  display: grid;
  gap: 14px;
  align-content: start;
}

.return-section-nav {
  position: sticky;
  top: max(22px, calc(50vh - 260px));
  z-index: 40;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.return-section-nav-button {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  align-items: center;
  justify-content: center;
  width: var(--return-section-nav-size);
  height: var(--return-section-nav-size);
  padding: 9px 7px;
  border: 1px solid #e8e5da;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--storefront-muted);
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.return-section-nav-button i {
  font-size: 1.42rem;
  line-height: 1;
}

.return-section-nav-label {
  max-width: 100%;
  color: var(--storefront-text);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.return-section-nav-button:hover,
.return-section-nav-button.is-active {
  border-color: var(--storefront-accent);
  background: #f4f8f1;
  color: var(--storefront-accent);
  box-shadow: 0 14px 32px rgba(15, 30, 25, 0.12);
}

.return-section-nav-button.is-pulsing {
  animation: return-section-nav-pulse 1.4s ease;
}

.return-section-nav-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.return-section-nav-badge.is-accent {
  background: #b42318;
}

.return-section-nav-badge.is-neutral {
  background: #6b7280;
}

.return-section-anchor {
  scroll-margin-top: 24px;
}

.return-section-header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.return-section-header h3 {
  margin: 0;
  color: var(--storefront-text);
  font-size: 1.08rem;
  line-height: 1.2;
}

.return-section-header-badges {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.return-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.return-section-count.is-accent {
  background: #b42318;
}

.return-section-count.is-neutral {
  background: #6b7280;
}

.return-section-count.is-info {
  background: #2563eb;
}

body.guest-returns-shell .guest-return-detail-layout .return-section-anchor.is-section-highlighted {
  box-shadow:
    0 0 0 2px var(--storefront-accent),
    0 0 0 7px rgba(67, 81, 61, 0.12),
    0 12px 32px rgba(15, 30, 25, 0.07);
  transition: box-shadow 0.2s ease;
}

@keyframes return-section-nav-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.06);
  }
}

.returns-empty {
  padding: 22px;
  border: 1px solid var(--storefront-border);
  border-radius: var(--storefront-radius-lg);
  background: rgba(255, 253, 250, 0.92);
  color: var(--storefront-muted);
  font-weight: 700;
}

.returns-table-wrap {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--storefront-border);
  border-radius: var(--storefront-radius-lg);
  background: rgba(255, 253, 250, 0.92);
  box-shadow: var(--storefront-shadow-sm);
}

.returns-table {
  width: 100%;
  border-collapse: collapse;
}

.returns-table th,
.returns-table td {
  padding: 15px 16px;
  border-bottom: 1px solid #e8e5da;
  text-align: left;
  vertical-align: middle;
}

.returns-table th {
  background: #f4f8f1;
  color: var(--storefront-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.returns-table tbody tr:last-child td {
  border-bottom: 0;
}

.returns-table td:last-child {
  text-align: right;
}

.returns-table .summary-button {
  width: auto;
  min-width: 82px;
  min-height: 40px;
  padding-right: 16px;
  padding-left: 16px;
}

.return-items-list,
.return-timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.return-state-panel {
  border-color: color-mix(in srgb, var(--storefront-accent) 58%, #d9d5c7);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--storefront-accent) 16%, transparent), 0 16px 38px rgba(15, 30, 25, 0.1);
}

.return-status-progress {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin-top: 18px;
  overflow: hidden;
}

.return-status-step {
  position: relative;
  display: grid;
  gap: 7px;
  justify-items: center;
  min-width: 0;
  padding: 0 8px;
  color: var(--storefront-muted);
  text-align: center;
}

.return-status-step::before {
  content: "";
  position: absolute;
  top: 17px;
  right: 50%;
  left: -50%;
  height: 3px;
  background: #d9d5c7;
}

.return-status-step:first-child::before {
  display: none;
}

.return-status-step.is-complete::before,
.return-status-step.is-active::before,
.return-status-step.is-stopped::before {
  background: #15803d;
}

.return-status-step-marker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid #d9d5c7;
  border-radius: 999px;
  background: #fff;
  color: #6b7280;
  font-size: 0.86rem;
  font-weight: 900;
}

.return-status-step.is-complete .return-status-step-marker {
  border-color: #15803d;
  background: #15803d;
  color: #fff;
}

.return-status-step.is-active .return-status-step-marker {
  border-color: var(--storefront-accent);
  background: var(--storefront-accent);
  color: #fff;
  box-shadow: 0 0 0 9px color-mix(in srgb, var(--storefront-accent) 12%, transparent);
}

.return-status-step.is-stopped .return-status-step-marker {
  border-color: #b42318;
  background: #b42318;
  color: #fff;
}

.return-status-step strong {
  min-width: 0;
  color: var(--storefront-text);
  font-size: 0.82rem;
  line-height: 1.25;
}

.return-status-step small {
  color: var(--storefront-muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
}

.return-detail-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.return-detail-card {
  display: grid;
  align-items: center;
  min-width: 0;
  min-height: 64px;
  padding: 13px;
  border: 1px solid #e8e5da;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.return-detail-card.is-wide {
  grid-column: 1 / -1;
}

body.guest-returns-shell .guest-return-detail-layout .info-row {
  display: grid;
  grid-template-columns: minmax(108px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding-top: 0;
  border-top: 0;
}

body.guest-returns-shell .guest-return-detail-layout .info-row span {
  min-width: max-content;
  color: var(--storefront-muted);
  font-size: 0.9rem;
  line-height: 1.25;
  white-space: nowrap;
}

body.guest-returns-shell .guest-return-detail-layout .info-row strong {
  min-width: 0;
  color: var(--storefront-text);
  line-height: 1.3;
  text-align: right;
  overflow-wrap: anywhere;
}

.return-items-list li,
.return-timeline li {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #e8e5da;
  border-radius: var(--storefront-radius-md);
  background: rgba(255, 255, 255, 0.58);
}

.return-item-card-grid {
  display: grid;
  grid-template-columns: minmax(92px, 0.55fr) minmax(160px, 1fr) minmax(150px, 1fr);
  gap: 12px;
  align-items: stretch;
}

body.guest-returns-shell .guest-return-detail-layout .return-item-card-grid .info-row {
  display: block;
  min-height: 42px;
}

body.guest-returns-shell .guest-return-detail-layout .return-item-card-grid .info-row span,
body.guest-returns-shell .guest-return-detail-layout .return-item-card-grid .info-row strong {
  display: block;
  min-width: 0;
  text-align: left;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.return-item-note {
  padding-top: 8px;
  border-top: 1px solid #e8e5da;
}

.return-items-list h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.28;
  overflow-wrap: break-word;
}

.return-items-section .return-item-card {
  gap: 12px;
  padding: 16px;
}

.return-timeline li {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.return-timeline span {
  color: var(--storefront-muted);
  font-weight: 700;
  white-space: nowrap;
}

.return-conversation-list,
.return-conversation-form,
.return-attachments-list,
.return-attachment-form {
  display: grid;
  gap: 12px;
}

.return-conversation-list {
  max-height: 336px;
  overflow: auto;
  padding-right: 4px;
}

.return-attachment-item,
.return-conversation-message {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #e8e5da;
  border-radius: var(--storefront-radius-md);
  background: rgba(255, 255, 255, 0.68);
}

.return-attachment-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.return-attachment-item > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.return-attachment-item span {
  color: var(--storefront-muted);
  font-size: 0.86rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.return-attachment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.return-icon-action {
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid #d9d5c7;
  border-radius: 999px;
  background: #fff;
  color: var(--storefront-accent);
  cursor: pointer;
  box-sizing: border-box;
}

.return-icon-action svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.return-icon-action:hover:not(:disabled) {
  border-color: var(--storefront-accent);
  background: rgba(255, 255, 255, 0.78);
}

.return-icon-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.return-icon-action.is-danger {
  border-color: #d8a199;
  color: #b42318;
}

.refund-bank-details-form {
  display: grid;
  gap: 12px;
}

.refund-bank-details-form input,
.refund-bank-details-form textarea {
  width: 100%;
}

.return-timeline .return-timeline-collapsed {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.return-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 25, 0.55);
}

.return-preview-modal {
  display: grid;
  gap: 14px;
  width: min(920px, 100%);
  max-height: 88vh;
  padding: 16px;
  overflow: auto;
  border: 1px solid #e8e5da;
  border-radius: var(--storefront-radius-md);
  background: #fff;
}

.return-preview-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.return-preview-modal img,
.return-preview-modal iframe {
  width: 100%;
  max-height: 70vh;
  border: 0;
  object-fit: contain;
}

.return-preview-modal iframe {
  min-height: 60vh;
}

.return-conversation-message > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  color: var(--storefront-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.return-conversation-message p {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.return-conversation-form textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

.return-attachment-form input[type="file"] {
  width: 100%;
}

.return-upload-progress {
  position: relative;
  min-height: 22px;
  overflow: hidden;
  border: 1px solid #d9d5c7;
  border-radius: 999px;
  background: #fff;
}

.return-upload-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: #2563eb;
  transition: width 0.18s ease;
}

.return-upload-progress strong {
  position: relative;
  z-index: 1;
  display: block;
  padding: 3px 10px;
  color: var(--storefront-text);
  font-size: 0.78rem;
  text-align: center;
}

.return-important-section {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.return-important-section h3 {
  margin: 0;
  color: var(--storefront-text);
  font-size: 1.05rem;
}

.return-important-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.return-important-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--storefront-border);
  border-radius: var(--storefront-radius-md);
  background: rgba(255, 253, 250, 0.92);
  box-shadow: var(--storefront-shadow-sm);
}

.return-reference-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-color: var(--storefront-accent-dark);
}

.return-important-label {
  color: var(--storefront-muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.return-important-card strong,
.return-reference-value {
  color: var(--storefront-text);
  overflow-wrap: anywhere;
}

.return-reference-value {
  display: block;
  margin-top: 4px;
  color: var(--storefront-accent-dark);
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.1;
}

.return-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--storefront-accent-dark);
  border-radius: var(--storefront-radius-sm);
  background: transparent;
  color: var(--storefront-accent-dark);
  font: inherit;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.return-copy-button:hover {
  background: color-mix(in srgb, var(--storefront-accent-dark) 8%, transparent);
}

.return-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--storefront-border);
  border-radius: 999px;
  background: #fff;
  color: var(--storefront-text);
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.2;
  white-space: normal;
}

.return-status-pill.is-received,
.return-status-pill.is-approved,
.return-status-pill.is-resolved {
  border-color: #9fb58d;
  background: #f4f8f1;
  color: #31452b;
}

.return-status-pill.is-review,
.return-status-pill.is-waiting {
  border-color: #d7c387;
  background: #fff8df;
  color: #5b470e;
}

.return-status-pill.is-rejected {
  border-color: #d8a199;
  background: #fff7f5;
  color: #8f2d22;
}

@media (max-width: 860px) {
  .guest-return-detail-layout {
    display: block;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }

  .return-section-nav {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    transform: none;
    border: 1px solid #e8e5da;
    border-radius: 18px 18px 0 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -12px 28px rgba(15, 30, 25, 0.14);
  }

  .return-section-nav-button {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    padding: 8px;
    border-radius: 14px;
    grid-template-rows: 1fr;
  }

  .return-section-nav-button i {
    font-size: 1.35rem;
  }

  .return-section-nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .return-section-nav-badge {
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.68rem;
  }

  .return-section-anchor {
    scroll-margin-top: 18px;
  }

  .returns-table-wrap {
    overflow-x: auto;
  }

  .returns-table {
    min-width: 760px;
  }

  .return-timeline li {
    grid-template-columns: 1fr;
  }

  .return-status-progress {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 18px;
  }

  .return-secondary-grid,
  .return-lower-grid {
    grid-template-columns: 1fr;
  }

  .return-status-step:nth-child(4)::before {
    display: none;
  }

  .return-detail-card-grid,
  .return-item-card-grid {
    grid-template-columns: 1fr;
  }

  .return-attachment-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .return-attachment-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
  }

  .return-important-grid,
  .return-reference-card {
    grid-template-columns: 1fr;
  }

  .return-copy-button {
    width: 100%;
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .return-section-nav {
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .return-section-nav-button {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .return-status-progress {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .return-status-step {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    text-align: left;
  }

  .return-status-step::before {
    top: -12px;
    bottom: 50%;
    left: 17px;
    width: 3px;
    height: auto;
  }

  .return-status-step:first-child::before,
  .return-status-step:nth-child(4)::before {
    display: block;
  }

  .return-status-step:first-child::before {
    display: none;
  }

  .return-status-step small {
    grid-column: 2;
  }
}
