/* Popup Plugin CSS - Responzivní styly s vysokou prioritou */

#popup-overlay.popup-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.82) !important;
    z-index: 999999 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
    box-sizing: border-box !important;
}

#popup-overlay.popup-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
}

#popup-overlay .popup-container {
    position: relative !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    margin: 20px !important;
    transform: scale(0.8) !important;
    transition: transform 0.3s ease !important;
    box-sizing: border-box !important;
    display: block !important;
}

#popup-overlay.show .popup-container {
    transform: scale(1) !important;
}

#popup-overlay .popup-content {
    position: relative !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    max-height: 90vh !important;
    min-width: 200px !important;
    min-height: 100px !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    box-sizing: border-box !important;
}

#popup-overlay .popup-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 45px !important;
    height: 45px !important;
    background: #ff7300 !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 24px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.3s ease, transform 0.2s ease !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

#popup-overlay .popup-close:hover {
    background: #e65c00 !important;
    transform: scale(1.1) !important;
}

#popup-overlay .popup-close:focus {
    outline: 2px solid #fff !important;
    outline-offset: 2px !important;
}

#popup-overlay .popup-image-wrapper {
    display: block !important;
    cursor: pointer !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: auto !important;
}

#popup-overlay .popup-image {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    max-width: 100% !important;
    transition: transform 0.3s ease !important;
    object-fit: contain !important;
    box-sizing: border-box !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#popup-overlay .popup-image:hover {
    transform: scale(1.02) !important;
}

/* Responzivní breakpointy */

/* Tablety */
@media (max-width: 768px) {
    #popup-overlay .popup-container {
        max-width: 95vw !important;
        margin: 10px !important;
    }
    
    #popup-overlay .popup-close {
        width: 38px !important;
        height: 38px !important;
        font-size: 20px !important;
        top: 8px !important;
        right: 8px !important;
        border-radius: 10px !important;
    }
}

/* Mobilní zařízení */
@media (max-width: 480px) {
    #popup-overlay.popup-overlay {
        padding: 10px !important;
    }
    
    #popup-overlay .popup-container {
        max-width: 100vw !important;
        max-height: 95vh !important;
        margin: 0 !important;
    }
    
    #popup-overlay .popup-content {
        border-radius: 4px !important;
        max-height: 95vh !important;
    }
    
    #popup-overlay .popup-close {
        width: 32px !important;
        height: 32px !important;
        font-size: 18px !important;
        top: 5px !important;
        right: 5px !important;
        border-radius: 8px !important;
    }
    
    #popup-overlay .popup-image {
        max-height: 85vh !important;
        object-fit: contain !important;
    }
}

/* Velmi malé obrazovky */
@media (max-width: 320px) {
    #popup-overlay .popup-container {
        margin: 5px !important;
    }
    
    #popup-overlay .popup-close {
        width: 28px !important;
        height: 28px !important;
        font-size: 16px !important;
        border-radius: 7px !important;
    }
}

/* Landscape orientace na mobilech */
@media (max-height: 500px) and (orientation: landscape) {
    #popup-overlay.popup-overlay {
        align-items: flex-start !important;
        padding-top: 10px !important;
    }
    
    #popup-overlay .popup-container {
        max-height: 85vh !important;
    }
    
    #popup-overlay .popup-content {
        max-height: 85vh !important;
    }
    
    #popup-overlay .popup-image {
        max-height: 75vh !important;
        object-fit: contain !important;
    }
}

/* Animace pro smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Accessibility - High contrast mode */
@media (prefers-contrast: high) {
    #popup-overlay .popup-close {
        background: #000 !important;
        border: 2px solid #fff !important;
    }
    
    #popup-overlay .popup-content {
        border: 2px solid #000 !important;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    #popup-overlay.popup-overlay,
    #popup-overlay .popup-container,
    #popup-overlay .popup-close,
    #popup-overlay .popup-image {
        transition: none !important;
    }
    
    html {
        scroll-behavior: auto !important;
    }
}

/* Print styles */
@media print {
    #popup-overlay.popup-overlay {
        display: none !important;
    }
}
