/*
 * Trade-in box and wizard.
 *
 * Kept out of product.css on purpose: production serves bundles/style.min.css, which is
 * built by webpack, so anything added to product.css stays invisible until someone reruns
 * `npm run build`. It also cannot live in a <style> block in the partial - the partial sits
 * inside the Vue root #app, and Vue 2 strips <style> tags from templates when it mounts.
 *
 * Logical properties (margin-inline-start etc.) are used throughout so Arabic lays out
 * correctly without a separate RTL file.
 */

.tradein-box {
    --tradein-accent: var(--colorHighlight1, #ff5a00);
    --tradein-accent-hover: var(--colorHighlight1-hover, #e65000);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 1rem;
    border: 1px solid #ffd9c2;
    border-radius: 12px;
    background: linear-gradient(90deg, #fff7f2, #fff1e8);
}

.tradein-box__icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--tradein-accent);
}

.tradein-box__text {
    flex: 1 1 auto;
    min-width: 0;
}

.tradein-box__title {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #222;
}

.tradein-box__subtitle {
    display: block;
    font-size: 12px;
    color: #6b7785;
}

.tradein-box__cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: var(--tradein-accent);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
}

.tradein-box__cta:hover {
    background: var(--tradein-accent-hover);
}

[dir="rtl"] .tradein-chevron {
    transform: scaleX(-1);
}

/* ---------- modal ---------- */

.tradein-modal {
    --tradein-accent: var(--colorHighlight1, #ff5a00);
    --tradein-accent-hover: var(--colorHighlight1-hover, #e65000);
    padding: 20px;
}

.tradein-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tradein-modal__brand {
    font-weight: 700;
    font-size: 18px;
    color: var(--tradein-accent);
}

.tradein-modal__close {
    border: 0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: #555;
    cursor: pointer;
}

/* stepper */
.tradein-steps {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.tradein-steps li {
    position: relative;
    flex: 1 1 0;
    text-align: center;
    font-size: 12px;
    color: #9aa3ad;
}

.tradein-steps li::before {
    content: "";
    position: absolute;
    top: 13px;
    inset-inline-start: -50%;
    width: 100%;
    height: 2px;
    background: #e3e6ea;
    z-index: 0;
}

.tradein-steps li:first-child::before {
    display: none;
}

.tradein-steps li.is-done::before,
.tradein-steps li.is-current::before {
    background: var(--tradein-accent);
}

.tradein-steps__dot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 auto 6px;
    border-radius: 50%;
    background: #eef0f3;
    color: #8a939d;
    font-weight: 600;
}

.tradein-steps li.is-done .tradein-steps__dot,
.tradein-steps li.is-current .tradein-steps__dot {
    background: var(--tradein-accent);
    color: #fff;
}

.tradein-steps li.is-current {
    color: #222;
    font-weight: 600;
}

.tradein-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #222;
}

.tradein-subtitle {
    margin: 0 0 16px;
    font-size: 13px;
    color: #6b7785;
}

.tradein-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

/* a short accent rule before the wording, so a group reads as a group at a glance */
.tradein-section-label::before {
    content: "";
    flex: 0 0 auto;
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--tradein-accent);
}

/* and a hairline after it, carrying the eye across the row it heads */
.tradein-section-label::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: #eceff2;
}

/* step 1: device cards */
.tradein-devices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.tradein-device {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 120px;
    padding: 12px 8px;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.tradein-device:hover {
    border-color: #ffc4a3;
}

.tradein-device.is-selected {
    border-color: var(--tradein-accent);
    box-shadow: 0 0 0 1px var(--tradein-accent);
}

.tradein-device img {
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
}

.tradein-device__check {
    position: absolute;
    top: 6px;
    inset-inline-end: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tradein-accent);
    color: #fff;
}

/* step 2 / 4: summaries */
.tradein-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
}

/*
 * A block of the review step: the card is the panel, so what sits inside it - the device
 * strip, the answers - drops its own border and keeps only the line that separates them.
 */
