/* Стили для страницы оплаты - адаптированные под основной дизайн */
.payment-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1rem;
}

.payment-form {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.2rem;
    margin: 0.5rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 0rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.form-title {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.select-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.promo-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(251, 191, 36, 0.1) 100%);
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 1.2rem;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(5px);
}

.promo-content {
    flex: 1;
}

.promo-text {
    color: var(--text);
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.4;
}

.form-select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Якорь для прокрутки */
#photos-anchor {
    position: relative;
    top: -80px; /* Смещение для компенсации фиксированного заголовка */
    visibility: hidden;
    height: 0;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.photo-item {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.photo-item.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.photo-preview {
    position: relative;
    width: 100%;
    height: 320px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--surface);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--surface);
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Защита от скачивания */
.photo-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 2;
}

/* Кнопка увеличения */
.zoom-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: #333;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.zoom-button:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* Модальное окно увеличенного изображения */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-image {
    width: 100%;
    height: auto;
    max-height: 180vh;
    object-fit: contain;
    display: block;
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.photo-controls {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.control-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
}

.size-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.size-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.size-btn:hover {
    background: var(--surface);
}

.size-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.size-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.size-name {
    font-weight: 500;
}

.size-price {
    color: var(--text-light);
    font-size: 0.7rem;
}

.size-btn.selected .size-price {
    color: rgba(255,255,255,0.8);
}

.quantity-display {
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 20px;
    text-align: center;
}

.size-btn.selected .quantity-display {
    color: white;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 25px;
    height: 25px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.size-btn.selected .quantity-btn {
    border-color: rgba(255,255,255,0.5);
    color: white;
    background: rgba(255,255,255,0.2);
}

.quantity-btn:hover {
    background: var(--surface);
}

.size-btn.selected .quantity-btn:hover {
    background: rgba(255,255,255,0.3);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.magnet-controls {
    margin-top: 0.5rem;
    padding: 0.8rem;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 4px;
    border-left: 3px solid var(--primary);
    display: none;
}

.magnet-controls.visible {
    display: block;
}

/* Стили для выбора электронной версии для каждого файла */
.electronic-controls {
    margin-top: 0.5rem;
}

.electronic-controls .checkbox-group {
    margin-top: 0;
}

.electronic-price {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-left: 0.3rem;
}

.electronic-controls.free .electronic-price {
    color: #22c55e;
    font-weight: 600;
}

/* Специальный стиль для общей фотографии */
.general-photo .electronic-controls {
    color: #666;
    font-style: italic;
    font-size: 0.8rem;
    padding: 0.5rem;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 4px;
    border-left: 3px solid #22c55e;
}

.general-photo .electronic-controls .checkbox-group {
    margin-top: 0;
}

.customer-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input.error {
    border-color: #dc2626;
}

.error-message {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.3rem;
    display: none;
}

.summary-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

.summary-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><path d="M36,34 L36,56 L34,56 L34,34 L12,34 L12,32 L34,32 L34,10 L36,10 L36,32 L58,32 L58,34 L36,34 Z M27,45 L27,27 L45,27 L45,45 L27,45 Z"/></g></g></svg>');
    opacity: 0.3;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.3);
    font-size: 1.2rem;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.pay-button {
    width: 100%;
    padding: 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

.pay-button:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.pay-button:hover:not(:disabled) {
    background: #e6900b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.hidden {
    display: none;
}

.electronic-version {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--accent);
}

.general-photo {
    background: rgba(34, 197, 94, 0.1);
    border-left: 4px solid #22c55e;
}

.electronic-note {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 0.3rem;
    margin-left: 1.5rem;
}

.subfolder-section {
    background: rgba(139, 92, 246, 0.1);
    border-left: 4px solid #8b5cf6;
}

.no-right-click {
    user-select: none;
    -webkit-user-select: none;
}

/* Стили для формы Юкассы */
.yookassa-container {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.yookassa-container .ym-input {
    background: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.yookassa-container .ym-btn-pay {
    background: var(--accent);
}

.yookassa-container .ym-btn-pay:hover {
    background: #e6900b;
}

/* Стили для дополнительных полей в форме Юкассы */
.yookassa-custom-fields {
    margin-bottom: 1rem;
}

.yookassa-custom-fields .ym-input {
    margin-bottom: 0.8rem;
}

/* Стили для ввода номера бланка */
.blank-input-group {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.blank-input-group .form-input {
    flex: 1;
    min-width: 200px;
}

.load-blank-btn {
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.load-blank-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.load-blank-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.blank-note {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Стили для ввода промокода */
.promo-input-group {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.promo-input-group .form-input {
    flex: 1;
    min-width: 200px;
}

.apply-promo-btn {
    padding: 0.8rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.apply-promo-btn:hover {
    background: #e6900b;
    transform: translateY(-1px);
}

.apply-promo-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.promo-message {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-style: italic;
    min-height: 1.2rem;
}

.promo-message.success {
    color: #22c55e;
    font-weight: 500;
}

.promo-message.error {
    color: #dc2626;
    font-weight: 500;
}

/* Стили для информации о скидке */
.discount-info {
    background: rgba(34, 197, 94, 0.2);
    border-radius: 6px;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border-left: 3px solid #22c55e;
}

.discount-info .summary-item {
    color: #22c55e;
    font-weight: 600;
    margin-bottom: 0;
}

/* Новые стили для полей ввода с заголовками */
.input-group {
    margin-bottom: 1rem;
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #ffffff;
    font-size: 0.8rem;
}

/* Стили для блока техподдержки */
.support-section {
    text-align: center;
    margin: 1rem auto;
    padding: 0rem;
    max-width: 700px;
}

.support-link {
    color: #37404a;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.3rem 0.4rem;
    display: inline-block;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
}

.support-link:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.9);
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(128, 128, 128, 0.9);
}

.phone-icon {
    font-size: 1.7em; /* на 30% больше основного текста */
    display: inline-block;
    transform: translateY(4px); /* небольшая вертикальная корректировка */
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .support-card {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }
    
    .support-button {
        justify-content: center;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .customer-info {
        grid-template-columns: 1fr;
    }
    
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .payment-form {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .payment-container {
        padding: 1rem 0.5rem;
    }
    
    .size-btn {
        padding: 0.6rem;
        font-size: 0.7rem;
    }
    
    .zoom-button {
        width: 32px;
        height: 32px;
        font-size: 19px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .blank-input-group {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .load-blank-btn {
        width: 100%;
    }
    
    .promo-input-group {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .apply-promo-btn {
        width: 100%;
    }
}

/* Убедитесь, что поля ввода доступны для клика */
.ym-input {
    position: relative;
    z-index: 10;
    background: white !important;
    -webkit-appearance: none;
}

/* Исправление для Safari */
input[type="text"], 
input[type="tel"] {
    -webkit-user-select: text;
    user-select: text;
    -webkit-tap-highlight-color: transparent;
}

/* Убедитесь, что нет перекрывающих элементов */
.yookassa-custom-fields {
    position: relative;
    z-index: 100;
}