/* ИИ-примерка: кнопка на карточках товара и модальное окно выбора.
   Цвета — фирменные (--kaspi-red = #0f46b9 и --kaspi-blue = #0984e3), без фиолетового. */

:root {
    --tryon-1: #0f46b9;
    --tryon-2: #0984e3;
}

.tryon-wrap {
    position: relative;
    display: flex;
    flex: 1 1 100%;
    width: 100%;
}

/* Кнопка «Примерить» стоит первой в .product-info — прямо под фото товара.
   Прижимаем её к фото (без верхнего зазора) и даём небольшой отступ до названия. */
.product-info > .tryon-wrap:first-child { margin: -2px 0 8px; }
.product-card { overflow: visible !important; }
.product-image-container { overflow: hidden; border-radius: var(--border-radius, 12px) var(--border-radius, 12px) 0 0; }

.tryon-btn {
    background: linear-gradient(135deg, var(--tryon-1), var(--tryon-2));
    color: #fff;
    border: none;
    border-radius: var(--border-radius-sm, 8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
    transition: transform .15s;
    -webkit-tap-highlight-color: transparent;
}

.tryon-btn:active { transform: scale(.97); }
.tryon-btn i { font-size: 15px; }

/* Карточка в сетке каталога */
.tryon-btn-card { padding: 9px 10px; font-size: 13px; line-height: 1.2; }

/* Страница товара — крупнее */
.tryon-btn-hero {
    padding: 12px 16px;
    font-size: 15px;
    box-shadow: 0 4px 14px rgba(15, 70, 185, .28);
}

/* Если у страницы .product-actions — flex, кнопка занимает свою строку */
.product-actions { flex-wrap: wrap; }

.tryon-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #fff;
    color: var(--tryon-1);
    border: 2px solid var(--tryon-1);
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    line-height: 14px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ---------------------------------------------------------------- модалка */

.tryon-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 5000;
    align-items: flex-end;
    justify-content: center;
}

.tryon-modal.show { display: flex; }

.tryon-sheet {
    background: #fff;
    width: 100%;
    max-width: 520px;
    border-radius: 18px 18px 0 0;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
    animation: tryonUp .22s ease-out;
    text-align: center;
}

@keyframes tryonUp {
    from { transform: translateY(30px); opacity: .5; }
    to   { transform: none; opacity: 1; }
}

.tryon-sheet h3 { margin: 0 0 4px; font-size: 18px; color: #2d3436; }
.tryon-sheet p  { margin: 0 0 16px; font-size: 13px; color: #636e72; }

.tryon-ico {
    width: 54px; height: 54px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff;
    background: linear-gradient(135deg, var(--tryon-1), var(--tryon-2));
}

.tryon-acts { display: flex; flex-direction: column; gap: 10px; }
.tryon-acts button {
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.tryon-go   { background: linear-gradient(135deg, var(--tryon-1), var(--tryon-2)); color: #fff; }
.tryon-more { background: #f1f2f6; color: #2d3436; }

@media (min-width: 560px) {
    .tryon-modal { align-items: center; }
    .tryon-sheet { border-radius: 18px; padding-bottom: 22px; }
}
