/* SaleTicket Order Form Styles - Unique prefix: saleticket-of */

.saleticket-of-body {
    font-family: Arial, sans-serif;
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
    background-color: #f5f5f5;
}

.saleticket-of-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.saleticket-of-title {
    color: #333;
    margin-bottom: 20px;
}

.saleticket-of-form-group {
    margin-bottom: 20px;
}

.saleticket-of-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

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

.saleticket-of-input-highlight {
    border-color: #e74c3c !important;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.4) !important;
    background-color: #fff5f5 !important;
}

.saleticket-of-required {
    color: #e74c3c;
}

.saleticket-of-optional-note {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.saleticket-of-submit-btn {
    background-color: #3498db;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
}

.saleticket-of-submit-btn:hover {
    background-color: #2980b9;
}

.saleticket-of-submit-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.7;
}

.saleticket-of-errors {
    background-color: #fee;
    border: 1px solid #fcc;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.saleticket-of-errors ul {
    margin: 0;
    padding-left: 20px;
}

.saleticket-of-errors li {
    color: #c33;
}

.saleticket-of-success {
    background-color: #efe;
    border: 1px solid #cec;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.saleticket-of-success h2 {
    color: #3c3;
    margin-top: 0;
}

.saleticket-of-payment-form {
    margin-top: 20px;
}

.saleticket-of-checkbox-blocks-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.saleticket-of-checkbox-block {
    flex: 1;
    min-width: 280px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fafafa;
}

@media (max-width: 640px) {
    .saleticket-of-checkbox-block {
        min-width: 100%;
    }
}

.saleticket-of-block-title {
    font-weight: bold;
    font-size: 15px;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.saleticket-of-checkbox-label {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    cursor: pointer;
}

.saleticket-of-checkbox-label:last-child {
    margin-bottom: 0;
}

.saleticket-of-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    margin-right: 10px;
    flex-shrink: 0;
}

.saleticket-of-checkbox-content {
    flex: 1;
}

.saleticket-of-checkbox-title {
    color: #333;
    line-height: 1.4;
}

.saleticket-of-checkbox-description {
    font-size: 12px;
    color: #777;
    margin-top: 4px;
    line-height: 1.4;
}

.saleticket-of-checkbox-label.hidden-checkbox {
    display: none;
}

.saleticket-of-price {
    font-size: 18px;
    font-weight: bold;
    color: #2ecc71;
    margin-left: 10px;
}

/* User Agreement Styles */
.saleticket-of-agreement {
    text-align: center;
    margin: 20px 0 15px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.saleticket-of-agreement-link {
    color: #3498db;
    text-decoration: underline;
    cursor: pointer;
}

.saleticket-of-agreement-link:hover {
    color: #2980b9;
}

/* Modal Window Styles */
.saleticket-of-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.saleticket-of-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.saleticket-of-modal-content {
    background-color: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    /* A4 proportions: 1:1.4142, occupy 80% of screen */
    --header-height: 55px;
    --available-height: calc(80vh - var(--header-height));
    --a4-ratio: 1.4142;
    --calculated-width: calc(var(--available-height) / var(--a4-ratio));
    --calculated-height: var(--available-height);
    max-width: min(80vw, var(--calculated-width));
    max-height: 80vh;
    width: min(80vw, var(--calculated-width));
    height: auto;
}

.saleticket-of-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.saleticket-of-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.saleticket-of-modal-close {
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.saleticket-of-modal-close:hover {
    color: #333;
}

.saleticket-of-modal-body {
    flex: 1;
    overflow: auto;
    position: relative;
    /* Maintain A4 aspect ratio */
    aspect-ratio: 1 / 1.4142;
    max-height: calc(80vh - 55px);
}

.saleticket-of-pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .saleticket-of-modal-content {
        --available-height: calc(80vh - 50px);
        --calculated-width: calc(var(--available-height) / 1.4142);
        width: min(80vw, var(--calculated-width));
        max-width: min(80vw, var(--calculated-width));
        max-height: 80vh;
    }

    .saleticket-of-modal-header {
        padding: 12px 15px;
    }

    .saleticket-of-modal-header h3 {
        font-size: 16px;
    }

    .saleticket-of-modal-body {
        max-height: calc(85vh - 50px);
    }
}

@media (max-width: 480px) {
    .saleticket-of-modal-content {
        --available-height: calc(80vh - 45px);
        --calculated-width: calc(var(--available-height) / 1.4142);
        width: min(80vw, var(--calculated-width));
        max-width: min(80vw, var(--calculated-width));
        max-height: 80vh;
        border-radius: 6px;
    }

    .saleticket-of-modal-header {
        padding: 10px 12px;
    }

    .saleticket-of-modal-header h3 {
        font-size: 14px;
    }

    .saleticket-of-modal-close {
        font-size: 24px;
    }

    .saleticket-of-modal-body {
        max-height: calc(90vh - 45px);
    }
}
