/**
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 *
 * In-page addon purchase modal (Stripe Embedded Checkout).
 * Responsive animation per the Modal Animation Standards: slides up from the
 * bottom on mobile, slides in from the right on desktop.
 */

.addon-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 25, 0.6);
    z-index: 1998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.addon-modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.addon-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 50vw;
    max-width: 480px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
    border-radius: 16px 0 0 16px;
    z-index: 1999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.addon-modal.open {
    transform: translateX(0);
}

.addon-modal-handle {
    display: none;
}

.addon-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.addon-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.addon-modal-close .dna-icon {
    width: 14px;
    height: 14px;
}

.addon-modal-header {
    padding: 28px 28px 16px;
    border-bottom: 1px solid #eee;
}

.addon-modal-title {
    font-weight: 700;
    margin: 0 0 4px;
    padding-right: 32px;
}

.addon-modal-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a5a3a;
}

.addon-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
}

.addon-modal-footer {
    padding: 14px 28px;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}

.addon-modal-footer .dna-icon {
    width: 14px;
    height: 14px;
    color: #888;
}

.addon-modal-field {
    margin-bottom: 18px;
}

.addon-modal-field label {
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.addon-modal-consents {
    margin-bottom: 18px;
}

.addon-modal-sample-static {
    margin: 0;
    padding: 8px 12px;
    background: #f4f6f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-weight: 600;
}

.addon-modal-sample-loading {
    padding: 6px 0;
}

.addon-modal-error {
    min-height: 20px;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.addon-modal-continue {
    padding: 12px;
    font-weight: 600;
}

.addon-modal-spinner {
    margin-right: 6px;
}

.addon-modal-embedded-checkout {
    min-height: 320px;
}

.addon-modal-success-icon .dna-icon {
    width: 48px;
    height: 48px;
}

/* Mobile: slide up from bottom, full width */
@@media (max-width: 768px) {
    .addon-modal {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        height: 90vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }

    .addon-modal.open {
        transform: translateY(0);
    }

    .addon-modal-backdrop.open {
        background: rgba(15, 20, 25, 0.3);
    }

    .addon-modal-handle {
        display: block;
        width: 40px;
        height: 4px;
        border-radius: 4px;
        background: #ddd;
        margin: 10px auto 0;
    }

    .addon-modal-header {
        padding-top: 18px;
    }
}
