/* ========================================
   SISTEMA DE BANNERS RESPONSIVOS
   ======================================== */

/* Container geral dos banners */
.banner-responsive-container {
    text-align: center;
    margin: 15px 0;
    overflow: hidden;
}

.banner-responsive-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Banners por posição */
.banner-header_top {
    margin: 10px 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.banner-header_bottom {
    margin: 20px 0;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.banner-sidebar_top,
.banner-sidebar_middle,
.banner-sidebar_bottom {
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.banner-content_top {
    margin: 15px 0 25px 0;
}

.banner-content_middle {
    margin: 25px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.banner-content_bottom {
    margin: 25px 0 15px 0;
}

.banner-footer_top {
    margin: 20px 0 10px 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.banner-footer_bottom {
    margin: 10px 0;
}

/* Responsividade para tablets */
@media (max-width: 991px) {
    .banner-responsive-container {
        margin: 10px 0;
    }
    
    .banner-sidebar_top,
    .banner-sidebar_middle,
    .banner-sidebar_bottom {
        margin: 15px 0;
        padding: 10px;
    }
}

/* Responsividade para mobile */
@media (max-width: 767px) {
    .banner-responsive-container {
        margin: 8px 0;
    }
    
    .banner-header_top,
    .banner-header_bottom {
        margin: 8px 0;
    }
    
    .banner-content_top,
    .banner-content_middle,
    .banner-content_bottom {
        margin: 15px 0;
    }
    
    .banner-sidebar_top,
    .banner-sidebar_middle,
    .banner-sidebar_bottom {
        margin: 10px 0;
        padding: 8px;
        background-color: transparent;
        border: none;
    }
    
    .banner-footer_top,
    .banner-footer_bottom {
        margin: 8px 0;
    }
}

/* Animações suaves */
.banner-responsive-container {
    transition: opacity 0.3s ease-in-out;
}

.banner-responsive-container:hover {
    opacity: 0.9;
}

/* ========================================
   BANNERS FIXOS (STICKY/FIXED)
   ======================================== */

/* Banner fixo no topo - acompanha scroll */
.banner-fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    animation: slideDownBanner 0.3s ease-out;
}

/* Banner fixo no rodapé - acompanha scroll */
.banner-fixed-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background-color: #fff;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
    animation: slideUpBanner 0.3s ease-out;
}

/* Banner sticky - fixa quando chega no topo */
.banner-sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.banner-sticky.is-stuck {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Botão de fechar para banners fixos */
.banner-fixed-top .close-banner,
.banner-fixed-bottom .close-banner {
    position: absolute;
    top: 5px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.banner-fixed-top .close-banner:hover,
.banner-fixed-bottom .close-banner:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
}

/* Animações para banners fixos */
@keyframes slideDownBanner {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUpBanner {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Espaçamento para compensar banner fixo */
body.has-fixed-top-banner {
    padding-top: 90px; /* Ajuste conforme altura do banner */
}

body.has-fixed-bottom-banner {
    padding-bottom: 90px; /* Ajuste conforme altura do banner */
}

/* Banner fixo com transparência */
.banner-fixed-transparent {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Banner fixo escondido (para mostrar/esconder no scroll) */
.banner-fixed-hidden {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.banner-fixed-bottom.banner-fixed-hidden {
    transform: translateY(100%);
}

/* Banner fixo visível */
.banner-fixed-visible {
    transform: translateY(0);
}

/* Responsivo para banners fixos */
@media (max-width: 767px) {
    body.has-fixed-top-banner {
        padding-top: 60px;
    }
    
    body.has-fixed-bottom-banner {
        padding-bottom: 60px;
    }
    
    .banner-fixed-top,
    .banner-fixed-bottom {
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    }
}

/* Banners em overlay */
.banner-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.banner-overlay .close-banner {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

.banner-overlay .close-banner:hover {
    color: #333;
}

/* Banners em carrossel */
.banner-carousel {
    position: relative;
    overflow: hidden;
}

.banner-carousel .banner-slide {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.banner-carousel .banner-slide.active {
    display: block;
}

.banner-carousel .banner-controls {
    text-align: center;
    margin-top: 10px;
}

.banner-carousel .banner-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ccc;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.banner-carousel .banner-dot.active {
    background-color: #007cba;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Classes de animação */
.banner-animate-top {
    animation: slideInFromTop 0.6s ease-out;
}

.banner-animate-bottom {
    animation: slideInFromBottom 0.6s ease-out;
}

.banner-animate-fade {
    animation: fadeIn 0.8s ease-in-out;
}

/* Banners com bordas arredondadas */
.banner-rounded {
    border-radius: 8px;
    overflow: hidden;
}

.banner-rounded img {
    border-radius: 8px;
}

/* Banners com sombra */
.banner-shadow {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Banners com hover effect */
.banner-hover-effect {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.banner-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Utilitários */
.banner-center {
    text-align: center;
}

.banner-left {
    text-align: left;
}

.banner-right {
    text-align: right;
}

.banner-full-width {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Banners para impressão */
@media print {
    .banner-responsive-container {
        display: none !important;
    }
}

/* Acessibilidade */
.banner-responsive-container a:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.banner-responsive-container img {
    border: none;
}

/* Banners com lazy loading */
.banner-lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.banner-lazy.loaded {
    opacity: 1;
}

/* Responsividade específica para dispositivos muito pequenos */
@media (max-width: 480px) {
    .banner-responsive-container {
        margin: 5px 0;
    }
    
    .banner-responsive-container img {
        max-width: 100%;
        height: auto;
    }
}

/* Banners em modo escuro */
@media (prefers-color-scheme: dark) {
    .banner-sidebar_top,
    .banner-sidebar_middle,
    .banner-sidebar_bottom {
        background-color: #2a2a2a;
        border-color: #444;
    }
    
    .banner-overlay {
        background-color: rgba(42, 42, 42, 0.95);
    }
}

/* ========================================
   SISTEMA AVANÇADO DE BANNERS ROTATIVOS
   ======================================== */

/* Container de rotação */
.banner-rotation-container {
    position: relative;
    overflow: hidden;
    margin: 15px 0;
}

.banner-rotation-item {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.banner-rotation-item.active {
    display: block;
    opacity: 1;
}

/* Animações de rotação */
.banner-rotation-item.fade-in {
    animation: bannerFadeIn 0.5s ease-in-out;
}

.banner-rotation-item.slide-in {
    animation: bannerSlideIn 0.5s ease-in-out;
}

.banner-rotation-item.zoom-in {
    animation: bannerZoomIn 0.5s ease-in-out;
}

.banner-rotation-item.flip-in {
    animation: bannerFlipIn 0.6s ease-in-out;
}

/* Controles de rotação */
.banner-rotation-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.banner-rotation-container:hover .banner-rotation-controls {
    opacity: 1;
}

.banner-prev,
.banner-next {
    position: absolute;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 12px 15px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 4px;
    transition: all 0.3s ease;
    pointer-events: all;
    z-index: 10;
}

.banner-prev {
    left: 15px;
}

.banner-next {
    right: 15px;
}

.banner-prev:hover,
.banner-next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Indicadores de rotação */
.banner-rotation-indicators {
    text-align: center;
    margin-top: 15px;
    padding: 10px 0;
}

.banner-rotation-indicators .indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    margin: 0 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-rotation-indicators .indicator.active {
    background: #007cba;
    transform: scale(1.2);
}

.banner-rotation-indicators .indicator:hover {
    background: #005a87;
    transform: scale(1.1);
}

/* ========================================
   BANNERS INTELIGENTES
   ======================================== */

/* Container de banner inteligente */
.smart-banner-container {
    position: relative;
    text-align: center;
    margin: 15px 0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.smart-banner-container.fade-in {
    animation: smartBannerFadeIn 0.5s ease-in-out;
}

.smart-banner-container.slide-in {
    animation: smartBannerSlideIn 0.5s ease-in-out;
}

.smart-banner-container.zoom-in {
    animation: smartBannerZoomIn 0.5s ease-in-out;
}

/* Botão de fechar banner inteligente */
.smart-banner-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    z-index: 15;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-banner-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.smart-banner-close:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Conteúdo do banner inteligente */
.smart-banner-content {
    position: relative;
}

/* ========================================
   ANIMAÇÕES AVANÇADAS
   ======================================== */

@keyframes bannerFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bannerSlideIn {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes bannerZoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bannerFlipIn {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

@keyframes smartBannerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes smartBannerSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes smartBannerZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   TEMPLATES DE BANNER
   ======================================== */

/* Template premium */
.banner-premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.banner-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

/* Template elegante */
.banner-elegant {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Template minimalista */
.banner-minimal {
    border: none;
    background: transparent;
    padding: 10px 0;
    margin: 10px 0;
}

.banner-minimal img {
    filter: grayscale(20%);
    transition: filter 0.3s ease;
}

.banner-minimal:hover img {
    filter: grayscale(0%);
}

/* ========================================
   RESPONSIVIDADE AVANÇADA
   ======================================== */

/* Tablets */
@media (max-width: 991px) {
    .banner-rotation-container {
        margin: 12px 0;
    }
    
    .banner-prev,
    .banner-next {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .banner-rotation-indicators .indicator {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
    
    .smart-banner-close {
        width: 26px;
        height: 26px;
        font-size: 16px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .banner-rotation-container {
        margin: 10px 0;
    }
    
    .banner-rotation-controls {
        opacity: 1; /* Sempre visível no mobile */
    }
    
    .banner-prev,
    .banner-next {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .banner-prev {
        left: 10px;
    }
    
    .banner-next {
        right: 10px;
    }
    
    .banner-rotation-indicators {
        margin-top: 10px;
        padding: 8px 0;
    }
    
    .banner-rotation-indicators .indicator {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }
    
    .smart-banner-container {
        margin: 10px 0;
        border-radius: 6px;
    }
    
    .smart-banner-close {
        top: 5px;
        right: 5px;
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    
    .banner-premium {
        padding: 15px;
        margin: 15px 0;
        border-radius: 8px;
    }
    
    .banner-elegant {
        padding: 12px;
        margin: 12px 0;
        border-radius: 8px;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .banner-rotation-container,
    .smart-banner-container {
        margin: 8px 0;
    }
    
    .banner-prev,
    .banner-next {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .banner-rotation-indicators .indicator {
        width: 6px;
        height: 6px;
        margin: 0 2px;
    }
    
    .banner-premium,
    .banner-elegant {
        padding: 10px;
        margin: 10px 0;
    }
}

/* ========================================
   PERFORMANCE E OTIMIZAÇÕES
   ======================================== */

/* Lazy loading melhorado */
.banner-lazy-advanced {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.banner-lazy-advanced.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Preload de imagens críticas */
.banner-preload {
    position: absolute;
    top: -9999px;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Otimização para impressão */
@media print {
    .banner-rotation-container,
    .smart-banner-container,
    .banner-rotation-controls,
    .banner-rotation-indicators,
    .smart-banner-close {
        display: none !important;
    }
}

/* Modo de alto contraste */
@media (prefers-contrast: high) {
    .banner-prev,
    .banner-next,
    .smart-banner-close {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
    
    .banner-rotation-indicators .indicator {
        border: 2px solid #000;
    }
    
    .banner-rotation-indicators .indicator.active {
        background: #000;
    }
}

/* Redução de movimento */
@media (prefers-reduced-motion: reduce) {
    .banner-rotation-item,
    .smart-banner-container,
    .banner-prev,
    .banner-next,
    .banner-rotation-indicators .indicator {
        animation: none !important;
        transition: none !important;
    }
}