.tradein-panel {
    margin-bottom: 16px;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.tradein-summary--bare {
    margin-bottom: 0;
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid #eceff2;
    background: #fafbfc;
}

.tradein-panel__change {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: none;
}

.tradein-summary img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.tradein-summary__body {
    flex: 1 1 auto;
    min-width: 0;
}

.tradein-summary__name {
    display: block;
    font-weight: 600;
    color: #222;
}

.tradein-summary__meta {
    display: block;
    font-size: 12px;
    color: #6b7785;
}

.tradein-link {
    font-size: 13px;
    color: var(--tradein-accent) !important;
    text-decoration: underline;
    cursor: pointer;
}

.tradein-conditions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 12px;
    align-items: start;
}

/* the question's own label, not the labels wrapping each option inside it */
.tradein-field > label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #3d4852;
}

/* "(optional)" is an aside, not part of the question */
.tradein-field > label small {
    font-weight: 400;
}

.tradein-hint {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    margin-top: 16px;
    border-radius: 8px;
    background: #eef4fb;
    font-size: 12px;
    color: #3b5670;
}

.tradein-review {
    width: 100%;
    margin-bottom: 0;
    font-size: 13px;
}

.tradein-review th,
.tradein-review td {
    padding: 9px 14px;
    border-top: 1px solid #f1f3f5;
    vertical-align: top;
}

.tradein-review tr:first-child th,
.tradein-review tr:first-child td {
    border-top: 0;
}

.tradein-review th {
    width: 38%;
    font-weight: 400;
    color: #6b7785;
    text-align: start;
}

.tradein-review td {
    color: #222;
    /* an answer the customer typed can be one long word; it wraps rather than widening the box */
    overflow-wrap: anywhere;
}

/* the panel has its own padding, so the last row must not add more below itself */
.tradein-panel .tradein-review tr:last-child th,
.tradein-panel .tradein-review tr:last-child td {
    padding-bottom: 12px;
}

/* step 3: photos */
.tradein-photos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.tradein-photo {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    aspect-ratio: 1 / 1;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    overflow: hidden;
    background: #fafbfc;
    font-size: 12px;
    color: #6b7785;
}

.tradein-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tradein-photo.is-empty {
    border-style: dashed;
    cursor: pointer;
}

.tradein-photo.is-empty:hover {
    border-color: var(--tradein-accent);
    color: var(--tradein-accent);
}

.tradein-photo__remove {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    line-height: 1;
    cursor: pointer;
}

.tradein-thumbs {
    display: flex;
    gap: 6px;
}

.tradein-thumbs img,
.tradein-thumbs span {
    width: 44px;
    height: 44px;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    object-fit: cover;
}

.tradein-thumbs span {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef0f3;
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

/* step 5: verification */
.tradein-otp {
    max-width: 220px;
    margin: 12px auto;
    font-size: 26px;
    letter-spacing: 10px;
    text-align: center;
}

/* step 6: result */
.tradein-done {
    text-align: center;
}

.tradein-done .tradein-section-label {
    text-align: start;
}

.tradein-done__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #e9f7ef;
    color: #2e9e5b;
}

.tradein-done__number {
    display: inline-block;
    padding: 4px 12px;
    margin: 8px 0 16px;
    border-radius: 6px;
    background: #fff1e8;
    font-weight: 700;
    color: var(--tradein-accent);
}

.tradein-next {
    padding: 0;
    margin: 16px 0 0;
    list-style: none;
    text-align: start;
}

.tradein-next li {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: #444;
}

