/**
 * VR Shopping - Correções de Responsividade
 * Melhorias e fixes para garantir consistência cross-browser
 * 
 * @version 1.0.0
 * @description Arquivo de correções para ser importado APÓS todos os outros CSS
 *              Este arquivo resolve edge cases e garante uniformidade
 * 
 * IMPORTAR ESTE ARQUIVO POR ÚLTIMO:
 * <link rel="stylesheet" href="css/responsivity-fixes.css">
 */

/* ============================================
   FIX 1: VIEWPORT HEIGHT CONSISTENTE
   Resolve o problema do 100vh em mobile
   ============================================ */
html {
    height: 100%;
    height: -webkit-fill-available;
}

body {
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
}

/* ============================================
   FIX 2: SCROLLBAR CONSISTENTE (Chrome/Edge)
   ============================================ */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* ============================================
   FIX 3: FIREFOX FLEX GAP FALLBACK
   Para Firefox versões antigas sem gap support
   ============================================ */
@supports not (gap: 1px) {
    .dklsdk1 > * + * {
        margin-left: 20px;
    }
    
    .cookie-content > * + * {
        margin-left: 20px;
    }
    
    nav.saldkaslkdsad22222 ul > * + * {
        margin-left: 36px;
    }
}

/* ============================================
   FIX 4: DESKTOP ESPECÍFICO (Chrome/Edge)
   Prioridade máxima para desktop 1024px+
   ============================================ */
@media screen and (min-width: 1024px) {
    /* Garantir layout desktop lado a lado */
    .zero001 {
        float: left !important;
        width: 40% !important;
        text-align: left !important;
    }
    
    .zero002 {
        float: right !important;
        width: 60% !important;
        text-align: right !important;
    }
    
    /* Botão sempre à direita no desktop */
    #mostrarBtn,
    .button.prefer-responsive {
        float: right !important;
        position: relative !important;
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Header com altura consistente */
    header.padrotramanho {
        min-height: 70px;
        display: flex;
        align-items: center;
    }
    
    header.padrotramanho .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
}

/* ============================================
   FIX 5: NOTEBOOK 13-14" (1024px - 1440px)
   Resoluções comuns de notebooks
   ============================================ */
@media screen and (min-width: 1024px) and (max-width: 1440px) {
    .padrotramanho {
        max-width: 95%;
        padding: 0 20px;
    }
    
    .zero001 img {
        max-width: 120px;
    }
    
    #mostrarBtn,
    .button.prefer-responsive {
        font-size: 12px;
        padding: 9px 20px;
    }
    
    .asldkaskdsdheader {
        height: 60vh;
    }
}

/* ============================================
   FIX 6: DESKTOP FULL HD (1920px)
   ============================================ */
@media screen and (min-width: 1920px) {
    .padrotramanho {
        max-width: 1400px;
    }
    
    .zero001 img {
        max-width: 160px;
    }
    
    #mostrarBtn,
    .button.prefer-responsive {
        font-size: 14px;
        padding: 12px 28px;
        min-height: 48px;
    }
    
    .asldkaskdsdheader {
        height: 75vh;
    }
    
    nav.saldkaslkdsad22222 ul {
        font-size: 16px;
        gap: 48px;
    }
}

/* ============================================
   FIX 7: MOBILE CENTRALIZAÇÃO GARANTIDA
   ============================================ */
@media screen and (max-width: 767px) {
    /* Centralização forçada no mobile */
    header.padrotramanho .container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .zero001,
    .zero002 {
        float: none !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .zero001 {
        order: 1;
        margin-bottom: 12px;
    }
    
    .zero002 {
        order: 2;
    }
    
    #mostrarBtn,
    .button.prefer-responsive {
        float: none !important;
        margin: 0 auto !important;
        display: inline-flex !important;
    }
}

/* ============================================
   FIX 8: MODAL LOGIN CONSISTENTE
   ============================================ */
#minhaDiv {
    /* Garantir centralização em todos os navegadores */
    display: none;
}

#minhaDiv[style*="display: block"],
#minhaDiv[style*="display:block"],
#minhaDiv.active,
#minhaDiv.is-open {
    display: -webkit-box !important;
    display: -webkit-flex !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-pack: center !important;
    -webkit-justify-content: center !important;
    -ms-flex-pack: center !important;
    justify-content: center !important;
    -webkit-box-align: center !important;
    -webkit-align-items: center !important;
    -ms-flex-align: center !important;
    align-items: center !important;
    padding: 20px !important;
}

.container.login.modal-container {
    width: 100% !important;
    max-width: 380px !important;
    margin: 0 auto !important;
}

.container.login.modal-container article {
    width: 100% !important;
    max-width: 380px !important;
}

/* ============================================
   FIX 9: INPUTS MOBILE (EVITAR ZOOM iOS)
   ============================================ */
@media screen and (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="url"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
        min-height: 48px !important;
        padding: 14px 16px !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        border-radius: 8px !important;
    }
}

/* ============================================
   FIX 10: BOTÕES TOUCH-FRIENDLY
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    button,
    .button,
    [role="button"],
    a.btn,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px !important;
        min-width: 44px !important;
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
    }
}

/* ============================================
   FIX 11: SAFARI iOS ESPECÍFICO
   ============================================ */
@supports (-webkit-touch-callout: none) {
    /* Fix para a barra de navegação do Safari */
    body {
        min-height: -webkit-fill-available;
    }
    
    #minhaDiv {
        min-height: -webkit-fill-available;
    }
    
    /* Garantir que inputs não façam zoom */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Fix para position: fixed no Safari */
    .modal-container,
    #minhaDiv {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
}

