/**
 * Frontend Styles for Banya Booking Plugin
 */

/* Базовые стили */
.banya-booking-wrapper {
    display: inline-block;
}

/* Кнопка бронирования */
.banya-booking-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.4;
}

.banya-booking-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.banya-booking-button--default {
    background-color: #4CAF50;
}

.banya-booking-button--outline {
    background-color: transparent;
    border: 2px solid currentColor;
    color: #4CAF50;
}

.banya-booking-button--outline:hover {
    background-color: #4CAF50;
    color: #fff;
}

.banya-booking-button--large {
    padding: 16px 32px;
    font-size: 18px;
}

.banya-booking-button--small {
    padding: 8px 16px;
    font-size: 14px;
}

.banya-booking-price-from {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.9;
}

/* Форма бронирования */
.banya-booking-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.banya-form-section {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
}

.banya-form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.banya-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #4CAF50;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
}

.banya-form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.banya-form-row--time,
.banya-form-row--guests,
.banya-form-row--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Подсказки под полями (например: "Максимум N взрослых…") */
.banya-field-hint {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: #64748b;
}

@media (max-width: 480px) {
    .banya-field-hint {
        font-size: 11px;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .banya-form-field label {
        min-height: 20px;
        font-size: 13px;
    }
    .banya-number-btn {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .banya-number-input input {
        padding: 9px 5px;
    }
}

.banya-free-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #16a34a;
    background: #dcfce7;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

.banya-form-field {
    flex: 1;
    min-width: 150px;
}

.banya-form-field--full {
    flex: 100%;
}

.banya-form-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
    line-height: 1.2;
    min-height: 22px;
}

.banya-form-field label .required {
    color: #e53935;
}

.banya-form-field label .required,
.banya-form-field label .banya-free-badge,
.banya-form-field label .banya-free-label {
    line-height: 1;
}

.banya-free-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #16a34a;
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 999px;
}

.banya-form-field label .banya-hint {
    font-weight: 400;
    color: #888;
    font-size: 12px;
}

.banya-form-field input[type="text"],
.banya-form-field input[type="email"],
.banya-form-field input[type="tel"],
.banya-form-field input[type="date"],
.banya-form-field input[type="number"],
.banya-form-field select,
.banya-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.banya-form-field input:focus,
.banya-form-field select:focus,
.banya-form-field textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

