dialog.bottom-sheet {
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0;
    margin: auto 0 0 0;
    border-radius: 32px 32px 0 0;
    max-width: 100%;
    width: 100%;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
    will-change: transform;
}

dialog.bottom-sheet::backdrop {
    background: rgba(0, 0, 0, 0);
    transition: background 0.5s ease; /* Оригинальный стабильный транзишен */
}

dialog.bottom-sheet[open]::backdrop {
    background: rgba(0, 0, 0, 0.5); /* Чуть темнее для контраста */
}

dialog.bottom-sheet.closing-backdrop::backdrop {
    background: rgba(0, 0, 0, 0) !important;
}

.sheet-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 24px; 
    position: relative;
}

.sheet-header::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 5px;
    background: rgba(0,0,0,0.15);
    border-radius: 5px;
}

.sheet-header h3 { font-size: 18px; font-weight: 600; margin: 0; }

/* РЕЗЕРВИРУЕМ ВЫСОТУ, чтобы не прыгало при старте анимации */
.sheet-body { 
    padding: 0 24px 24px; 
    min-height: 50vh; 
    //max-height: 65vh; 
    overflow-y: auto; 
    overscroll-behavior: contain; 
}

/* Жестко фиксируем враппер картинки. Если картинка квадратная — 1/1 */
.preview-large-wrapper { 
    width: 100%; 
    aspect-ratio: 1 / 1; 
    border-radius: var(--radius-md); 
    overflow: hidden; 
    margin-bottom: 16px; 
    background: #f0f0f5; /* Скелетон-фон, пока картинка грузится */
}

.img-preview { 
    width: 100%; 
    height: 100%;
    object-fit: cover; 
    display: block; 
}

/* Центрируем прелоадер */
.sheet-preloader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: calc(50vh - 48px);
}

.sheet-footer { 
    padding: 16px 24px 32px; 
    border-top: 1px solid rgba(0,0,0,0.05); 
}

@media (min-width: 769px) {
    dialog.bottom-sheet {
        margin: auto;
        border-radius: var(--radius-lg);
        max-width: 440px;
        width: 90%;
        background: #ffffff;
    }
    .sheet-header::before { display: none; }
    .sheet-body { min-height: 400px; }
    .sheet-preloader { min-height: 360px; }
    .sheet-footer { padding: 24px; }
}
/* --- СЛАЙДЕР В ШТОРКЕ (До/После) --- */
.sheet-slider-container {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
}

.sheet-slider-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Скрываем нативный скроллбар в Firefox */
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    scroll-behavior: smooth;
    background: #f0f0f5; /* Легкий фон на случай, если картинка грузится */
}

/* Скрываем нативный скроллбар в Chrome/Safari */
.sheet-slider-track::-webkit-scrollbar {
    display: none;
}

.sheet-slide {
    flex: 0 0 100%;
    width: 100%;
    position: relative;
    scroll-snap-align: start;
}

.slider-img {
    width: 100%;
    display: block;
    object-fit: cover;
    max-height: 400px; /* Чтобы вертикальные фото не занимали весь экран */
}

/* Плашка "До" и "После" поверх картинки */
.slide-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 2;
    backdrop-filter: blur(4px); /* Легкое размытие под плашкой на iOS/Safari */
}

/* Индикаторы-полоски на всю ширину */
.sheet-slider-indicators {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    width: 100%;
}

.sheet-indicator {
    flex: 1;
    height: 4px;
    background: #e5e5ea;
    border-radius: 2px;
    cursor: pointer; /* Для ПК */
    transition: background 0.3s ease;
}

.sheet-indicator.active {
    background: #7f00d4; /* Основной фиолетовый цвет Ёмолл */
}