/* ── Try On Button ─────────────────────────────────────────── */
#rrto-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px 24px;
    background: transparent;
    border: 1px solid #1a1a1a;
    color: #1a1a1a;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
#rrto-btn:hover { background: #1a1a1a; color: #fff; }

/* ── Modal Overlay ─────────────────────────────────────────── */
#rrto-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.75);
    align-items: center;
    justify-content: center;
}
#rrto-modal.open { display: flex; }

/* ── Modal Box ─────────────────────────────────────────────── */
#rrto-modal-inner {
    background: #fff;
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 40px 36px 36px;
    position: relative;
}

/* ── Close ─────────────────────────────────────────────────── */
#rrto-close {
    position: absolute;
    top: 16px; right: 20px;
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    color: #666; line-height: 1;
}
#rrto-close:hover { color: #000; }

/* ── Heading ───────────────────────────────────────────────── */
#rrto-modal-inner h2 {
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0 0 4px;
    font-weight: 500;
    color: #1a1a1a;
}
#rrto-modal-inner p.rrto-sub {
    font-size: 12px;
    color: #999;
    margin: 0 0 24px;
}

/* ── Two Column Layout ─────────────────────────────────────── */
#rrto-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.rrto-col-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1a1a1a;
    margin: 0 0 10px;
    font-weight: 500;
}

/* ── Left: Photo Upload ────────────────────────────────────── */
#rrto-dropzone {
    border: 1px dashed #ccc;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
    background: #fafafa;
}
#rrto-dropzone:hover,
#rrto-dropzone.dragover { border-color: #1a1a1a; background: #f5f5f5; }
#rrto-dropzone input[type="file"] { display: none; }

#rrto-dropzone-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    padding: 20px;
}
#rrto-dropzone-empty p {
    margin: 0;
    font-size: 12px;
    color: #999;
}
#rrto-dropzone-empty .rrto-hint {
    font-size: 10px;
    color: #bbb;
}

#rrto-model-preview {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

#rrto-photo-tips {
    margin-top: 8px;
    font-size: 10px;
    color: #bbb;
    line-height: 1.6;
    letter-spacing: 0.03em;
}

/* ── Right: Garment Grid ───────────────────────────────────── */
#rrto-garment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
}

.rrto-garment-thumb {
    border: 2px solid transparent;
    cursor: pointer;
    aspect-ratio: 3/4;
    overflow: hidden;
    transition: border-color 0.15s;
    background: #f5f5f5;
}
.rrto-garment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.15s;
}
.rrto-garment-thumb:hover img { opacity: 0.85; }
.rrto-garment-thumb.selected {
    border-color: #1a1a1a;
}
.rrto-garment-thumb.selected img { opacity: 1; }

.rrto-no-images {
    font-size: 12px;
    color: #999;
    grid-column: 1/-1;
}

/* ── Submit ────────────────────────────────────────────────── */
#rrto-submit {
    display: block;
    width: 100%;
    padding: 14px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.2s;
}
#rrto-submit:hover { opacity: 0.85; }
#rrto-submit:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Status ────────────────────────────────────────────────── */
#rrto-status {
    display: none;
    text-align: center;
    padding: 60px 0;
}
.rrto-spinner {
    width: 32px; height: 32px;
    border: 2px solid #e0e0e0;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: rrto-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes rrto-spin { to { transform: rotate(360deg); } }
#rrto-status p {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #999;
    margin: 0;
}

/* ── Result ────────────────────────────────────────────────── */
#rrto-result {
    display: none;
    text-align: center;
}
#rrto-result img {
    width: 100%;
    max-width: 360px;
    display: block;
    margin: 0 auto 20px;
}
#rrto-result-actions {
    display: flex;
    gap: 12px;
    max-width: 360px;
    margin: 0 auto;
}
#rrto-result-actions a,
#rrto-result-actions button {
    flex: 1; padding: 12px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
#rrto-dl { background: #1a1a1a; color: #fff; border: none; }
#rrto-dl:hover { opacity: 0.85; }
#rrto-retry { background: transparent; color: #1a1a1a; border: 1px solid #1a1a1a; }
#rrto-retry:hover { background: #1a1a1a; color: #fff; }

/* ── Error ─────────────────────────────────────────────────── */
#rrto-error {
    display: none;
    background: #fff5f5;
    border: 1px solid #ffd7d7;
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 12px;
    color: #c00;
    text-align: center;
}
#rrto-error.visible { display: block; }

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 600px) {
    #rrto-modal-inner { padding: 28px 16px 24px; max-height: 95vh; }
    #rrto-two-col { grid-template-columns: 1fr; }
    #rrto-garment-grid { grid-template-columns: repeat(3, 1fr); max-height: 200px; }
}
