/* AI try-on card + sheet (product page). Mobile-first. See docs/feature/ai-try-on/. */
.tryon-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin: 14px 0 0;
    padding: 12px;
    border: 1px solid #cfe3e1;
    border-radius: 18px;
    background: linear-gradient(135deg, #eef7f6 0%, #fff 70%);
    box-shadow: 0 10px 30px rgba(32, 48, 40, .06);
}
.tryon-card__media {
    position: relative;
    display: block;
    width: 112px;
    height: 112px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: #e3f0ef;
    cursor: pointer;
}
.tryon-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: 25% 30%; transition: transform .4s; }
.tryon-card__media:hover img { transform: scale(1.05); }
.tryon-card__badge {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(33, 37, 41, .82);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .03em;
}
.tryon-card__title { margin: 0 0 4px; color: #24292c; font-size: 1rem; font-weight: 700; line-height: 1.3; }
.tryon-card__text { margin: 0 0 10px; color: #4c6664; font-size: .78rem; line-height: 1.45; }
.tryon-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: .6rem .9rem;
    border: 0;
    border-radius: 12px;
    background: #338986;
    color: #fff;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.tryon-card__cta:hover { background: #23726e; transform: translateY(-1px); }
@media (min-width: 576px) {
    .tryon-card { grid-template-columns: 150px minmax(0, 1fr); padding: 14px; }
    .tryon-card__media { width: 150px; height: 120px; }
    .tryon-card__cta { width: auto; }
}

/* Sheet: bottom sheet on mobile, centred card on desktop */
body.tryon-lock { overflow: hidden; }
.tryon-sheet { position: fixed; inset: 0; z-index: 100050; }
.tryon-sheet[hidden] { display: none; }
.tryon-sheet__backdrop { position: absolute; inset: 0; background: rgba(20, 26, 24, .55); opacity: 0; transition: opacity .2s; }
.tryon-sheet.is-open .tryon-sheet__backdrop { opacity: 1; }
.tryon-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 94vh;
    max-height: 94dvh;
    overflow-y: auto;
    padding: 0 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    background: #fff;
    outline: none;
    transform: translateY(100%);
    transition: transform .22s ease-out;
    -webkit-overflow-scrolling: touch;
}
.tryon-sheet.is-open .tryon-sheet__panel { transform: translateY(0); }
@media (min-width: 768px) {
    .tryon-sheet__panel {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        width: 560px;
        max-height: 92vh;
        padding: 0 24px 24px;
        border-radius: 20px;
        transform: translate(-50%, -46%);
        opacity: 0;
        transition: transform .2s, opacity .2s;
    }
    .tryon-sheet.is-open .tryon-sheet__panel { transform: translate(-50%, -50%); opacity: 1; }
}
.tryon-sheet__head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 -16px 12px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #eef1ef;
    background: #fff;
}
@media (min-width: 768px) { .tryon-sheet__head { margin: 0 -24px 16px; padding: 16px 24px 12px; } }
.tryon-sheet__thumb { flex: 0 0 44px; width: 44px; height: 44px; object-fit: cover; border-radius: 10px; border: 1px solid #e5e8e4; }
.tryon-sheet__headtext { flex: 1; min-width: 0; }
.tryon-sheet__headtext strong { display: block; color: #24292c; font-size: .98rem; line-height: 1.25; }
.tryon-sheet__headtext span { display: block; overflow: hidden; color: #677788; font-size: .76rem; white-space: nowrap; text-overflow: ellipsis; }
.tryon-sheet__close { flex: 0 0 40px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f1f4f3; color: #24292c; font-size: 1.1rem; cursor: pointer; }

/* Step: photo + email */
.tryon-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 190px;
    margin: 0;
    overflow: hidden;
    border: 2px dashed #9cc9c5;
    border-radius: 16px;
    background: #f3f9f8;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.tryon-drop:hover { border-color: #338986; background: #eaf5f4; }
.tryon-drop.has-photo { display: block; min-height: 0; border-style: solid; border-color: #e5e8e4; background: #000; }
.tryon-drop__empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px; text-align: center; color: #24292c; }
.tryon-drop.has-photo .tryon-drop__empty { display: none; }
.tryon-drop__icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 4px; border-radius: 50%; background: #338986; color: #fff; font-size: 1.35rem; box-shadow: 0 8px 20px rgba(51, 137, 134, .3); }
.tryon-drop__empty strong { font-size: .95rem; line-height: 1.35; }
.tryon-drop__empty small { color: #677788; font-size: .72rem; }
.tryon-drop__preview { display: block; width: 100%; max-height: 42vh; object-fit: contain; }
.tryon-drop__change { position: absolute; right: 10px; bottom: 10px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #24292c; font-size: .74rem; font-weight: 600; }
.tryon-tip { margin: 8px 0 0; color: #677788; font-size: .74rem; line-height: 1.45; }
.tryon-tip .far { color: #f09319; }
.tryon-fields { margin-top: 14px; }
.tryon-label { display: block; margin: 0 0 6px; color: #24292c; font-size: .84rem; font-weight: 600; }
.tryon-input { height: 50px; border-radius: 12px; font-size: 16px; }
.tryon-hint { margin: 6px 0 0; color: #677788; font-size: .72rem; line-height: 1.45; }
.tryon-check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; color: #3c4a46; font-size: .8rem; line-height: 1.45; cursor: pointer; }
.tryon-check input { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; accent-color: #338986; }
.tryon-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #fdeaea; color: #a02727; font-size: .82rem; }
.tryon-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 54px;
    margin-top: 14px;
    border: 0;
    border-radius: 12px;
    background: #f09319;
    color: #212529;
    font-size: 1.02rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(240, 147, 25, .3);
}
.tryon-submit:disabled { opacity: .6; cursor: wait; }
.tryon-privacy { margin: 10px 0 0; color: #8a9692; font-size: .7rem; text-align: center; }

/* Step: loading */
.tryon-loading { padding: 4px 0 8px; text-align: center; }
.tryon-loading__frame { position: relative; overflow: hidden; margin-bottom: 16px; border-radius: 16px; background: #000; }
.tryon-loading__frame img { display: block; width: 100%; max-height: 40vh; object-fit: contain; filter: saturate(.6) brightness(.85); }
.tryon-loading__scan {
    position: absolute;
    left: 0;
    right: 0;
    top: -40%;
    height: 40%;
    background: linear-gradient(180deg, rgba(51, 137, 134, 0) 0%, rgba(120, 220, 210, .45) 85%, rgba(255, 255, 255, .9) 100%);
    animation: tryon-scan 2.2s ease-in-out infinite;
}
@keyframes tryon-scan { 0% { top: -40%; } 100% { top: 100%; } }
@media (prefers-reduced-motion: reduce) { .tryon-loading__scan { animation: none; } }
.tryon-loading__title { display: block; color: #24292c; font-size: 1.02rem; }
.tryon-loading__step { display: block; min-height: 1.4em; margin-top: 4px; color: #338986; font-size: .86rem; font-weight: 600; }
.tryon-progress { height: 6px; margin: 14px 0 4px; overflow: hidden; border-radius: 999px; background: #e3f0ef; }
.tryon-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #338986, #f09319); transition: width .4s linear; }

/* Step: result */
.tryon-compare { position: relative; overflow: hidden; border-radius: 16px; background: #000; user-select: none; -webkit-user-select: none; }
.tryon-compare img { display: block; width: 100%; max-height: 52vh; object-fit: contain; }
.tryon-compare__before { position: absolute; inset: 0; height: 100%; opacity: 0; transition: opacity .15s; }
.tryon-compare.show-before .tryon-compare__before { opacity: 1; }
.tryon-compare__label { position: absolute; left: 10px; top: 10px; padding: 4px 9px; border-radius: 999px; background: rgba(33, 37, 41, .8); color: #fff; font-size: .7rem; font-weight: 700; }
.tryon-compare__toggle {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: #24292c;
    font-size: .74rem;
    font-weight: 700;
    touch-action: none;
    cursor: pointer;
}
.tryon-buy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 56px;
    margin-top: 12px;
    padding: .8rem 1rem;
    border-radius: 12px;
    background: #f09319;
    color: #212529 !important;
    font-size: 1.04rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none !important;
    box-shadow: 0 8px 22px rgba(240, 147, 25, .32);
}
.tryon-buy:hover { background: #e2850c; }
.tryon-buy-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 0; }
.tryon-buy-meta:empty { display: none; }
.tryon-save, .tryon-coupon { padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.tryon-save { background: #e7f6ed; color: #1f8a4c; }
.tryon-coupon { background: #fff3df; color: #8a5a14; }
.tryon-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.tryon-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 46px;
    padding: .5rem .6rem;
    border: 2px solid #338986;
    border-radius: 12px;
    background: #fff;
    color: #23726e !important;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
}
.tryon-emailed { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: #eef7f6; color: #23726e; font-size: .78rem; }
.tryon-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
/* app.css forces orange text on a:hover:not(.btn) with !important; keep CTA text readable. */
.tryon-sheet a.tryon-buy:hover, .tryon-sheet a.tryon-buy:focus { color: #212529 !important; }
.tryon-sheet a.tryon-secondary:hover, .tryon-sheet a.tryon-secondary:focus { color: #23726e !important; background: #eef7f6; }
.tryon-secondary:hover { background: #eef7f6; }
