/* ===================================
   SIMPLE POPUP STYLES
   =================================== */
#vpopup-overlay.vpopup-simple {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#vpopup-container {
    position: relative;
    background: transparent;
    padding: 10px;
    border-radius: 5px;
    max-width: 90%;
    max-height: min(1100px, 90vh);
}

#vpopup-container img {
    max-width: 100%;
    max-height: min(1100px, 90vh);
    height: auto;
    display: block;
}

.vpopup-close-btn {
    position: absolute;
    top: 5px; 
    right: 10px;
    background: transparent;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #000;
    z-index: 10;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.vpopup-close-btn:hover {
    transform: scale(1.1);
    color: #ff0000;
}

.vpopup-cta {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

/* ===================================
   CAROUSEL POPUP STYLES
   =================================== */
#vpopup-carousel-overlay.vpopup-carousel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

#vpopup-carousel-container {
    position: relative;
    background: transparent;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    /* box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); */
    outline: none !important;
}

/* Carousel Wrapper */
.vpopup-carousel .vcarousel-popup-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
}

/* Carousel Container */
.vpopup-carousel .vcarousel-f {
    /* width: 100%; */
    height: 100%;
    min-height: 500px;
    outline: none !important;
}

/* Ensure Flickity can measure properly even when initially hidden */
.vpopup-carousel[style*="display: flex"] .vcarousel-f,
.vpopup-carousel[style*="visibility: hidden"] .vcarousel-f {
    visibility: visible !important;
}

/* Carousel Cells (Slides) */
.vpopup-carousel .vcarousel-cell {
    /* Always full width - content wrapper inside will be variable */
    width: 100%;
    height: 100%;
    min-height: 500px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Slide Content Wrapper - This gets the variable width and styling */
.vpopup-carousel .slide-content-wrapper {
    /* Default max-width, overridden by inline styles */
    max-width: 100%;
    width: 100%;
    position: relative;
    z-index: 2;
    min-height: 500px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    overflow: visible; /* Changed from hidden to visible so buttons can overflow */
}

/* Responsive width adjustments for content wrapper */
@media (max-width: 1200px) {
    .vpopup-carousel .slide-content-wrapper[style*="width: 25%"],
    .vpopup-carousel .slide-content-wrapper[style*="width: 50%"] {
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    .vpopup-carousel .slide-content-wrapper {
        width: 100% !important;
        padding: 20px;
    }
}

/* Slide Content */
.vpopup-carousel .slide-content {
    color: inherit;
    font-size: 16px;
    line-height: 1.6;
    max-width: 100%;
    text-wrap: balance;
    word-break: break-word;
}

.vpopup-carousel .theContent p {
    margin-bottom: 1rem;
}

.vpopup-carousel .theContent > *:last-child {
    margin-bottom: 0;
}

.vpopup-carousel .theContent * {
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
}

.vpopup-carousel .slide-content h1,
.vpopup-carousel .slide-content h2,
.vpopup-carousel .slide-content h3,
.vpopup-carousel .slide-content h4,
.vpopup-carousel .slide-content h5,
.vpopup-carousel .slide-content h6 {
    font-size: calc(2.1875rem + ((1vw - 0.225rem) * 3.6765));
}
@media (min-width: 1800px) {
    .vpopup-carousel .slide-content h1,
    .vpopup-carousel .slide-content h2,
    .vpopup-carousel .slide-content h3,
    .vpopup-carousel .slide-content h4,
    .vpopup-carousel .slide-content h5,
    .vpopup-carousel .slide-content h6 {
        font-size: 3rem;
    }
}

.vpopup-carousel .theContent [style*="text-decoration: underline"] {
    text-decoration: none !important;
    color: var(--color-orange);
}

.vpopup-carousel .theContent b,
.vpopup-carousel .theContent strong {
    font-weight: normal;
    font-family: var(--font-sb);
}

.vpopup-carousel .theContent.font-b b,
.vpopup-carousel .theContent.font-b strong {
    font-family: var(--font-h);
}

.vpopup-carousel .theContent ul,
.vpopup-carousel .theContent ol {
    padding-inline-start: 1.6rem;
    list-style: "— ";
}

/* Override text color when background is image */
.vpopup-carousel .vcarousel-cell[style*="background-image"] .slide-content {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Carousel CTA Button */
.vpopup-carousel-cta {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 35px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
}

.vpopup-carousel-cta:hover {
    background: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
}

/* Navigation Buttons */
.vpopup-carousel .vcarousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.vpopup-carousel .vcarousel-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.vpopup-carousel .vcarousel-nav.prev {
    left: 20px;
}

.vpopup-carousel .vcarousel-nav.next {
    right: 20px;
}

/* Arrow Icons */
.vpopup-carousel .vcarousel-nav.prev svg {
    margin-left: -4px;
}
.vpopup-carousel .vcarousel-nav.next svg {
    margin-left: 4px;
    transform: rotate(180deg);
}

/* Close Button for Carousel */
.vpopup-carousel-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #333;
    z-index: 20;
    line-height: 1;
    padding: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.vpopup-carousel-close-btn:hover {
    background: #fff;
    transform: scale(1.1) rotate(90deg);
    color: #ff0000;
}

.vpopup-carousel-close-btn svg {
    width: 60%;
    height: 100%;
}
/* ===================================
   RESPONSIVE STYLES
   =================================== */
@media (max-width: 768px) {
    .vpopup-carousel .vcarousel-popup-wrapper {
        min-height: 400px;
    }
    #vpopup-carousel-container {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .vpopup-carousel .vcarousel-cell {
        padding: 40px 30px;
        /* min-height: 400px; */
    }
    
    .vpopup-carousel .slide-content {
        font-size: 14px;
    }
    
    .vpopup-carousel .vcarousel-nav {
        width: 40px;
        height: 40px;
    }
    
    .vpopup-carousel .vcarousel-nav.prev {
        left: 10px;
    }
    
    .vpopup-carousel .vcarousel-nav.next {
        right: 10px;
    }
    
    .vpopup-carousel .vcarousel-nav.prev::before,
    .vpopup-carousel .vcarousel-nav.next::before {
        font-size: 24px;
    }
    
    .vpopup-carousel-close-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 10px;
        right: 10px;
    }
    
    .vpopup-carousel-cta {
        padding: 12px 25px;
        font-size: 14px;
    }
}

/* Flickity overrides for popup */
.vpopup-carousel .flickity-page-dots {
    bottom: 20px;
}

.vpopup-carousel .flickity-page-dots .dot {
    background: rgba(255, 255, 255, 0.5);
    width: 12px;
    height: 12px;
}

.vpopup-carousel .flickity-page-dots .dot.is-selected {
    background: #fff;
}

/* Animation */
@keyframes vpopupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.vpopup-carousel #vpopup-carousel-container,
.vpopup-simple #vpopup-container {
    animation: vpopupFadeIn 0.3s ease-out;
}