/* WooCommerce Sales Agreement - Frontend Styles */

/* Agreement Checkbox */
.wcsa-agreement-wrapper {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wcsa-agreement-checkbox {
    margin: 0 !important;
}

.wcsa-agreement-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.wcsa-view-agreement {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
    margin-left: 5px;
}

.wcsa-view-agreement:hover {
    text-decoration: underline;
}

/* Underlined links in checkbox text */
.wcsa-link-underline {
    text-decoration: underline !important;
    margin-left: 0 !important;
}

.wcsa-link-underline:hover {
    color: #005177;
    text-decoration: underline !important;
}

/* Modal */
.wcsa-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wcsa-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}

.wcsa-modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    animation: wcsa-modal-fadein 0.3s ease;
}

@keyframes wcsa-modal-fadein {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wcsa-modal-header {
    padding: 20px 25px;
    border-bottom: 2px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.wcsa-modal-header h2 {
    margin: 0;
    font-size: 22px;
    color: #333;
}

.wcsa-modal-close {
    background: #e74c3c;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wcsa-modal-close:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

.wcsa-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
}

.wcsa-modal-footer {
    padding: 15px 25px;
    border-top: 2px solid #ddd;
    text-align: right;
    flex-shrink: 0;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.wcsa-modal-footer .button {
    padding: 10px 20px;
    font-size: 14px;
}

.wcsa-loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #666;
}

.wcsa-loading:before {
    content: "⏳";
    font-size: 32px;
    display: block;
    margin-bottom: 15px;
}

/* Agreement Display in Account */
.wcsa-account-agreement {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wcsa-account-agreement h2 {
    margin-top: 0;
}

.wcsa-account-agreement .button {
    margin-right: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .wcsa-modal {
        padding: 10px;
    }

    .wcsa-modal-content {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 6px;
    }

    .wcsa-modal-header {
        padding: 15px 20px;
    }

    .wcsa-modal-header h2 {
        font-size: 18px;
    }

    .wcsa-modal-close {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }

    .wcsa-modal-body {
        padding: 20px;
        font-size: 13px;
    }

    .wcsa-modal-footer {
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .wcsa-modal {
        padding: 5px;
    }

    .wcsa-modal-content {
        max-height: 95vh;
    }

    .wcsa-modal-header {
        padding: 12px 15px;
    }

    .wcsa-modal-header h2 {
        font-size: 16px;
    }

    .wcsa-modal-body {
        padding: 15px;
        font-size: 12px;
    }
}