/* ============================================
   FIX 12: FIREFOX MOBILE
   ============================================ */
@-moz-document url-prefix() {
    @media screen and (max-width: 767px) {
        #mostrarBtn,
        .button.prefer-responsive {
            display: -moz-inline-box !important;
            display: inline-flex !important;
        }
    }
}

/* ============================================
   FIX 13: EDGE LEGACY (EdgeHTML)
   ============================================ */
@supports (-ms-ime-align: auto) {
    #minhaDiv {
        display: -ms-flexbox;
        -ms-flex-pack: center;
        -ms-flex-align: center;
    }
    
    .container.login.modal-container {
        -ms-flex: 0 0 auto;
    }
}

/* ============================================
   FIX 14: HIGH DPI / RETINA
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi),
       (min-resolution: 2dppx) {
    /* Bordas mais nítidas em telas retina */
    .container.login.modal-container article,
    input,
    button {
        border-width: 0.5px;
    }
    
    /* Texto mais nítido */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ============================================
   FIX 15: LANDSCAPE MOBILE
   ============================================ */
@media screen and (max-height: 500px) and (orientation: landscape) {
    header.padrotramanho .container {
        flex-direction: row !important;
        justify-content: space-between !important;
    }
    
    .zero001,
    .zero002 {
        width: auto !important;
        margin: 0 !important;
    }
    
    .zero001 {
        order: 1;
    }
    
    .zero002 {
        order: 2;
        text-align: right !important;
    }
    
    #mostrarBtn {
        float: right !important;
        margin: 0 !important;
    }
    
    /* Modal scrollável em landscape */
    #minhaDiv {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .container.login.modal-container article {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ============================================
   FIX 16: PREFERÊNCIAS DO USUÁRIO
   ============================================ */

/* Movimento Reduzido */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        -webkit-animation-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        -webkit-animation-iteration-count: 1 !important;
        animation-iteration-count: 1 !important;
        -webkit-transition-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Alto Contraste */
@media (prefers-contrast: high) {
    button,
    .button,
    input {
        border: 2px solid currentColor !important;
    }
}

/* Modo Escuro - ajustes adicionais */
@media (prefers-color-scheme: dark) {
    #minhaDiv {
        background: rgba(0, 0, 0, 0.8) !important;
    }
}

/* ============================================
   FIX 17: IMPRESSÃO
   ============================================ */
@media print {
    #minhaDiv,
    .cookie-modal,
    #vrPushModal,
    .cad_sucesso {
        display: none !important;
    }
    
    body {
        min-height: auto !important;
        padding: 0 !important;
    }
    
    header.padrotramanho {
        position: static !important;
    }
}

/* ============================================
   FIX 18: COOKIES E PUSH MODAIS
   ============================================ */
.cookie-modal,
.dsldksakldsd {
    /* Garantir que fique acima de tudo */
    z-index: 99999 !important;
}

@media screen and (max-width: 600px) {
    .cookie-modal,
    .dsldksakldsd {
        width: calc(100% - 24px) !important;
        left: 12px !important;
        right: 12px !important;
        transform: none !important;
        bottom: 12px !important;
    }
    
    #vrPushModal {
        width: calc(100% - 24px) !important;
        left: 12px !important;
        right: 12px !important;
        transform: none !important;
    }
}

/* ============================================
   FIX 19: NAVEGAÇÃO RESPONSIVA
   ============================================ */
nav.saldkaslkdsad22222 ul {
    /* Garantir wrap correto */
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
}

@media screen and (max-width: 480px) {
    nav.saldkaslkdsad22222 ul {
        gap: 8px 12px !important;
        font-size: 11px !important;
    }
    
    nav.saldkaslkdsad22222 ul li {
        padding: 4px 0;
    }
}

/* ============================================
   FIX 20: BLOCOS DE CONTEÚDO
   ============================================ */
.dklsdk1.blocos-container {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
}

@media screen and (max-width: 767px) {
    .bloco1 {
        width: 100% !important;
        -webkit-box-flex: 0;
        -webkit-flex: 0 0 100%;
        -ms-flex: 0 0 100%;
        flex: 0 0 100%;
        text-align: center !important;
        margin-bottom: 15px;
    }
    
    .bloco-img,
    .bloco-img-small {
        margin: 0 auto !important;
    }
}

/* ============================================
   FIX 21: GARANTIA DE VISIBILIDADE DO BOTÃO
   Regra final com máxima especificidade
   ============================================ */
html body header.padrotramanho .zero002 #mostrarBtn,
html body header.padrotramanho .zero002 button.button.prefer-responsive {
    display: -webkit-inline-box !important;
    display: -webkit-inline-flex !important;
    display: -ms-inline-flexbox !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ============================================
   FIX 22: CLEARFIX CROSS-BROWSER
   ============================================ */
.container::after,
.padrotramanho::after {
    content: "";
    display: table;
    clear: both;
}

/* ============================================
   FIX 23: FOCUS VISIBLE (Acessibilidade)
   ============================================ */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #008c15;
    outline-offset: 2px;
}

/* Remove outline padrão quando não necessário */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   FIX 24: CONTAINER QUERIES (Futuro)
   Preparação para quando tiver suporte total
   ============================================ */
@supports (container-type: inline-size) {
    .container-query-ready {
        container-type: inline-size;
    }
}
