/* ==========================================================================
   Haico Popup – Styles
   Matches the Haico site design: #005a40 primary, #aef6b6 accent,
   Rubik headings, Roboto body, uppercase buttons.
   ========================================================================== */

/* ---------- Overlay ---------- */
.haico-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 0;
}

.haico-popup-overlay.haico-popup-active {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when popup is open */
body.haico-popup-open {
    overflow: hidden;
}

/* ---------- Container (the white box) ---------- */
.haico-popup-container {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border: 2px solid #005a40;
    border-radius: 0;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    padding: 50px 45px 45px;
    animation: haico-popup-slideIn 0.35s ease forwards;
}

@keyframes haico-popup-slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ---------- Close button ---------- */
.haico-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #005a40;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s ease, background-color 0.2s ease;
    z-index: 10;
    font-family: 'Rubik', Helvetica, Arial, Lucida, sans-serif;
    font-weight: 300;
}

.haico-popup-close:hover {
    color: #ffffff;
    background-color: #005a40;
}

/* ---------- Content area ---------- */
.haico-popup-content {
    color: #005a40;
    font-family: 'Roboto', Helvetica, Arial, Lucida, sans-serif;
    font-size: 15px;
    line-height: 1.7;
}

.haico-popup-content h1,
.haico-popup-content h2,
.haico-popup-content h3,
.haico-popup-content h4,
.haico-popup-content h5,
.haico-popup-content h6 {
    font-family: 'Rubik', Helvetica, Arial, Lucida, sans-serif;
    color: #005a40;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 500;
}

.haico-popup-content h2 {
    font-size: 22px;
}

.haico-popup-content h3 {
    font-size: 18px;
}

.haico-popup-content p {
    margin-bottom: 15px;
    color: #333;
}

.haico-popup-content a {
    color: #005a40;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.haico-popup-content a:hover {
    color: #00bce0;
}

.haico-popup-content ul,
.haico-popup-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
    color: #333;
}

.haico-popup-content ul li,
.haico-popup-content ol li {
    margin-bottom: 6px;
}

.haico-popup-content img {
    max-width: 100%;
    height: auto;
}

/* Divi buttons inside popup */
.haico-popup-content .et_pb_button,
.haico-popup-content a.et_pb_button {
    background-color: #ffffff;
    border: 1px solid #005a40;
    color: #005a40;
    text-transform: uppercase;
    font-family: 'Rubik', Helvetica, Arial, Lucida, sans-serif;
    padding: 10px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.haico-popup-content .et_pb_button:hover,
.haico-popup-content a.et_pb_button:hover {
    background-color: #aef6b6;
    color: #005a40;
    border-color: #005a40;
}

/* ---------- Scrollbar styling inside popup ---------- */
.haico-popup-container::-webkit-scrollbar {
    width: 6px;
}

.haico-popup-container::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.haico-popup-container::-webkit-scrollbar-thumb {
    background: #005a40;
    border-radius: 3px;
}

/* ==========================================================================
   Desktop – ensure popup does not overlap fixed header / footer
   ========================================================================== */
@media (min-width: 981px) {
    .haico-popup-overlay {
        /* Divi default fixed header is ~80px; adjust if needed */
        top: 0;
        bottom: 0;
        padding: 80px 20px 40px;
    }

    .haico-popup-container {
        max-height: calc(100vh - 160px);
    }
}

/* ==========================================================================
   Mobile – popup takes nearly full screen
   ========================================================================== */
@media (max-width: 980px) {
    .haico-popup-overlay {
        padding: 10px;
        align-items: stretch;
    }

    .haico-popup-container {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        padding: 50px 20px 20px;
        border: none;
        border-top: 3px solid #005a40;
    }

    .haico-popup-close {
        top: 8px;
        right: 10px;
        font-size: 36px;
        padding: 6px 12px;
    }
}
