/* ===== RMA Pages — Design System ===== */

/* --- 1. Shared section spacing --- */
.ds-rma-section {
    margin-top: 2rem;
}
.ds-rma-section:first-child {
    margin-top: 0;
}

/* --- Override global button uppercase for RMA pages --- */
/* Covers #rma-list, #rma-view, #rma-add, #rma-login (every RMA page wrapper). */
[id^="rma-"] .button {
    text-transform: none;
}

/* --- 2. Order cards (addrma.twig) --- */
.ds-rma-order-card {
    border: 1px solid var(--ds-border-color-light, #F2F2F2);
    padding: 1rem;
    cursor: pointer;
    transition: var(--ds-main-transition, 0.3s ease-out);
    height: 100%;
}
.ds-rma-order-card:hover {
    border-color: var(--ds-primary-color, rgb(17, 48, 37));
    background: var(--ds-primary-light-color-light, #f9f8f5);
}
.ds-rma-order-card.active {
    border-color: var(--ds-primary-color, rgb(17, 48, 37));
    border-width: 2px;
    background: var(--ds-primary-light-color-light, #f9f8f5);
}
.ds-rma-order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.ds-rma-order-card-id {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ds-dark-text-color, #1c1c1c);
}
.ds-rma-order-card-date {
    font-size: 0.75rem;
    color: var(--ds-light-text-color, rgba(80, 80, 80));
}
.ds-rma-order-card-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.ds-rma-order-card-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid var(--ds-border-color-light, #F2F2F2);
    flex-shrink: 0;
}
.ds-rma-order-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.ds-rma-order-card-total {
    font-weight: 500;
    font-size: 1rem;
    color: var(--ds-dark-text-color, #1c1c1c);
}
.ds-rma-order-card-qty {
    font-size: 0.75rem;
    color: var(--ds-light-text-color, rgba(80, 80, 80));
}
.ds-rma-order-card-products {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--ds-light-text-color, rgba(80, 80, 80));
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 3. Product selection cards (addrma.twig) ---
   Mirrors the .ds-pp-product card system used on viewrma so a customer sees
   the same image + option chips both before submission and on the receipt. */
.ds-rma-product-grid {
    border: 1px solid var(--ds-border-color-light, #F2F2F2);
}
.ds-rma-product-grid-items {
    min-height: 60px;
}
.ds-rma-product-row {
    border-bottom: 1px solid var(--ds-border-color-light, #F2F2F2);
}
.ds-rma-product-row:last-child {
    border-bottom: none;
}
.ds-rma-product-row-main {
    padding: 1rem 1.25rem;
}
.ds-rma-product-row-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.ds-rma-product-row-check {
    flex-shrink: 0;
    padding-top: 0.25rem;
}
.ds-rma-product-row-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--ds-primary-color, rgb(17, 48, 37));
}
.ds-rma-product-row-info {
    flex: 1;
    min-width: 0;
}
.ds-rma-product-row-info h3 a {
    color: var(--ds-dark-text-color, #1c1c1c);
    text-decoration: none;
}
.ds-rma-product-row-info h3 a:hover {
    text-decoration: underline;
}
.ds-rma-product-row-options {
    padding: 1rem 1.25rem;
    background: var(--ds-primary-light-color-light, #f9f8f5);
    border-top: 1px solid var(--ds-border-color-light, #F2F2F2);
    display: none;
}
.ds-rma-product-row-options .form-control {
    font-size: 0.875rem;
}
.ds-rma-product-row-options label {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    display: block;
    color: var(--ds-dark-text-color, #1c1c1c);
}
.ds-rma-product-row-options .ds-rma-options-inner {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.ds-rma-product-row-options .qty { width: 100px; flex-shrink: 0; }
.ds-rma-product-row-options .type { flex: 1; min-width: 180px; }
.ds-rma-product-row-options .reason { flex: 1; min-width: 180px; }

/* Card-style overrides on top of the .ds-pp-product base from account.css.
   The base rule sets display:flex on the article which would lay the row
   main, the options block, and the exchange field side-by-side as flex
   columns. We need them stacked: row-main on top, then options sliding
   down beneath when the row is selected, then the exchange field. */
.ds-rma-product-row.ds-pp-product {
    display: block;
    padding: 0;
    gap: 0;
    border-bottom: 1px solid var(--ds-border-color-light, #F2F2F2);
}
.ds-rma-product-row.ds-pp-product:last-child {
    border-bottom: none;
}
.ds-rma-product-row .ds-rma-product-row-main.ds-pp-product-main {
    padding: 1rem 1.25rem;
}

/* Empty state */
.ds-rma-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--ds-light-text-color, rgba(80, 80, 80));
    font-size: 0.875rem;
}

/* --- 4. Image upload & gallery --- */
.ds-rma-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.ds-rma-image-thumb {
    width: 96px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--ds-border-color-light, #F2F2F2);
    border-radius: 6px;
    background: var(--ds-primary-light-color-light, #f9f8f5);
    cursor: pointer;
    overflow: hidden;
    transition: var(--ds-main-transition, 0.3s ease-out);
}
.ds-rma-image-thumb:hover {
    border-color: var(--ds-primary-color, rgb(17, 48, 37));
    box-shadow: var(--ds-light-shadow-light, 0px 2px 8px 0px rgba(37,38,39,0.06));
}
.ds-rma-thumb-preview {
    width: 100%;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ds-rma-thumb-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ds-rma-thumb-doc {
    color: var(--ds-primary-color, rgb(17, 48, 37));
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.ds-rma-thumb-doc svg {
    width: 36px;
    height: 36px;
    display: block;
}
.ds-rma-thumb-doc-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1;
}
.ds-rma-thumb-name {
    display: block;
    padding: 4px 6px;
    font-size: 10px;
    line-height: 1.25;
    color: var(--ds-dark-text-color, #1c1c1c);
    background: #fff;
    border-top: 1px solid var(--ds-border-color-light, #F2F2F2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.ds-rma-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.ds-rma-gallery-item {
    padding: 0;
    margin: 0;
}
.ds-rma-gallery-item a {
    display: block;
    border: 1px solid var(--ds-border-color-light, #F2F2F2);
    transition: var(--ds-main-transition, 0.3s ease-out);
}
.ds-rma-gallery-item a:hover {
    border-color: var(--ds-primary-color, rgb(17, 48, 37));
}
.ds-rma-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Files list (consolidated attachment view) --- */
.ds-rma-files-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
}
.ds-rma-files-item {
    margin: 0;
    padding: 0;
}
.ds-rma-files-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--ds-border-color-light, #F2F2F2);
    border-radius: 6px;
    text-decoration: none;
    color: var(--ds-dark-text-color, #1c1c1c);
    background: #fff;
    transition: var(--ds-main-transition, 0.3s ease-out);
}
.ds-rma-files-link:hover {
    border-color: var(--ds-primary-color, rgb(17, 48, 37));
    box-shadow: var(--ds-light-shadow-light, 0px 2px 8px 0px rgba(37,38,39,0.06));
    text-decoration: none;
    color: var(--ds-dark-text-color, #1c1c1c);
}
.ds-rma-files-thumb {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
    background: var(--ds-primary-light-color-light, #f9f8f5);
}
.ds-rma-files-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ds-rma-files-thumb-doc {
    flex-direction: column;
    color: var(--ds-primary-color, rgb(17, 48, 37));
    gap: 1px;
}
.ds-rma-files-thumb-doc svg {
    width: 22px;
    height: 22px;
    display: block;
}
.ds-rma-files-ext {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1;
}
.ds-rma-files-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 2px;
}
.ds-rma-files-name {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ds-rma-files-by {
    font-size: 12px;
    color: var(--ds-light-text-color-light, rgba(80, 80, 80, 1));
    line-height: 1.2;
}
.ds-rma-files-sep {
    margin: 0 4px;
    opacity: 0.6;
}

/* Upload button — uses the standard brand button sizing; this rule only adds
   the icon/label inline alignment and removes the residual <label> margin. */
.ds-rma-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
}
.ds-rma-upload-btn svg {
    flex-shrink: 0;
}

/* On narrow viewports the brand button proportions become too chunky inside
   the RMA module (message reply row, action stacks, list-item actions).
   Scoped to the RMA page wrappers (#rma-list, #rma-view, #rma-add,
   #rma-login) so the rest of the storefront keeps its standard sizing. */
@media (max-width: 575.98px) {
    [id^="rma-"] .button {
        padding: 0.55rem 1rem;
        font-size: 0.8125rem;
        line-height: 1.2;
    }
    [id^="rma-"] .button svg {
        width: 14px;
        height: 14px;
    }
}

/* Destructive secondary action (e.g. cancel an open RMA from the list).
   Uses the outline button shape for consistent sizing across the module
   while signalling a destructive intent through brand red. */
.ds-rma-button-danger {
    color: var(--ds-red-color, #b22222);
    border-color: rgba(178, 34, 34, 0.4);
}
.ds-rma-button-danger:hover:not([disabled]),
.ds-rma-button-danger:focus:not([disabled]) {
    background-color: var(--ds-red-color, #b22222) !important;
    border-color: var(--ds-red-color, #b22222) !important;
    color: #fff !important;
}

/* --- 5. Message thread (viewrma.twig) — Timeline style --- */
.ds-rma-thread {
    position: relative;
    padding: 1rem 0;
}
.ds-rma-thread::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--ds-border-color-light, #F2F2F2);
    transform: translateX(-50%);
}
.ds-rma-message {
    position: relative;
    display: flex;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}
.ds-rma-message:last-child {
    margin-bottom: 0;
}

/* Timeline node — vertically centered with message */
.ds-rma-message::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ds-primary-color, rgb(17, 48, 37));
    border: 2px solid #fff;
    transform: translate(-50%, -50%);
    z-index: 1;
    box-shadow: 0 0 0 2px var(--ds-border-color-light, #F2F2F2);
}

/* Admin messages — left side */
.ds-rma-message--admin {
    justify-content: flex-start;
    padding-right: calc(50% + 1.5rem);
}
.ds-rma-message--admin .ds-rma-message-bubble {
    background: #fff;
    border: 1px solid var(--ds-border-color-light, #F2F2F2);
    border-left: 3px solid var(--ds-primary-color, rgb(17, 48, 37));
}

/* Customer messages — right side */
.ds-rma-message--customer {
    justify-content: flex-end;
    padding-left: calc(50% + 1.5rem);
}
.ds-rma-message--customer .ds-rma-message-bubble {
    background: var(--ds-primary-light-color-light, #f9f8f5);
    border: 1px solid var(--ds-border-color-light, #F2F2F2);
    /* Warm gold accent on customer side mirrors the print view: gold = customer,
       brand green = My Moissanite. Keeps the two parties immediately
       distinguishable across both surfaces. */
    border-right: 3px solid #d4a837;
}

.ds-rma-message-bubble {
    padding: 1rem 1.25rem;
    width: 100%;
    position: relative;
}
.ds-rma-message-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: var(--ds-light-text-color, rgba(80, 80, 80));
}
.ds-rma-message-header svg {
    flex-shrink: 0;
}
.ds-rma-message-header .ds-rma-message-sender {
    font-weight: 500;
    color: var(--ds-dark-text-color, #1c1c1c);
}
.ds-rma-message-body {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ds-dark-text-color, #1c1c1c);
    overflow-wrap: break-word;
}
.ds-rma-message-attachments {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
    /* Translucent brand-green divider so it stays visible on both the white
       admin bubble and the ivory customer bubble. Mirrors the print view. */
    border-top: 1px solid rgba(17, 48, 37, 0.18);
}
.ds-rma-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: var(--ds-primary-light-color-light, #f9f8f5);
    border: 1px solid var(--ds-border-color-light, #F2F2F2);
    font-size: 0.75rem;
    color: var(--ds-primary-color, rgb(17, 48, 37));
    text-decoration: none;
    transition: var(--ds-main-transition, 0.3s ease-out);
    /* Customers regularly upload files whose names are full URLs (default
       filename of a screenshot). Cap the chip and truncate the inner name
       so it stays inside the message bubble instead of overflowing. */
    max-width: 100%;
    min-width: 0;
}
.ds-rma-attachment-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.ds-rma-attachment-chip:hover {
    background: var(--ds-primary-color, rgb(17, 48, 37));
    color: #fff;
    border-color: var(--ds-primary-color, rgb(17, 48, 37));
}
.ds-rma-attachment-chip svg {
    flex-shrink: 0;
}

/* Status chip — calm, compact badge for message/event status labels. */
.ds-rma-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border: 1px solid rgba(17, 48, 37, 0.16);
    background: #fff;
    color: var(--ds-primary-color, rgb(17, 48, 37));
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.4;
    max-width: 100%;
    overflow-wrap: break-word;
    text-transform: none;
    letter-spacing: 0.03em;
}
.ds-rma-status-chip--inline {
    margin-left: auto;
}
@media (max-width: 575.98px) {
    /* On narrow screens drop the auto-margin so the chip wraps to a new line
       inside the bubble instead of overflowing it. */
    .ds-rma-status-chip--inline {
        margin-left: 0;
        flex-basis: 100%;
    }
}

/* Status-only timeline event — compact notification card for updates that carry no message. */
.ds-rma-event {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 0.35rem 0 1.1rem;
}
.ds-rma-event:last-child {
    margin-bottom: 0;
}
.ds-rma-event::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ds-light-text-color-light, rgba(80, 80, 80));
    border: 2px solid #fff;
    transform: translate(-50%, -50%);
    z-index: 1;
    box-shadow: 0 0 0 2px var(--ds-border-color-light, #F2F2F2);
}
.ds-rma-event-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid rgba(17, 48, 37, 0.12);
    border-left: 3px solid var(--ds-primary-color, rgb(17, 48, 37));
    box-shadow: 0 1px 2px rgba(17, 48, 37, 0.04);
    font-size: 0.78rem;
    color: var(--ds-light-text-color-light, rgba(80, 80, 80));
    width: min(620px, 92%);
    max-width: 100%;
    position: relative;
    z-index: 2;
}
.ds-rma-event-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 1.75rem;
    background: rgba(17, 48, 37, 0.08);
    color: var(--ds-primary-color, rgb(17, 48, 37));
}
.ds-rma-event-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.ds-rma-event-actor {
    font-weight: 500;
    color: var(--ds-dark-text-color, #1c1c1c);
}
.ds-rma-event-main {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}
.ds-rma-event-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.72rem;
}
.ds-rma-event-date {
    color: var(--ds-light-text-color-light, rgba(80, 80, 80));
}


/* --- 7. Guest login (rmalogin.twig) --- */
.ds-rma-login-option {
    display: block;
    padding: 1rem 1.25rem;
    border: 1px solid var(--ds-border-color-light, #F2F2F2);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: var(--ds-main-transition, 0.3s ease-out);
    position: relative;
}
.ds-rma-login-option:hover {
    border-color: var(--ds-primary-color, rgb(17, 48, 37));
    background: var(--ds-primary-light-color-light, #f9f8f5);
}
.ds-rma-login-option input[type="radio"] {
    margin-right: 0.75rem;
    accent-color: var(--ds-primary-color, rgb(17, 48, 37));
}
.ds-rma-login-option input[type="radio"]:checked ~ .ds-rma-login-option-text {
    font-weight: 500;
}

/* --- 8. Notices --- */
.ds-rma-notice {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--ds-border-color-light, #F2F2F2);
    margin-top: 1rem;
}
.ds-rma-notice svg {
    flex-shrink: 0;
    margin-right: 0.5rem;
}
.ds-rma-notice--warranty {
    background: #fffdf5;
    border-color: var(--ds-yellow-color, #d47f00);
    color: var(--ds-dark-text-color, #1c1c1c);
}
.ds-rma-notice--account-match {
    background: var(--ds-body-bg-light-color);
    border-color: var(--ds-blue-color);
    color: var(--ds-dark-text-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.ds-rma-notice--account-match .ds-rma-notice-text {
    margin: 0;
    flex: 1 1 auto;
}
.ds-rma-notice--account-match .ds-rma-notice-action {
    align-self: flex-start;
}
@media (min-width: 768px) {
    .ds-rma-notice--account-match {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .ds-rma-notice--account-match .ds-rma-notice-action {
        align-self: auto;
        flex-shrink: 0;
    }
}
/* Guest "log in to see all your returns" notice on /account/return. Sits
   between the page-header buttons and the RMA list, so it needs enough
   vertical space that it doesn't get visually swallowed by either. */
.ds-rma-account-hint {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: var(--ds-primary-light-color-light, #f9f8f5);
    border: 1px solid var(--ds-border-color-light, #f2f2f2);
    border-left: 3px solid var(--ds-primary-color, rgb(17, 48, 37));
    color: var(--ds-dark-text-color, #1c1c1c);
    line-height: 1.5;
}
.ds-rma-account-hint-icon {
    flex-shrink: 0;
    color: var(--ds-primary-color);
    margin-top: 0.15rem;
}
.ds-rma-account-hint-link {
    color: var(--ds-primary-color);
    text-decoration: underline;
    white-space: nowrap;
    margin-left: 0.25rem;
}
.ds-rma-account-hint-link:hover {
    text-decoration: none;
}
.ds-rma-notice--expired {
    margin-top: 0.75rem;
    font-weight: 400;
    font-size: 0.875rem;
}
.ds-rma-notice--expired a {
    text-decoration: underline;
}
/* Page-level return-window notice — sits between the order picker and the
   product grid to explain why refund or exchange is no longer offered. */
.ds-rma-window-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #fffdf5;
    border-color: var(--ds-yellow-color, #d47f00);
    color: var(--ds-dark-text-color, #1c1c1c);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.ds-rma-window-notice .ds-rma-window-notice-icon {
    color: var(--ds-yellow-color, #d47f00);
    margin-right: 0;
    margin-top: 0.125rem;
}
.ds-rma-window-notice span {
    flex: 1 1 auto;
    min-width: 0;
}
.ds-rma-product-row--disabled .ds-rma-product-row-check,
.ds-rma-product-row--disabled .ds-rma-product-row-info h3 a,
.ds-rma-product-row--disabled .ds-pp-product-meta {
    opacity: 0.45;
    pointer-events: none;
}
.ds-rma-notice--active-return {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--ds-blue-color, #003c8a);
}
.ds-rma-notice--active-return a {
    color: var(--ds-primary-color, rgb(17, 48, 37));
    text-decoration: underline;
    font-weight: 500;
}


/* --- 10. Exchange field (addrma.twig) --- */
.ds-rma-exchange-field {
    border: 1px solid var(--ds-border-color-light, #F2F2F2);
    padding: 0.75rem 1rem;
    display: none;
    background: var(--ds-primary-light-color-light, #f9f8f5);
    align-items: center;
    flex-direction: row;
}
.ds-rma-exchange-field > div {
    width: 50%;
}

/* --- 11. Empty state --- */
.ds-rma-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}
.ds-rma-empty-state svg {
    color: var(--ds-light-text-color, rgba(80, 80, 80));
    margin-bottom: 1rem;
}
.ds-rma-empty-state p {
    color: var(--ds-light-text-color, rgba(80, 80, 80));
    margin-bottom: 1.5rem;
}

/* --- 12. Status badge --- */
.ds-rma-status-badge {
    font-weight: 500;
}

/* --- 13. Responsive --- */
@media (max-width: 767.98px) {
    /* Timeline collapses to single column */
    .ds-rma-thread::before {
        left: 1rem;
    }
    .ds-rma-message::after,
    .ds-rma-event::after {
        left: 1rem;
    }
    .ds-rma-message--admin,
    .ds-rma-message--customer {
        padding-left: 2.5rem;
        padding-right: 0;
        justify-content: flex-start;
    }
    .ds-rma-event {
        justify-content: flex-start;
        padding-left: 2.5rem;
    }
    .ds-rma-event-line {
        width: 100%;
    }
    .ds-rma-message--admin .ds-rma-message-bubble {
        border-left: 3px solid var(--ds-primary-color, rgb(17, 48, 37));
        border-right-width: 1px;
    }
    .ds-rma-message--customer .ds-rma-message-bubble {
        border-left: 3px solid #d4a837;
        border-right-width: 1px;
    }

    /* Product card mobile — keep image column, tighten padding. */
    .ds-rma-product-row .ds-rma-product-row-main.ds-pp-product-main {
        padding: 0.75rem;
    }
    .ds-rma-product-row-head {
        gap: 0.5rem;
    }

    /* Options row mobile */
    .ds-rma-product-row-options {
        flex-direction: column;
    }
    .ds-rma-product-row-options .qty,
    .ds-rma-product-row-options .type,
    .ds-rma-product-row-options .reason {
        width: 100%;
    }

    /* Exchange field mobile */
    .ds-rma-exchange-field {
        flex-direction: column;
    }
    .ds-rma-exchange-field > div {
        width: 100%;
    }
    .ds-rma-exchange-field div.describe-caption {
        margin-bottom: 0.5rem;
    }

    /* Filter grid mobile */
    .ds-rma-filters .col-md-3 {
        margin-bottom: 0.5rem;
    }

    /* Gallery mobile */
    .ds-rma-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    /* Hide mobile labels on desktop */
    .ds-rma-product-row-main .mobile-view {
        display: none;
    }

    /* Options row desktop */
    .ds-rma-product-row-options {
        display: none;
        flex-direction: row;
    }
}

/* --- 14. RMA list page action row (rma.twig) ---
   Houses the "Exit returns portal" outline button (mobile only) and the
   "Start a return request" primary button.

   Mobile: CSS Grid with auto-fit + minmax. Buttons are equal width by
   definition (1fr each), and the row collapses to a single column when the
   container can't fit two ~180px tracks. Long labels (e.g. Dutch
   "Retourenportaal verlaten" / German "Retourenanfrage starten") wrap
   inside the button instead of overflowing horizontally; align-items:
   stretch keeps both buttons the same height even when one wraps to two
   lines.

   Desktop (>=768px): flip to flex right-aligned. The logout is hidden by
   d-md-none and lives in the account sidebar, so the primary button sits
   alone at its natural width. */
.ds-rma-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    gap: 0.5rem;
    align-items: stretch;
}
.ds-rma-actions .button {
    width: 100%;
    text-align: center;
    white-space: normal;
}
@media (min-width: 768px) {
    .ds-rma-actions {
        display: flex;
        justify-content: flex-end;
    }
    .ds-rma-actions .button {
        width: auto;
        white-space: nowrap;
    }
}

/* Mobile: Exit + Request actions split the row 50/50 when they fit on one
   line. If a viewport is too narrow for both at their content width, the
   default flex min-width: auto forces the second button to wrap, and each
   one then grows to fill its own line. The button inside the <form> needs
   width: 100% so it fills the form-wrapped flex item. */
@media (max-width: 767.98px) {
    .ds-rma-hero-actions > * {
        flex: 1 1 calc(50% - 0.25rem);
    }
    .ds-rma-hero-actions > form > .button {
        width: 100%;
    }
}
