/* MeinPointOfSale Popup CSS */
/* Namespaced with mpos- to avoid conflicts */

@media screen and (min-width: 1024px) {
    /* Only show on desktop-ish screens */

    .mpos-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 999999;
        display: flex;
        justify-content: center;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        backdrop-filter: blur(2px);
    }

    .mpos-overlay.mpos-visible {
        opacity: 1;
        visibility: visible;
    }

    .mpos-popup-container {
        position: relative;
        width: 1024px;
        /* Adjust based on image aspect ratio */
        max-width: 90vw;
        height: auto;
        min-height: 500px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    }

    .mpos-close-btn {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 30px;
        height: 30px;
        background: rgba(255, 255, 255, 0.8);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        z-index: 1001;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        line-height: 1;
        color: #333;
        transition: background 0.2s;
    }

    .mpos-close-btn:hover {
        background: #fff;
    }

    /* Steps */
    .mpos-step {
        display: none;
        width: 100%;
        height: auto;
    }

    .mpos-step.mpos-active {
        display: block;
        animation: mposFadeIn 0.4s ease;
    }

    @keyframes mposFadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Images */
    .mpos-step-image {
        display: block;
        width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: cover;
        object-position: top center;
    }

    /* Step 1 Overlay Actions - Assuming content is part of the image, we might need invisible hitboxes or if content is HTML overlay */
    /* Based on request, images are likely full backgrounds. I will assume we need to overlay buttons over the image visually */

    .mpos-step-content {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 40px;
        box-sizing: border-box;
        /* Background gradient to ensure text readability if needed, or rely on image design */
    }

    /* Step 1 Layout */
    .mpos-step-1 img.mpos-step-image {
        max-height: 300px;
    }

    .mpos-step-1-actions {
        position: absolute;
        bottom: 50px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 20px;
        width: 80%;
        justify-content: center;
    }

    .mpos-btn {
        padding: 12px 24px;
        border-radius: 4px;
        font-weight: 600;
        cursor: pointer;
        text-transform: uppercase;
        font-size: 14px;
        border: none;
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .mpos-btn-primary {
        background-color: #e30613;
        /* MPOS Red approx */
        color: white;
    }

    .mpos-btn-primary:hover {
        background-color: #c00510;
        transform: translateY(-2px);
    }

    .mpos-btn-secondary {
        background-color: transparent;
        color: #333;
        /* Dark text */
        border: 2px solid #333;
    }

    .mpos-btn-secondary:hover {
        background-color: #333;
        color: #fff;
    }

    /* Step 2 Options */
    .mpos-step-2-options {
        position: absolute;
        top: 55%;
        /* Adjust based on valid image space */
        left: 50%;
        transform: translate(-50%, -50%);
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        width: 80%;
    }

    .mpos-option-card {
        background: #f9f9f9;
        padding: 20px;
        border: 2px solid #ddd;
        border-radius: 6px;
        text-align: center;
        cursor: pointer;
        transition: border-color 0.2s, background 0.2s;
    }

    .mpos-option-card:hover {
        border-color: rgba(49, 130, 206, var(--text-opacity));
        background: rgba(49, 130, 206, var(--text-opacity));
    }

    .mpos-option-card:hover svg, .mpos-option-card:hover path {
        fill: #fff;
    }

    .mpos-option-card:hover rect, .mpos-option-card:hover line {
        stroke: #fff;
    }

    .mpos-option-card.question:hover svg, .mpos-option-card.question:hover path {
        fill: none;
    }

    .mpos-option-card.question:hover .cls-1 {
        stroke: #fff;
    }

    .mpos-option-card:hover p {
        color: #fff;
    }

    .mpos-option-card.selected {
        background-color: rgba(49, 130, 206, var(--text-opacity));
        color: white;
        border-color: rgba(49, 130, 206, var(--text-opacity));
    }

    /* Step 3 Form */
    .mpos-step-3-container {
        position: absolute;
        top: 25%;
        left: 50%;
        transform: translateX(-50%);
        width: 80%;
        height: 65%;
        background: rgba(255, 255, 255, 0.95);
        /* More opaque background for readability */
        padding: 25px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        border-radius: 8px;
        overflow-y: auto;
    }

    .mpos-step-3-inner {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .mpos-form-group {
        margin-bottom: 12px;
    }

    .mpos-form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
        font-size: 13px;
        color: #333;
    }

    .mpos-input,
    .mpos-textarea {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 14px;
        box-sizing: border-box;
        transition: border-color 0.2s;
        background: #fff;
    }

    .mpos-input:focus,
    .mpos-textarea:focus {
        border-color: #e30613;
        outline: none;
    }

    .mpos-toggle-group {
        display: flex;
        gap: 20px;
        margin-bottom: 20px;
        border-bottom: 2px solid #eee;
        padding-bottom: 0;
    }

    .mpos-toggle-btn {
        background: none;
        border: none;
        padding: 10px 5px;
        cursor: pointer;
        font-weight: 600;
        color: #888;
        border-bottom: 3px solid transparent;
        transition: color 0.2s, border-color 0.2s;
        font-size: 15px;
    }

    .mpos-toggle-btn:hover {
        color: #333;
    }

    .mpos-toggle-btn.active {
        color: #e30613;
        border-bottom-color: #e30613;
    }

    .mpos-contact-section {
        display: none;
        flex: 1;
        /* Take available space */
    }

    .mpos-contact-section.active {
        display: block;
        animation: mposFadeIn 0.3s ease;
    }

    .mpos-block-btn {
        width: 100%;
        margin-top: 10px;
        padding: 14px;
        font-size: 15px;
        letter-spacing: 0.5px;
    }

    .mpos-info-text {
        font-size: 13px;
        color: #666;
        background: #f4f4f4;
        padding: 8px;
        margin-bottom: 15px;
        border-radius: 4px;
        border-left: 3px solid #e30613;
    }

    /* USPs */
    .mpos-usps {
        margin-top: 20px;
        border-top: 1px solid #eee;
        padding-top: 15px;
    }

    .mpos-usps ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .mpos-usps li {
        font-size: 12px;
        color: #555;
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .mpos-success-message {
        text-align: center;
        padding: 60px 40px;
        color: #28a745;
        font-size: 18px;
    }

    /* Utility */
    .mpos-hidden {
        display: none !important;
    }

    body.mpos-noscroll {
        overflow: hidden;
    }
}

@media screen and (max-width: 1023px) {
    .mpos-overlay {
        display: none !important;
    }
}
