/* GAMA SAV — customer reply box. Mobile-first: base styles target small
   screens, larger screens get more breathing room via the min-width query. */

.gama-reply-box {
    margin-top: 24px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.gama-reply-title {
    margin: 0 0 12px;
    font-size: 15px;
    color: #1e293b;
}

.gama-reply-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px; /* avoids iOS auto-zoom on focus */
    resize: vertical;
    margin-bottom: 12px;
}

.gama-reply-file-label {
    display: block;
    font-size: 13px;
    color: #475569;
    margin-bottom: 14px;
}

.gama-reply-file-label input[type="file"] {
    display: block;
    width: 100%;
    margin-top: 6px;
    font-size: 13px;
}

.gama-reply-submit {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    background: #1d4ed8; /* GAMA brand blue */
    border-color: #1d4ed8;
    color: #ffffff;
}

.gama-reply-submit:hover,
.gama-reply-submit:focus {
    background: #f97316; /* GAMA brand orange on hover — visual identity accent */
    border-color: #f97316;
    color: #ffffff;
}

@media (min-width: 600px) {
    .gama-reply-box {
        padding: 20px 24px;
    }

    .gama-reply-submit {
        width: auto;
        padding: 10px 28px;
    }
}

/* ==========================================================================
   Message thread visual distinction (customer view). Added via JS which
   tags each ClaimPress timeline item with a data-gama-author attribute
   ("admin" or "customer") — see assets/js/customer-timeline-style.js.
   Uses !important because ClaimPress renders these bubbles with inline
   styles, which otherwise win over plain CSS specificity.
   ========================================================================== */
.claimpress-timeline-item[data-gama-author="admin"] > div[style*="f8fafc"] {
    background: #eff6ff !important;
    border-left: 4px solid #1d4ed8 !important;
}

.claimpress-timeline-item[data-gama-author="customer"] > div[style*="f8fafc"] {
    background: #fff7ed !important;
    border-left: 4px solid #f97316 !important;
}

.gama-author-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
}

.gama-author-tag--admin {
    background: #dbeafe;
    color: #1d4ed8;
}

.gama-author-tag--customer {
    background: #ffedd5;
    color: #c2410c;
}

/* Message bubble text + links — bump readability slightly and make sure
   attachment links are clearly a link (blue, underlined) regardless of
   any theme reset that strips default anchor styling. */
.claimpress-timeline-item div[style*="f8fafc"] {
    font-size: 14.5px !important;
    line-height: 1.6 !important;
}

.claimpress-timeline-item div[style*="f8fafc"] a {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
    font-weight: 600;
}

.claimpress-timeline-item div[style*="f8fafc"] a:hover {
    color: #f97316 !important;
}

/* ==========================================================================
   Mobile-responsive claims table. ClaimPress's `.claimpress-warrantied-table`
   is a plain HTML table with no responsive behavior. This is pure CSS —
   no JS dependency — so it applies reliably regardless of script loading
   order, caching, or defer/async settings on the site. Desktop layout
   (above 700px) is completely untouched; nothing here changes it.
   responsive-claims-table.js still runs, opportunistically, to add
   data-label text (the little bold captions like "Commande", "Produit")
   next to each value — if it doesn't run for any reason, the cards below
   still stack correctly, just without those captions.
   ========================================================================== */
@media (max-width: 700px) {
    .claimpress-warrantied-table thead {
        display: none;
    }

    .claimpress-warrantied-table,
    .claimpress-warrantied-table tbody,
    .claimpress-warrantied-table tr,
    .claimpress-warrantied-table td {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .claimpress-warrantied-table {
        border: none !important;
    }

    .claimpress-warrantied-table tr {
        margin-bottom: 14px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 10px 14px;
        background: #fff;
    }

    .claimpress-warrantied-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        text-align: right !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    .claimpress-warrantied-table td:last-child {
        border-bottom: none;
    }

    .claimpress-warrantied-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        color: #475569;
        text-align: left;
        flex-shrink: 0;
    }

    /* Belt-and-suspenders: even if some other element still forces width,
       never let horizontal overflow escape the viewport. */
    .claimpress-warrantied-table,
    .woocommerce-MyAccount-content {
        overflow-x: hidden;
        max-width: 100vw;
    }
}

/* Guest lookup form: note under order-number field (guest-form-simplify.js) */
.gama-order-note {
    margin: 8px 0 0 !important;
    font-size: 12.5px !important;
    line-height: 1.5 !important;
    color: #64748b !important;
}

.gama-order-note a {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}
