/* Toast + confirm-modal — extracted from style.css (move-only) */

/* ============================================
   TOAST И CONFIRM-MODAL (notification-system.js)
   ============================================ */

.notifications-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: var(--viva-z-toast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    background: white;
    border-left: 4px solid var(--primary-color);
    border-radius: var(--button-radius, 4px);
    padding: 1rem 1.25rem;
    box-shadow: var(--dropdown-shadow);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

[data-bs-theme="dark"] .notification {
    background: #1e2835;
    box-shadow: var(--dropdown-shadow);
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--danger-color);
}

.notification.warning {
    border-left-color: var(--accent-color);
}

.notification.info {
    border-left-color: var(--info-color);
}

.notification-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-icon svg {
    width: 100%;
    height: 100%;
}

.notification.success .notification-icon {
    color: var(--success-color);
}

.notification.error .notification-icon {
    color: var(--danger-color);
}

.notification.warning .notification-icon {
    color: var(--accent-color);
}

.notification.info .notification-icon {
    color: var(--info-color);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.notification-message {
    color: var(--secondary-color);
    font-size: 0.875rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.notification-close:hover {
    color: var(--text-color);
}

/* ============================================
   CONFIRM-MODAL (оверлей, shell, варианты body)
   ============================================ */

.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--viva-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-modal-overlay:not(.show),
.confirm-modal-overlay.pes-tour-photo-crop-overlay[hidden] {
    display: none !important;
    pointer-events: none;
}

.confirm-modal-overlay.show {
    opacity: 1;
}

.confirm-modal {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    padding: 0;
    overflow: hidden;
    border-radius: var(--button-radius, 4px);
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    /* Одинаковый «хром» шапки и футера во всех confirm-modal */
    --confirm-modal-chrome-pad-y: 0.75rem;
    --confirm-modal-chrome-pad-x: 1.25rem;
}

.confirm-modal.seller-booking-detail-modal {
    max-width: 720px;
    width: 92%;
}

/* Обрезка 4:3 — ширина под crop frame, без пустых полей по бокам */

.confirm-modal-overlay.show .confirm-modal {
    transform: scale(1);
}

[data-bs-theme="dark"] .confirm-modal {
    background: #1e2835;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.confirm-modal-header,
.confirm-modal-footer {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.75rem;
    padding: var(--confirm-modal-chrome-pad-y) var(--confirm-modal-chrome-pad-x);
    box-sizing: border-box;
    min-height: 0;
}

.confirm-modal-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.confirm-modal-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
}

.confirm-modal-header-close.confirm-modal-btn {
    flex-shrink: 0;
    padding: 6px 10px;
    line-height: 1;
    min-height: 0;
}

.confirm-modal-header-close.confirm-modal-btn svg {
    display: block;
}

.confirm-modal-body {
    flex: 1;
    padding: 1.25rem var(--confirm-modal-chrome-pad-x);
    overflow-y: auto;
    color: var(--text-color);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.confirm-modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}


/* Подпись и поле в одну линию (админка, формы в модалке) */
.confirm-modal-body .form-group--inline {
    display: grid;
    grid-template-columns: minmax(11.5rem, max-content) 1fr;
    gap: 6px 14px;
    align-items: center;
    margin-bottom: 12px;
}

.confirm-modal-body .form-group--inline label {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.35;
}

.confirm-modal-body .form-group--inline .form-input {
    width: 100%;
    min-width: 0;
    padding: 10px 10px 2px 10px;
    box-sizing: border-box;
}

.confirm-modal-body .form-group--inline .field-with-dropdown {
    position: relative;
    min-width: 0;
}

.confirm-modal-body .form-group--inline .field-with-dropdown .form-input {
    padding-right: 34px;
}

.confirm-modal-body .form-group--inline .field-with-dropdown .dropdown-arrow {
    right: var(--viva-dropdown-arrow-inset);
}

@media (max-width: 479px) {
    .confirm-modal-body .form-group--inline {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* Модалка «описание экскурсии» у продавца (confirm-modal + booking-excursion-detail-modal-body) */
.booking-excursion-detail-modal-body .booking-exc-detail-section {
    margin-top: 0.75rem;
}

.booking-excursion-detail-modal-body .booking-exc-detail-section:first-child {
    margin-top: 0;
}

.booking-excursion-detail-modal-body .booking-exc-detail-heading {
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.booking-excursion-detail-modal-body .booking-exc-detail-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.booking-excursion-detail-modal-body .booking-exc-detail-program-list {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.35rem;
    row-gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.booking-excursion-detail-modal-body .booking-exc-detail-program-li {
    display: contents;
}

.booking-excursion-detail-modal-body .booking-exc-detail-program-time-col {
    display: inline-flex;
    align-items: baseline;
    flex-shrink: 0;
    word-break: break-word;
}

.booking-excursion-detail-modal-body .booking-exc-detail-program-text-col {
    min-width: 0;
    word-break: break-word;
}

.booking-excursion-detail-modal-body .booking-exc-detail-sub-text-line {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    min-width: 0;
}

.booking-excursion-detail-modal-body .booking-exc-detail-sub-marker {
    flex-shrink: 0;
    color: var(--text-color);
}

.booking-excursion-detail-modal-body .booking-exc-detail-time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.booking-excursion-detail-modal-body .booking-exc-detail-program-day + .booking-exc-detail-program-day {
    margin-top: 0.75rem;
}

.booking-excursion-detail-modal-body .booking-exc-detail-day-heading {
    margin: 0 0 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Модалка продавца: вкладки «Программа» / «Примечание» / «Фото» */
.confirm-modal:has(.booking-exc-detail-tab-bar) .booking-exc-detail-tab-bar {
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.booking-exc-detail-tab {
    margin: 0;
    padding: 0.65rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-color-secondary);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.booking-exc-detail-tab:hover {
    color: var(--text-color);
}

.booking-exc-detail-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.booking-exc-detail-panel[hidden] {
    display: none !important;
}

/* Примечание провайдера — только для продавца, не копируется туристу */
.booking-exc-detail-panel--note .booking-exc-detail-seller-note-body {
    user-select: none;
    -webkit-user-select: none;
}

.booking-exc-detail-copy[hidden] {
    display: none !important;
}

.booking-exc-detail-gallery-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.booking-exc-detail-gallery-toolbar[hidden] {
    display: none !important;
}

.booking-exc-detail-gallery-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.booking-exc-detail-gallery-count {
    font-size: 0.875rem;
    color: var(--text-color);
}

.booking-exc-detail-gallery-host {
    --booking-exc-gallery-control-size: 20px;
    --booking-exc-gallery-check-selected: #1e2835;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.booking-exc-detail-gallery-host--loading {
    opacity: 0.55;
    pointer-events: none;
}

.booking-exc-detail-gallery-cell {
    position: relative;
    margin: 0;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    background: transparent;
    overflow: hidden;
}

.booking-exc-detail-gallery-cell__preview {
    position: relative;
    z-index: 0;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.booking-exc-detail-gallery-cell__frame {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 4px;
    background: color-mix(in srgb, var(--text-color, #212529) 6%, transparent);
}

.booking-exc-detail-gallery-cell__frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.booking-exc-detail-panel--photos > .ui-muted-hint-text {
    margin: 0 0 0.75rem;
}

.booking-exc-detail-gallery-cell__check {
    position: absolute;
    z-index: 3;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: var(--booking-exc-gallery-control-size, 20px);
    height: var(--booking-exc-gallery-control-size, 20px);
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.booking-exc-detail-gallery-cell__check-mark {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, #fff 70%, var(--border-color));
    border-radius: 4px;
    background: color-mix(in srgb, var(--bg-color, #fff) 82%, transparent);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.booking-exc-detail-gallery-cell__check-mark::after {
    content: '';
    position: absolute;
    inset: 3px 5px 5px 3px;
    border: solid #fff;
    border-width: 0 0 2px 2px;
    transform: rotate(-45deg) scale(0.6);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.booking-exc-detail-gallery-cell.is-selected .booking-exc-detail-gallery-cell__check-mark {
    background: var(--booking-exc-gallery-check-selected, #1e2835);
    border-color: var(--booking-exc-gallery-check-selected, #1e2835);
}

.booking-exc-detail-gallery-cell.is-selected .booking-exc-detail-gallery-cell__check-mark::after {
    opacity: 1;
}

@media (max-width: 767px) {
    .booking-exc-detail-gallery-host {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
