.gift-certificates {
    max-width: 1200px;
    padding: 20px;
}

.certificate-item {
    border: 1px solid #ddd;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    cursor: pointer;
}

.certificate-item:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.certificate-item input[type="radio"] {
    margin-right: 10px;
}

.certificate-item label {
    cursor: pointer;
    margin: 0;
}

.certificates-list {
    margin-bottom: 20px;
}

.certificates-list h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.form-group {
    margin: 20px 0;
}

.btn {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.btn:hover:not(:disabled) {
    background-color: #0056b3;
}
#paymentFormHtml button{
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* Стили превью сертификата (повторяем ключевые блоки display шаблона) */
.certificate-display {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Arial', sans-serif;
    background: white;
}

.certificate-container {
    background: #ffffff;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.certificate-header {
    position: relative;
    text-align: center;
}

.certificate-logo {
    margin-bottom: 0;
}

.certificate-logo img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.certificate-amount {
    position: absolute;
    left: 27%;
    top: 43%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-size: 32px;
    font-weight: bold;
    color: #27a4dd;
    margin: 0;
    background: white;
    padding: 10px;
    border-radius: 35px;
}

.certificate-barcode-section {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.barcode-label {
    font-size: 14px;
    color: #666;
    margin: 0;
    font-weight: normal;
}

.barcode-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.barcode {
    padding: 15px;
    border-radius: 5px;
    max-width: 100%;
    height: auto;
}

.certificate-number {
    text-align: center;
    background: #f9f9f9;
}

.certificate-number p {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
}

.certificate-code {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #000;
    letter-spacing: 2px;
    padding: 10px 15px;
    border-radius: 5px;
    display: inline-block;
}

.certificate-divider {
    height: 1px;
    background: #eee;
    margin: 25px 0;
}

.certificate-wishes {
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    white-space: pre-wrap;
    color: #333;
}

.certificate-from{
    text-align:center;
    font-size: 14px;
    color:#555;
}
.certificate-from .from-label{color:#888;margin-right:6px}

.certificate-instructions {
    margin: 25px 0;
}

.instruction-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin: 12px 0;
    border-left: 3px solid #27a4dd;
}

.instruction-item p {
    margin: 0;
    color: #333;
    line-height: 1.5;
}

.certificate-constructor {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.constructor-left {
    flex: 1;
    min-width: 320px;
}

.constructor-right {
    flex: 1;
    min-width: 320px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

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

@media (max-width: 768px) {
    .gift-certificates {
        padding: 10px;
    }

    .certificate-constructor {
        flex-direction: column-reverse;
        gap: 20px;
    }

    .constructor-left,
    .constructor-right {
        min-width: 100%;
        width: 100%;
    }

    .certificate-display {
        padding: 10px;
    }

    .certificate-container {
        padding: 15px;
        border-radius: 8px;
    }

    .certificate-amount {
        font-size: 20px;
        padding: 8px;
        left: 50%;
        border-radius: 25px;
    }

    .certificate-code {
        font-size: 12px;
        padding: 8px 10px;
        letter-spacing: 1px;
        word-break: break-all;
    }

    .barcode {
        padding: 8px;
        max-width: 100%;
    }

    .certificate-barcode-section {
        padding: 15px;
    }

    .barcode-label {
        font-size: 12px;
    }

    .certificate-number p {
        font-size: 12px;
    }

    .certificate-wishes {
        font-size: 13px;
        padding: 12px;
        margin: 15px 0;
    }

    .certificate-from {
        font-size: 13px;
    }

    .certificate-instructions {
        margin: 20px 0;
    }

    .instruction-item {
        padding: 12px;
        margin: 10px 0;
    }

    .instruction-item p {
        font-size: 13px;
    }

    .certificate-divider {
        margin: 20px 0;
    }

    .certificates-list h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .certificate-item {
        padding: 12px;
        margin: 8px 0;
    }

    .certificate-item label {
        font-size: 14px;
    }

    .form-group {
        margin: 15px 0;
    }

    .form-group label {
        font-size: 14px;
        display: block;
        margin-bottom: 5px;
    }

    .form-control {
        width: 100%;
        padding: 10px;
        font-size: 14px;
        box-sizing: border-box;
    }

    #totalField h4 {
        font-size: 18px;
    }

    .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
        margin-top: 10px;
    }

    #paymentContainer {
        padding: 15px;
        margin-top: 15px;
    }

    #paymentContainer h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    #paymentFormHtml button {
        width: 100%;
        padding: 12px 20px !important;
        font-size: 16px;
    }

    #backToSelection {
        width: 100%;
        padding: 12px 20px;
        margin-top: 15px;
    }

    .alert {
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .gift-certificates {
        padding: 5px;
    }

    .certificate-constructor {
        gap: 15px;
    }

    .certificate-display {
        padding: 5px;
    }

    .certificate-container {
        padding: 12px;
    }

    .certificate-amount {
        font-size: 18px;
        padding: 6px 12px;
    }

    .certificate-code {
        font-size: 11px;
        padding: 6px 8px;
    }

    .barcode {
        padding: 5px;
    }

    .certificate-barcode-section {
        padding: 12px;
    }

    .certificates-list h3 {
        font-size: 16px;
    }

    .certificate-item {
        padding: 10px;
    }

    .certificate-item label {
        font-size: 13px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-control {
        padding: 8px;
        font-size: 13px;
    }

    #totalField h4 {
        font-size: 16px;
    }

    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    #paymentContainer {
        padding: 12px;
    }

    #paymentContainer h3 {
        font-size: 16px;
    }

    #paymentFormHtml button {
        padding: 10px 15px !important;
        font-size: 14px;
    }

    #backToSelection {
        padding: 10px 15px;
        font-size: 14px;
    }

    .alert {
        padding: 10px;
        font-size: 13px;
    }
}

#paymentContainer {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid #dee2e6;
}

#paymentContainer h3 {
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

#paymentFormHtml {
    text-align: center;
    margin-bottom: 20px;
}

#paymentFormHtml form {
    margin: 0 auto;
    max-width: 400px;
}

#paymentFormHtml button {
    border: none;
    padding: 12px 30px !important;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: #27a4dd;
    border-color: #27a4dd;
    color: #ffffff;
}

#paymentFormHtml button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,123,255,0.3);
    color: white;
}

#backToSelection {
    background: #6c757d;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    color: white;
    transition: background 0.3s ease;
}

#backToSelection:hover {
    background: #5a6268;
    color: white;
}