.tradein-next__num {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--tradein-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* footer */
.tradein-error {
    padding: 8px 12px;
    margin-top: 14px;
    border-radius: 8px;
    background: #fdecee;
    font-size: 13px;
    color: #b42334;
}

.tradein-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.tradein-btn {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--tradein-accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.tradein-btn:hover:not(:disabled) {
    background: var(--tradein-accent-hover);
}

.tradein-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.tradein-btn--secondary {
    flex: 0 0 auto;
    background: #eef0f3;
    color: #333;
}

.tradein-btn--secondary:hover:not(:disabled) {
    background: #e2e5e9;
}

.tradein-secure {
    margin-top: 10px;
    font-size: 11px;
    color: #8a939d;
    text-align: center;
}

@media (max-width: 575px) {
    .tradein-box {
        flex-wrap: wrap;
    }

    .tradein-box__cta {
        width: 100%;
        justify-content: center;
    }

    .tradein-devices,
    .tradein-photos {
        grid-template-columns: repeat(2, 1fr);
    }

    .tradein-conditions {
        grid-template-columns: 1fr;
    }

    /*
     * On a narrow screen a question and its answer stop competing for one row: the question
     * goes above, as a small grey line, and the answer sits under it. Side by side, a long
     * question like "Is Find My or activation lock on?" is squeezed into one word per line.
     */
    .tradein-review tr {
        display: block;
        border-top: 1px solid #f1f3f5;
    }

    .tradein-review tr:first-child {
        border-top: 0;
    }

    .tradein-review th,
    .tradein-review td {
        display: block;
        width: auto;
        border-top: 0;
    }

    .tradein-review th {
        padding-bottom: 0;
        font-size: 12px;
    }

    .tradein-review td {
        padding-top: 2px;
    }
}

/* ---------------------------------------------------------------- account: My trade-ins */

.tradein-account-number {
    font-weight: 600;
    white-space: nowrap;
}

/* customer-typed text: keep their line breaks, never let a long word break the layout */
.tradein-account-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.tradein-progress {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.tradein-progress__step {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-size: .8rem;
    color: #6c757d;
}

/* the connecting line to the previous step */
.tradein-progress__step + .tradein-progress__step::before {
    content: "";
    position: absolute;
    top: 7px;
    inset-inline-end: 50%;
    width: 100%;
    height: 2px;
    background: #dee2e6;
}

.tradein-progress__dot {
    position: relative;
    z-index: 1;
    width: 16px;
    height: 16px;
    margin-bottom: 6px;
    border: 2px solid #ced4da;
    border-radius: 50%;
    background: #fff;
}

.tradein-progress__step--done .tradein-progress__dot {
    border-color: #28a745;
    background: #28a745;
}

.tradein-progress__step--done + .tradein-progress__step::before {
    background: #28a745;
}

.tradein-progress__step--current {
    color: #212529;
    font-weight: 600;
}

.tradein-progress__step--current .tradein-progress__dot {
    border-color: #17a2b8;
    box-shadow: 0 0 0 4px rgba(23, 162, 184, .2);
}

.tradein-progress__step--failed {
    color: #dc3545;
    font-weight: 600;
}

.tradein-progress__step--failed .tradein-progress__dot {
    border-color: #dc3545;
    background: #dc3545;
}

.tradein-account-dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 1rem;
    row-gap: .35rem;
}

.tradein-account-dl dt {
    font-weight: 500;
    color: #6c757d;
}

.tradein-account-dl dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.tradein-account-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tradein-account-photos img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.tradein-done__link {
    display: inline-block;
    margin-top: .75rem;
}

/* ---------------------------------------------------------------- dynamic form
   The questions come from the category the customer picked, so these styles have to
   cope with any mixture of dropdowns, radio lists, checkbox lists and text boxes. */

.tradein-loading {
    padding: 28px 0;
    text-align: center;
    color: #6b7785;
}

/* a radio or checkbox list reads better full width than squeezed into the grid */
/*
 * Options a customer picks between - "what works", "is Find My off" - as tiles rather than a
 * run of bare radios. The whole tile is the target, which matters most on a phone, and the
 * tiles sit on a grid so a list of seven does not wrap into ragged columns.
 *
 * The native input stays in the markup and keeps working: it is made invisible rather than
 * display:none, so it still takes focus, still answers the keyboard and is still what a
 * screen reader announces. The ring around a focused tile is its focus ring.
 */
.tradein-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.tradein-choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    color: #333;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.tradein-choice:hover {
    border-color: #ffc4a3;
    background: #fffaf6;
}

/* the control itself: drawn here, so it looks the same in every browser */
.tradein-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.tradein-choice::before {
    content: "";
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 2px solid #c9ced4;
    background: #fff;
    transition: border-color .15s, background .15s;
}

/* round for "pick one", square for "pick any": the shape says which it is before it is read */
.tradein-choice:has(input[type="radio"])::before {
    border-radius: 50%;
}

.tradein-choice:has(input[type="checkbox"])::before {
    border-radius: 5px;
}

.tradein-choice:has(input:checked) {
    border-color: var(--tradein-accent);
    background: #fff7f2;
    box-shadow: 0 0 0 1px var(--tradein-accent);
}

.tradein-choice:has(input:checked)::before {
    border-color: var(--tradein-accent);
    background: var(--tradein-accent);
}

/* the dot inside a chosen radio, the tick inside a chosen checkbox */
.tradein-choice::after {
    content: "";
    position: absolute;
    inset-inline-start: 12px;
    opacity: 0;
    transition: opacity .15s;
}

.tradein-choice:has(input[type="radio"]:checked)::after {
    width: 6px;
    height: 6px;
    margin-inline-start: 6px;
    border-radius: 50%;
    background: #fff;
    opacity: 1;
}

.tradein-choice:has(input[type="checkbox"]:checked)::after {
    width: 5px;
    height: 9px;
    margin-inline-start: 6px;
    margin-top: -2px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 1;
}

.tradein-choice:has(input:focus-visible) {
    box-shadow: 0 0 0 3px rgba(255, 90, 0, .25);
}

/*
 * Browsers without :has - Firefox before 121, older Safari - get the native control back
 * rather than a tile with no visible state at all.
 */
@supports not selector(:has(*)) {
    .tradein-choice::before,
    .tradein-choice::after {
        display: none;
    }

    .tradein-choice input {
        position: static;
        width: auto;
        height: auto;
        opacity: 1;
        pointer-events: auto;
    }
}

/* a checklist carries a lot of options, so it takes the full row rather than half of it */
.tradein-field.is-wide {
    grid-column: 1 / -1;
}

/* ---------------------------------------------------------------- named photo slots */

.tradein-photo-slot {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tradein-photo-slot .tradein-photo {
    width: 100%;
}

.tradein-photo-slot__label {
    font-size: 12px;
    line-height: 1.3;
    color: #6b7785;
    text-align: center;
}

.tradein-required {
    margin-inline-start: 2px;
    color: #d0021b;
}

/* ---------------------------------------------------------------- answers on the account page */

.tradein-account-group {
    margin: 14px 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.tradein-account-group:first-of-type {
    margin-top: 8px;
}

.tradein-account-photos figure {
    margin: 0;
}

.tradein-account-photos figcaption {
    margin-top: 4px;
    font-size: 11px;
    color: #6b7785;
    text-align: center;
}

/* shown when no category has a form set up yet - better than an empty grid */
.tradein-empty {
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
    color: #6b7785;
}

/* the terms tick on the review step, built like the cart's */
.tradein-terms {
    padding: 12px 14px;
    margin-top: 16px;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.tradein-terms:hover {
    border-color: #ffc4a3;
}

/*
 * Bootstrap-Vue draws the tick, so it is styled where it lands rather than redrawn: the
 * store's own accent instead of Bootstrap blue, and the whole box answers to it, the way an
 * option tile on step 2 does.
 */
.tradein-terms .custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--tradein-accent);
    background-color: var(--tradein-accent);
}

.tradein-terms .custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px rgba(255, 90, 0, .25);
}

.tradein-terms:has(.custom-control-input:checked) {
    border-color: var(--tradein-accent);
    background: #fff7f2;
    box-shadow: 0 0 0 1px var(--tradein-accent);
}

.tradein-terms .custom-control-label {
    cursor: pointer;
}

.tradein-terms a,
.tradein-terms .read {
    text-decoration: underline;
    cursor: pointer;
}

.tradein-terms .alert {
    font-size: 12px;
    margin-bottom: 0 !important;
}