#popup-bg {
    grid-template-columns: 1fr;
    grid-template-rows: 14rem 1fr;
    justify-items: center;
    position: fixed;
    background: #00000033;
    height: 100%;
    width: 100%;
    top: 0;
    z-index: 2;
    overflow: hidden;
}

.popup-unit {
    margin: .25rem;
    width: 100%;
    max-width: 200px;
    height: auto;
}

.grid-row1 {
    grid-row: 1;
}

.grid-row2 {
    grid-row: 2;
}

.grid-row3 {
    grid-row: 3;
}

.popup-crop {
    grid-column: 1;
    grid-row: 1 / 3;
    z-index: 1;
    height: min(21.5rem, calc(100vh - 15rem));
    overflow: hidden;
}

#popup {
    width: min(16rem, calc(100vw - 2rem));
    height: auto;
    max-height: calc(100vh - 15rem);
    background: #fff;
    opacity: 0;
    border: 2px solid #207;
    animation: .4s .4s forwards fadeIn;
    overflow-y: auto;

    .top {
        background: #207;
        padding: .5rem;

        span {
            padding-left: 12px;
            font-size: 14px;
        }

        .popclose {
            width: 12px;
            min-width: 20px;
            min-height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
    }

    img.logo {
        max-width: 100px;
        height: auto;
    }
}

.fadeIn {
    animation: .4s forwards reverse fadeIn;
}

.lh-60px {
    line-height: 60px;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(0, 100%);
    }

    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

#popup-carpet {
    grid-column: 1;
    grid-row: 2 / 3;
    transform: perspective(1cm) rotateX(6deg);

    span {
        width: min(15rem, calc(100vw - 4rem));
        display: flex;
        background: radial-gradient(circle, rgba(51, 2, 121, 1) 66%, rgba(164, 4, 123, 1) 92%);
        height: 10rem;
        border: 4px solid gold;
        animation: .4s popSlideIn;
    }
}

.popSlideIn {
    animation: .4s forwards reverse popSlideIn;
}

@keyframes popSlideIn {
    from {
        opacity: 0;
        transform: translateY(200px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#popup .main {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    padding: .3rem;
    gap: .15rem;

    .logo-row {
        grid-row: 1;
        grid-column: 1 / 3;
        margin-bottom: 8px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
    }

    .unit {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0.25rem;
    }

    .info {
        grid-column: 2;
        grid-row: 2;
        margin: 0 auto;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0.25rem;
    }

    .blue-model3-sm {
        display: none;
    }

    .copy {
        display: none;
    }

}

@media (max-width:799px) {
    #popup .main {
        padding: .25rem;
        gap: .25rem;

        .logo-row .logo {
            max-width: 60px !important;
        }
        
        .logo-row .text-32px {
            font-size: 14px !important;
            line-height: 1.2 !important;
        }

        .unit .popup-unit {
            max-height: 80px;
            width: auto;
        }
        
        .unit .text-32px {
            font-size: 16px !important;
        }
        
        .unit .text-16px {
            font-size: 10px !important;
            line-height: 1.2 !important;
        }

        .info .text-60px {
            font-size: 28px !important;
            line-height: 1 !important;
        }
        
        .info .text-32px {
            font-size: 16px !important;
            line-height: 1.2 !important;
        }

        .info .text-20px {
            font-size: 12px !important;
            line-height: 1.2 !important;
        }

        .blue-model3-sm {
            width: 60px;
            height: auto;
        }

        .info .r410a {
            width: 40px !important;
            margin-bottom: 4px !important;
        }

        .lh-60px {
            line-height: 20px !important;
        }
    }
    
    #popup .top span {
        font-size: 12px !important;
    }

    #popup-carpet span {
        height: 6rem;
    }
}

@media (min-width:800px) {
    #popup-bg {
        grid-template-rows: 10rem 1fr;
    }

    .popup-crop {
        height: min(22rem, calc(100vh - 12rem));
    }

    #popup {
        width: min(30rem, calc(100vw - 2rem));
        height: auto;
        max-height: calc(100vh - 10rem);
        
        img.logo {
            max-width: 100px;
        }

        .main {
            grid-template-columns: 2fr 1fr;
            grid-template-rows: auto 1fr;
            padding: 0.6rem;
            
            .logo-row {
                grid-row: 1;
                grid-column: 1 / 4;
            }

            .unit {
                grid-column: 1 / 2;
                grid-row: 3;
                width: auto;
            }
            
            .info {
                grid-column: 2 / 3;
                grid-row: 3;
                margin: 0 auto auto 0;
            }

            .blue-model3-sm {
                display: block;
                grid-column: 1 / 2;
                grid-row: 3;
                margin: -1rem 2rem auto auto;
            }
            
            .copy {
                display: block;
                grid-column: 1 / 2;
                grid-row: 3;
                margin: -1.5rem auto auto 0;
                width: 8rem;
            }
        }
    }

    #popup-carpet span {
        width: min(25rem, calc(100vw - 4rem));
        display: flex;
        background: radial-gradient(circle, rgba(51, 2, 121, 1) 66%, rgba(164, 4, 123, 1) 92%);
        height: 13rem;
    }
}
