/* Popup Overlay */
.custom-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 1;
    transition: opacity 0.3s ease;
    padding: 10px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}
.slick-dots li button:before{ top: -3px; left: 2px; }
/* Popup Container */
.custom-popup-container {
    background: #fff;
    border-radius: 8px;
    max-width: 550px;
    width: 100%;
    max-height: 92vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: popupSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

@media (min-width: 769px) {
    .custom-popup-container {
        max-width: 550px;
    }
    
    .custom-popup-container.has-carousel {
        max-width: 550px;
    }
}
.slick-initialized .slick-slide{ padding: 0; }
.slick-dotted.slick-slider {
    margin-bottom: 0px !important;
}
@keyframes popupSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Close Button */
.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.close-popup:hover {
    background: #f5f5f5;
    transform: scale(1.1);
}

/* Popup Content */
.popup-content {
    padding: 0;
    text-align: center;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.popup-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a3a6b;
    margin: 0 0 8px 0;
    line-height: 1.2;
    padding: 0 15px;
}

.popup-image-wrapper {
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    max-height: 55vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex-shrink: 1;
    min-height: 180px;
    padding-bottom: 7px;
}

.popup-image {
    width: 100%;
    height: auto;
    max-height: 55vh;
    object-fit: contain;
    display: block;
    border-radius: 0;
}

.popup-description {
    font-size: 15px;
    line-height: 1.5;
    color: #555;
    margin: 8px 0 0 0;
    padding: 0 15px;
    flex-shrink: 0;
}
.popup-head{  font-family: var(--primary--font); font-size: 24px; font-weight: 700; line-height: 28px; margin-bottom: 5px !important; padding: 12px 15px 0 15px; flex-shrink: 0; }    
/* Popup Link/Button */
.popup-link {
    display: inline-block;
    padding: 11px 32px;
    background-color: #003A5A;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgb(0 40 61 / 30%);
    margin: 12px 15px 15px 15px;
    flex-shrink: 0;
    min-width: 140px;
    text-align: center;
}

.popup-link:hover {
    background-color: #00284A;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgb(0 40 61 / 40%);
}

/* Popup Footer */
.popup-footer {
    padding: 15px 30px;
    border-top: 1px solid #e0e0e0;
    background-color: #f9f9f9;
    border-radius: 0 0 8px 8px;
}

.dont-show-again {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #666;
}

.dont-show-again input[type="checkbox"] {
    margin: 0 8px 0 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.dont-show-again span {
    cursor: pointer;
}

/* Carousel Styles */
.popup-slider {
    flex: 1;
    overflow: hidden;
    max-height: calc(92vh - 65px);
    display: flex;
    flex-direction: column;
}

/* Custom scrollbar styling */
.popup-slider::-webkit-scrollbar,
.popup-content::-webkit-scrollbar {
    width: 6px;
}

.popup-slider::-webkit-scrollbar-track,
.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.popup-slider::-webkit-scrollbar-thumb,
.popup-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.popup-slider::-webkit-scrollbar-thumb:hover,
.popup-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.popup-slider.multiple-popups {
    position: relative;
    padding-bottom: 0;
}

.popup-slider.single-popup {
    overflow: hidden;
}

.popup-slide {
    outline: none;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Ensure slick track takes full height */
.popup-slider .slick-track {
    display: flex !important;
}

.popup-slider .slick-slide {
    height: auto;
    float: none;
}

/* Navigation Controls Container - Fixed at bottom */
.popup-navigation-controls {
    position: relative;
    height: 65px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 8px 8px;
}

/* Slick Slider Arrows - Fixed in navigation area */
.custom-popup-container .slick-prev,
.custom-popup-container .slick-next {
    position: absolute;
    bottom: 12px;
    top: auto;
    transform: translateY(0);
    background: rgba(0, 58, 90, 0.8);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.custom-popup-container .slick-prev:hover,
.custom-popup-container .slick-next:hover {
    background: rgba(0, 58, 90, 1);
    transform: translateY(0) scale(1.1);
}

.custom-popup-container .slick-prev {
    left: 20px;
}

.custom-popup-container .slick-next {
    right: 20px;
}

.custom-popup-container .slick-prev:before,
.custom-popup-container .slick-next:before {
    content: '';
}

/* Slick Dots - Fixed in navigation area */
.custom-popup-container .slick-dots {
    position: absolute;
    bottom: 17px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0;
    margin: 0;
    list-style: none;
    text-align: center;
    z-index: 999;
}

.custom-popup-container .slick-dots li {
    display: inline-block;
    margin: 0 5px;
}

.custom-popup-container .slick-dots li button {
    width: 12px;
    height: 12px;
    padding: 0;
    border: 2px solid #003A5A;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    font-size: 0;
    transition: all 0.3s ease;
}

.custom-popup-container .slick-dots li.slick-active button {
    background: #003A5A;
}

.custom-popup-container .slick-dots li button:hover {
    background: rgba(0, 58, 90, 0.5);
}

/* Adjust container for carousel */
.custom-popup-container.has-carousel {
    max-width: 550px;
}

.custom-popup-container.has-carousel .popup-slider {
    max-height: calc(92vh - 65px);
}

/* Tablet and smaller devices */
@media (max-width: 768px) {
    .custom-popup-overlay {
        padding: 8px;
        background-color: rgba(0, 0, 0, 0.75);
    }
    
    .custom-popup-container {
        max-height: 92vh;
        max-width: 95%;
        border-radius: 10px;
        box-shadow: 0 12px 45px rgba(0, 0, 0, 0.35);
    }
    
    .popup-head{ 
        font-size: 20px !important;
        line-height: 24px;
        padding: 10px 15px 0 15px !important;
        margin-bottom: 5px !important;
        font-weight: 700;
    }
    
    .popup-content {
        padding: 0;
    }
    
    .popup-image-wrapper {
        max-height: 50vh;
        margin-bottom: 0;
        min-height: 160px;
    }
    
    .popup-image {
        max-height: 50vh;
    }
    
    .popup-head {
        font-size: 19px !important;
        line-height: 23px;
        padding: 10px 15px 0 15px !important;
        margin-bottom: 5px !important;
        font-weight: 700;
    }
    
    .popup-link {
        padding: 11px 30px;
        font-size: 15px;
        border-radius: 6px;
        font-weight: 700;
        box-shadow: 0 4px 12px rgb(0 40 61 / 35%);
    }
    
    /* Arrows remain at bottom on mobile */
    .custom-popup-container .slick-prev {
        left: 10px;
        bottom: 15px;
    }
    
    .custom-popup-container .slick-next {
        right: 10px;
        bottom: 15px;
    }
    
    .custom-popup-container .slick-prev,
    .custom-popup-container .slick-next {
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
    
    .custom-popup-container .slick-dots {
        bottom: 20px;
    }
    
    .popup-navigation-controls {
        height: 60px;
    }
    
    .custom-popup-container.has-carousel .popup-slider {
        max-height: calc(92vh - 60px);
    }
    
    .popup-slider {
        max-height: calc(92vh - 60px);
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .custom-popup-overlay {
        padding: 5px;
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    .custom-popup-container {
        max-width: 98%;
        margin: 0;
        max-height: 92vh;
        border-radius: 12px;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    }

    .popup-content {
        padding: 0;
    }
    
    .popup-title {
        font-size: 17px;
        margin-bottom: 6px;
        font-weight: 700;
        color: #003A5A;
    }
    
    .popup-description {
        font-size: 14px;
        line-height: 1.5;
        margin: 8px 0 0 0;
        color: #444;
    }
    
    .popup-footer {
        padding: 10px 15px;
    }
    
    .popup-image-wrapper {
        max-height: 48vh;
        margin-bottom: 0;
        min-height: 140px;
        border-radius: 0;
    }
    
    .popup-image {
        max-height: 48vh;
    }
    
    .popup-link {
        padding: 12px 28px;
        font-size: 15px;
        margin: 12px 12px 14px 12px;
        min-width: 140px;
        border-radius: 6px;
        font-weight: 700;
        box-shadow: 0 4px 12px rgb(0 40 61 / 35%);
        letter-spacing: 0.3px;
    }
    
    .popup-link:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgb(0 40 61 / 30%);
    }
    
    .popup-head {
        font-size: 18px !important;
        line-height: 22px;
        padding: 10px 12px 0 12px !important;
        margin-bottom: 5px !important;
        font-weight: 700;
        color: #003A5A;
    }
    
    .close-popup {
        width: 34px;
        height: 34px;
        font-size: 22px;
        top: 8px;
        right: 8px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .custom-popup-container {
        max-height: 100vh;
        border-radius: 8px;
    }
    
    .custom-popup-overlay {
        padding: 3px;
        background-color: rgba(0, 0, 0, 0.85);
    }
    
    .popup-image-wrapper {
        max-height: 40vh;
    }
    
    .popup-image {
        max-height: 40vh;
    }
    
    .popup-head {
        font-size: 16px !important;
        line-height: 20px;
        padding: 10px 10px 0 10px;
        font-weight: 700;
    }
    
    .popup-title {
        font-size: 15px;
        padding: 0 10px;
        font-weight: 700;
    }
    
    .popup-description {
        font-size: 13px;
        padding: 0 10px;
        line-height: 1.5;
    }
    
    .popup-link {
        padding: 10px 20px;
        font-size: 14px;
        margin: 10px 10px 12px 10px;
        font-weight: 700;
        border-radius: 6px;
        min-width: 120px;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .custom-popup-container {
        max-height: 92vh;
    }
    
    .popup-image-wrapper {
        max-height: 35vh;
    }
    
    .popup-image {
        max-height: 35vh;
    }
    
    .popup-slider {
        max-height: calc(95vh - 60px);
    }
    
    .popup-navigation-controls {
        height: 60px;
    }
    
    .custom-popup-container .slick-prev,
    .custom-popup-container .slick-next {
        width: 30px;
        height: 30px;
        font-size: 20px;
        bottom: 12px;
    }
    
    .custom-popup-container .slick-dots {
        bottom: 15px;
    }
}

/* Viewport height adjustments for shorter screens */
@media (max-height: 700px) {
    .custom-popup-overlay {
        padding: 8px;
    }
    
    .custom-popup-container {
        max-height: 90vh;
        max-width: 95%;
    }
    
    .popup-image-wrapper {
        max-height: 42vh;
        min-height: 140px;
    }
    
    .popup-image {
        max-height: 42vh;
    }
    
    .popup-head {
        font-size: 20px !important;
        line-height: 24px;
        padding: 8px 15px 0 15px !important;
    }
    
    .popup-link {
        padding: 8px 24px;
        margin: 10px 15px 10px 15px;
    }
}

@media (max-height: 600px) {
    .custom-popup-overlay {
        padding: 5px;
    }
    
    .custom-popup-container {
        max-height: 95vh;
        max-width: 98%;
    }
    
    .popup-image-wrapper {
        max-height: 38vh;
        min-height: 110px;
    }
    
    .popup-image {
        max-height: 38vh;
    }
    
    .popup-head {
        font-size: 18px !important;
        line-height: 22px;
        padding: 6px 12px 0 12px !important;
        margin-bottom: 3px !important;
    }
    
    .popup-link {
        padding: 7px 20px;
        font-size: 14px;
        margin: 8px 12px 8px 12px;
    }
    
    .popup-navigation-controls {
        height: 55px;
    }
    
    .custom-popup-container .slick-prev,
    .custom-popup-container .slick-next {
        width: 32px;
        height: 32px;
        bottom: 10px;
    }
    
    .custom-popup-container .slick-dots {
        bottom: 14px;
    }
}

/* Short viewport with wide screen (like dev tools open) */
@media (max-height: 650px) and (min-width: 769px) {
    .custom-popup-overlay {
        padding: 8px;
    }
    
    .custom-popup-container {
        max-width: 550px;
        max-height: 90vh;
    }
    
    .popup-image-wrapper {
        max-height: 45vh;
        min-height: 150px;
    }
    
    .popup-image {
        max-height: 45vh;
    }
}