.banya-form-field input:disabled,
.banya-form-field select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.banya-form-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Number input */
.banya-number-input {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.banya-number-input input {
    border: none;
    text-align: center;
    width: 60px;
    padding: 10px 5px;
    appearance: textfield;
}

.banya-number-input input:focus {
    outline: none;
    box-shadow: none;
}

/* Убрать стрелки у input[type=number] (оставляем только +/−) */
.banya-number-input input[type="number"]::-webkit-outer-spin-button,
.banya-number-input input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.banya-number-input input[type="number"] {
    -moz-appearance: textfield;
}

.banya-number-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.banya-number-btn:hover {
    background: #e0e0e0;
}

/* Time select */
.banya-time-select:disabled {
    background-color: #f5f5f5;
}

.banya-time-select option:disabled {
    color: #999;
}

/* Расчёт стоимости */
.banya-calculation {
    background: linear-gradient(135deg, #f5f5f5 0%, #fff 100%);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

.banya-calculation-header {
    background: #4CAF50;
    color: #fff;
    padding: 15px 20px;
}

.banya-calculation-header h4 {
    margin: 0;
    font-size: 16px;
}

.banya-calculation-body {
    padding: 20px;
}

.banya-calculation-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.banya-calculation-row:last-child {
    border-bottom: none;
}

.banya-calculation-row--total {
    font-weight: 600;
    font-size: 18px;
    color: #4CAF50;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid #4CAF50;
}

.banya-calculation-row--bonus {
    color: #4CAF50;
    background: #e8f5e9;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

.banya-calculation-label {
    color: #666;
}

.banya-calculation-value {
    font-weight: 500;
}

/* Кнопки */
.banya-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.banya-btn-primary {
    background: #4CAF50;
    color: #fff;
}

.banya-btn-primary:hover {
    background: #388E3C;
}

.banya-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.banya-btn-secondary:hover {
    background: #e0e0e0;
}

.banya-btn-danger {
    background: #e53935;
    color: #fff;
}

.banya-btn-danger:hover {
    background: #c62828;
}

.banya-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Сообщения об ошибках */
.banya-error {
    color: #e53935;
    padding: 10px;
    background: #ffebee;
    border-radius: 4px;
    margin: 10px 0;
}

.banya-success {
    color: #2e7d32;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 4px;
    margin: 10px 0;
}

.banya-warning {
    color: #f57c00;
    padding: 10px;
    background: #fff3e0;
    border-radius: 4px;
    margin: 10px 0;
}

/* Loading */
.banya-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.banya-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: banya-spin 0.8s linear infinite;
}

@keyframes banya-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Адаптивность */
@media (max-width: 782px) {
    .banya-form-row--time,
    .banya-form-row--guests,
    .banya-form-row--2col {
        grid-template-columns: 1fr;
    }

    .banya-form-field {
        min-width: 100%;
    }

    .banya-booking-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .banya-form-section {
        padding: 15px;
    }

    .banya-calculation-body {
        padding: 15px;
    }

    .banya-calculation-row {
        flex-direction: column;
        gap: 5px;
    }
}

/* =========================================
   Расчёт стоимости — блок в форме
   ========================================= */

/* Бейдж бонусных часов */
.banya-bonus-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

/* Строка «тариф» — выделяем значение */
.banya-calculation-tariff {
    font-weight: 600;
    color: #1565c0;
}

/* Итоговая строка */
.banya-calculation-total .banya-calculation-label,
.banya-calculation-total .banya-calculation-value {
    font-size: 16px;
    font-weight: 700;
    color: #1b5e20;
}

/* Строка предоплаты */
.banya-calculation-prepaid .banya-calculation-label,
.banya-calculation-prepaid .banya-calculation-value {
    font-style: italic;
    color: #555;
}

/* Блок акции / бонусных часов */
.banya-calculation-promo {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f1f8e9;
    border-left: 4px solid #66bb6a;
    border-radius: 4px;
    font-size: 14px;
    color: #2e7d32;
    font-weight: 500;
}

/* Предупреждение о минимальных часах */
.banya-calculation-warning {
    padding: 10px 14px;
    background: #fff3e0;
    border-left: 4px solid #ffa726;
    border-radius: 4px;
    font-size: 14px;
    color: #e65100;
    display: flex;
    align-items: center;
    gap: 8px;
}

.banya-warning-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   ПОЛИТИКА ОТМЕНЫ (шаг подтверждения бронирования)
═══════════════════════════════════════════════════════════ */
.banya-cancel-policy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #7b5800;
    line-height: 1.45;
    margin: 12px 0 16px;
}
.banya-cancel-policy__icon {
    font-size: 15px;
    flex-shrink: 0;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════
   Альтернативы: свободное время у других бань/беседок на странице
═══════════════════════════════════════════════════════════ */
.banya-alt-banyas {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f9f9f9;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.banya-alt-banyas__head {
    margin-bottom: 8px;
}

.banya-alt-banyas__title {
    font-size: 14px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 2px;
}

.banya-alt-banyas__sub {
    font-size: 12px;
    color: #718096;
    margin: 0;
    line-height: 1.3;
}

.banya-alt-banyas__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.banya-alt-banyas__card {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px 12px;
}

.banya-alt-banyas__card-info {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    /* Не растягиваем на всю ширину — иначе кнопка уезжает вправо */
    flex: 0 1 auto;
}

.banya-alt-banyas__card-title {
    font-weight: 600;
    font-size: 13px;
    color: #2d3748;
    white-space: nowrap;
}

.banya-alt-banyas__card-meta {
    font-size: 12px;
    color: #718096;
    white-space: nowrap;
}

.banya-alt-banyas__card-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
}

.banya-alt-banyas__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
    border: none;
    text-decoration: none;
}

.banya-alt-banyas__btn--primary {
    background: #4CAF50;
    color: #fff;
}

.banya-alt-banyas__btn--primary:hover {
    background: #45a049;
}

.banya-alt-banyas__btn--secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
}

.banya-alt-banyas__btn--secondary:hover {
    background: #eeeeee;
}

.banya-alt-banyas__link {
    font-size: 14px;
    font-weight: 600;
    color: #2e7d32;
    text-decoration: underline;
}

.banya-alt-banyas__show-more {
    margin-top: 8px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #4CAF50;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.banya-alt-banyas__show-more:hover {
    color: #45a049;
}
