/* ============================================
   GLOBAL BOTTOM SHEETS (Unified)
   ============================================ */

/* Overlay (затемнение) */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2999; /* Golden z-index: overlay под шторкой */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #242424;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
    z-index: 3000; /* Golden z-index: шторка загрузки (поверх всего) */
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bottom-sheet.active {
    transform: translateY(0);
}

/* Handle (полоска для свайпа) */
.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 12px auto 8px;
    flex-shrink: 0;
}

/* Header */
.bottom-sheet-header {
    padding: 0 20px 16px;
    text-align: center;
    flex-shrink: 0;
}

.bottom-sheet-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.bottom-sheet-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* Content (скроллируемая область) */
.bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px 20px;
    -webkit-overflow-scrolling: touch;
}

/* Actions (кнопки внизу) */
.bottom-sheet-actions {
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    display: flex;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.bottom-sheet-btn {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bottom-sheet-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.bottom-sheet-btn-cancel:active {
    background: rgba(255, 255, 255, 0.12);
}

.bottom-sheet-btn-continue {
    background: #007AFF;
    color: #ffffff;
}

.bottom-sheet-btn-continue:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bottom-sheet-btn-continue:not(:disabled):active {
    background: #0056b3;
}

/* Upload Tips */
.upload-tips {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.upload-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tip-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.2);
    color: #007AFF;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tip-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

/* Upload Area */
.upload-area {
    margin-bottom: 16px;
}

.upload-button {
    width: 100%;
    padding: 16px;
    background: rgba(0, 122, 255, 0.15);
    border: 2px dashed rgba(0, 122, 255, 0.4);
    border-radius: 16px;
    color: #007AFF;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-button:active {
    background: rgba(0, 122, 255, 0.25);
    border-color: rgba(0, 122, 255, 0.6);
}

/* Photos Grid */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
    max-height: 300px; /* Ограничение высоты чтобы не растягивался */
    overflow-y: auto;
}

.photo-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #0B0B12;
}

.photo-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
}

.photo-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #F5F7FA;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10; /* Поверх img (z-index: 1) */
}

.photo-remove:active {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(0.9);
}
