.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: 86px;
  display: block;
}

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: 22px;
  min-width: 0;
}

.return-section-nav {
  position: fixed;
  top: 50%;
  left: max(14px, calc((100vw - 920px) / 2 - 112px));
  z-index: 40;
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.return-section-nav-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--return-section-nav-size);
  height: var(--return-section-nav-size);
  padding: 10px;
  border: 1px solid #e8e5da;
  border-radius: var(--storefront-radius-md);
  background: rgba(255, 255, 255, 0.76);
  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: calc(var(--return-section-nav-size) * 0.5);
  line-height: 1;
}

.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: 10px;
  right: 10px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  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-anchor {
  scroll-margin-top: 24px;
}

.return-section-anchor.is-section-highlighted {
  outline: 2px solid var(--storefront-accent);
  outline-offset: 5px;
  box-shadow: 0 0 0 5px rgba(67, 81, 61, 0.12);
  transition: outline-color 0.2s ease, 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-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-items-list h4 {
  margin: 0;
  font-size: 1rem;
}

.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-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: 0;
    justify-content: space-evenly;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    overflow-x: auto;
    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 54px;
    width: 54px;
    height: 54px;
    padding: 8px;
    border-radius: 14px;
  }

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

  .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-attachment-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .return-attachment-actions {
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-end;
  }

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

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