/**
 * VR Shopping - Responsividade Inteligente para Mobile
 * Sistema Adaptativo Multi-Device
 * 
 * @version 3.0.0
 * @description Responsividade específica para smartphones com ajustes
 *              precisos para iPhone Pro Max e Motorola Edge 30 Pro
 * 
 * Dispositivos suportados:
 * - iPhone SE, 8, X, XS, 11-16 (todas variantes)
 * - Samsung Galaxy S/A/Z series
 * - Motorola Edge/Moto G series
 * - Google Pixel series
 * - Xiaomi/Redmi series
 * - OnePlus series
 */

/* ============================================
   CSS CUSTOM PROPERTIES MOBILE
   ============================================ */
:root {
    /* Posicionamento dinâmico do botão */
    --btn-top-offset: 0px;
    --btn-right-offset: 0px;
    --btn-margin-right: 0px;
    
    /* Tamanhos adaptativos */
    --btn-font-size: 13px;
    --btn-padding-v: 12px;
    --btn-padding-h: 24px;
    --btn-min-height: 44px;
    
    /* Safe areas para notch/dynamic island */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

/* ============================================
   RESET BASE MOBILE - TODOS SMARTPHONES
   ============================================ */
@media screen and (max-width: 767px) {
    
    /* Garantir que o header tenha espaço adequado */
    header.padrotramanho {
        padding: 12px 15px !important;
        min-height: 70px;
        display: flex;
        align-items: center;
    }
    
    header.padrotramanho .container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100%;
    }
    
    /* Logo centralizada */
    .zero001 {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 12px;
        order: 1;
    }
    
    .zero001 img {
        max-width: 130px !important;
        height: auto !important;
        margin: 0 auto;
    }
    
    /* Container do botão */
    .zero002 {
        width: 100% !important;
        text-align: center !important;
        order: 2;
        position: relative;
    }
    
    /* Botão base mobile */
    #mostrarBtn,
    .button.prefer-responsive,
    button.button.prefer-responsive {
        position: relative !important;
        top: var(--btn-top-offset) !important;
        right: var(--btn-right-offset) !important;
        margin-right: var(--btn-margin-right) !important;
        
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        
        font-size: var(--btn-font-size) !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        
        padding: var(--btn-padding-v) var(--btn-padding-h) !important;
        min-height: var(--btn-min-height) !important;
        
        border-radius: 25px !important;
        background: #008c15 !important;
        color: #ffffff !important;
        border: none !important;
        
        box-shadow: 0 2px 8px rgba(0, 140, 21, 0.3) !important;
        
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        
        transition: all 0.2s ease !important;
    }
    
    #mostrarBtn:active,
    .button.prefer-responsive:active {
        transform: scale(0.98) !important;
        background: #007a12 !important;
    }
    
    /* Ícone do botão */
    #mostrarBtn i,
    .button.prefer-responsive i {
        margin-left: 8px !important;
        font-size: 11px !important;
        color: #ffffff !important;
    }
}

/* ============================================
   IPHONE - TODOS OS MODELOS
   ============================================ */

/* iPhone SE 2/3 (375px x 667px) */
@media only screen 
    and (device-width: 375px) 
    and (device-height: 667px) 
    and (-webkit-device-pixel-ratio: 2) {
    :root {
        --btn-font-size: 12px;
        --btn-padding-v: 11px;
        --btn-padding-h: 20px;
        --btn-top-offset: 0px;
    }
}

/* iPhone 8 Plus (414px x 736px) */
@media only screen 
    and (device-width: 414px) 
    and (device-height: 736px) 
    and (-webkit-device-pixel-ratio: 3) {
    :root {
        --btn-font-size: 13px;
        --btn-padding-v: 11px;
        --btn-padding-h: 22px;
        --btn-top-offset: 0px;
    }
}

/* iPhone X, XS, 11 Pro, 12 Mini, 13 Mini (375px x 812px) */
@media only screen 
    and (device-width: 375px) 
    and (device-height: 812px) 
    and (-webkit-device-pixel-ratio: 3) {
    :root {
        --btn-font-size: 13px;
        --btn-padding-v: 11px;
        --btn-padding-h: 22px;
        --btn-top-offset: -2px;
    }
    
    header.padrotramanho {
        padding-top: calc(12px + var(--safe-top)) !important;
    }
}

/* iPhone XR, 11 (414px x 896px @2x) */
@media only screen 
    and (device-width: 414px) 
    and (device-height: 896px) 
    and (-webkit-device-pixel-ratio: 2) {
    :root {
        --btn-font-size: 13px;
        --btn-padding-v: 12px;
        --btn-padding-h: 24px;
        --btn-top-offset: -2px;
    }
}

/* iPhone XS Max, 11 Pro Max (414px x 896px @3x) */
@media only screen 
    and (device-width: 414px) 
    and (device-height: 896px) 
    and (-webkit-device-pixel-ratio: 3) {
    :root {
        --btn-font-size: 14px;
        --btn-padding-v: 12px;
        --btn-padding-h: 24px;
        --btn-top-offset: -3px;
    }
}

/* iPhone 12, 12 Pro, 13, 13 Pro, 14 (390px x 844px) */
@media only screen 
    and (device-width: 390px) 
    and (device-height: 844px) 
    and (-webkit-device-pixel-ratio: 3) {
    :root {
        --btn-font-size: 13px;
        --btn-padding-v: 12px;
        --btn-padding-h: 24px;
        --btn-top-offset: -3px;
    }
}

/* iPhone 12 Pro Max, 13 Pro Max (428px x 926px) */
@media only screen 
    and (device-width: 428px) 
    and (device-height: 926px) 
    and (-webkit-device-pixel-ratio: 3) {
    :root {
        --btn-font-size: 14px;
        --btn-padding-v: 13px;
        --btn-padding-h: 26px;
        --btn-top-offset: -5px;
    }
}

/* iPhone 14 Pro (393px x 852px) */
@media only screen 
    and (device-width: 393px) 
    and (device-height: 852px) 
    and (-webkit-device-pixel-ratio: 3) {
    :root {
        --btn-font-size: 13px;
        --btn-padding-v: 12px;
        --btn-padding-h: 24px;
        --btn-top-offset: -4px;
    }
}

/* iPhone 14 Pro Max, 15 Pro Max, 16 Pro Max (430px x 932px) */
@media only screen 
    and (device-width: 430px) 
    and (device-height: 932px) 
    and (-webkit-device-pixel-ratio: 3) {
    :root {
        --btn-font-size: 14px;
        --btn-padding-v: 13px;
        --btn-padding-h: 26px;
        --btn-top-offset: -6px; /* Sobe levemente conforme solicitado */
    }
}

/* iPhone 15, 15 Pro (393px x 852px - Dynamic Island) */
@media only screen 
    and (min-device-width: 393px) 
    and (max-device-width: 393px) 
    and (-webkit-device-pixel-ratio: 3)
    and (min-resolution: 458dpi) {
    :root {
        --btn-font-size: 13px;
        --btn-padding-v: 12px;
        --btn-padding-h: 24px;
        --btn-top-offset: -5px;
    }
}

/* iPhone 16 Pro Max / Futuros Pro Max (largura ~440px+) */
@media only screen 
    and (min-device-width: 430px)
    and (max-device-width: 460px)
    and (-webkit-device-pixel-ratio: 3) {
    :root {
        --btn-font-size: 14px;
        --btn-padding-v: 13px;
        --btn-padding-h: 28px;
        --btn-top-offset: -8px; /* iPhone 17 Pro Max - sobe mais */
    }
    
    header.padrotramanho {
        padding-top: calc(15px + var(--safe-top)) !important;
    }
    
    /* Ajuste adicional para Pro Max */
    #mostrarBtn,
    .button.prefer-responsive {
        margin-top: -5px !important;
    }
}

/* ============================================
   MOTOROLA - EDGE SERIES
   ============================================ */

/* Motorola Edge 30 Pro (6.7" - 1080x2400 - ~392px viewport) */
@media screen 
    and (min-width: 390px) 
    and (max-width: 395px)
    and (min-height: 800px)
    and (-webkit-device-pixel-ratio: 2.75) {
    :root {
        --btn-font-size: 13px;
        --btn-padding-v: 12px;
        --btn-padding-h: 24px;
        --btn-right-offset: -15px; /* Move para direita */
        --btn-margin-right: -10px;
    }
    
    .zero002 {
        text-align: right !important;
        padding-right: 10px !important;
    }
    
    #mostrarBtn,
    .button.prefer-responsive {
        float: right !important;
        margin-right: 5px !important;
    }
}

/* Motorola Edge 30 Pro - Alternativa por aspect ratio */
@media screen 
    and (min-width: 380px) 
    and (max-width: 400px)
    and (min-aspect-ratio: 20/9)
    and (max-aspect-ratio: 21/9) {
    :root {
        --btn-margin-right: 10px;
    }
    
    .zero002 {
        text-align: right !important;
    }
    
    #mostrarBtn,
    .button.prefer-responsive {
        float: right !important;
        margin-right: 15px !important;
    }
}

/* Motorola Edge 40/50 Pro (similar specs) */
@media screen 
    and (min-width: 390px) 
    and (max-width: 410px)
    and (min-height: 850px)
    and (-webkit-min-device-pixel-ratio: 2.5) {
    :root {
        --btn-margin-right: 12px;
    }
    
    .zero002 {
        text-align: right !important;
        padding-right: 15px !important;
    }
    
    #mostrarBtn {
        margin-right: 10px !important;
    }
}

/* ============================================
   SAMSUNG GALAXY - S SERIES
   ============================================ */

/* Samsung Galaxy S21/S22/S23 (360px x 800px aprox) */
@media screen 
    and (min-width: 355px) 
    and (max-width: 365px)
    and (-webkit-device-pixel-ratio: 3) {
    :root {
        --btn-font-size: 12px;
        --btn-padding-v: 11px;
        --btn-padding-h: 20px;
    }
}

/* Samsung Galaxy S21+/S22+/S23+ (384px x 854px aprox) */
@media screen 
    and (min-width: 380px) 
    and (max-width: 390px)
    and (-webkit-device-pixel-ratio: 2.8125) {
    :root {
        --btn-font-size: 13px;
        --btn-padding-v: 12px;
        --btn-padding-h: 22px;
    }
}

/* Samsung Galaxy S21 Ultra/S22 Ultra/S23 Ultra/S24 Ultra (412px x 915px aprox) */
@media screen 
    and (min-width: 410px) 
    and (max-width: 420px)
    and (min-height: 900px)
    and (-webkit-device-pixel-ratio: 3.5) {
    :root {
        --btn-font-size: 14px;
        --btn-padding-v: 13px;
        --btn-padding-h: 26px;
        --btn-top-offset: -3px;
    }
}

/* Samsung Galaxy Z Fold (aberto - tablet mode) */
@media screen 
    and (min-width: 650px) 
    and (max-width: 750px)
    and (-webkit-device-pixel-ratio: 2.625) {
    :root {
        --btn-font-size: 14px;
        --btn-padding-v: 12px;
        --btn-padding-h: 26px;
    }
    
    .zero001, .zero002 {
        width: 50% !important;
        float: left !important;
    }
    
    .zero002 {
        text-align: right !important;
    }
    
    #mostrarBtn {
        float: right !important;
    }
}

/* Samsung Galaxy Z Flip (fechado - tela cover) */
@media screen 
    and (min-width: 250px) 
    and (max-width: 300px)
    and (-webkit-device-pixel-ratio: 2) {
    :root {
        --btn-font-size: 10px;
        --btn-padding-v: 8px;
        --btn-padding-h: 14px;
    }
    
    .zero001 img {
        max-width: 80px !important;
    }
}

/* ============================================
   GOOGLE PIXEL SERIES
   ============================================ */

/* Pixel 6/6a/7/7a (411px x 914px aprox) */
@media screen 
    and (min-width: 408px) 
    and (max-width: 414px)
    and (min-height: 900px)
    and (-webkit-device-pixel-ratio: 2.625) {
    :root {
        --btn-font-size: 13px;
        --btn-padding-v: 12px;
        --btn-padding-h: 24px;
    }
}

/* Pixel 6 Pro/7 Pro/8 Pro (412px x 915px aprox) */
@media screen 
    and (min-width: 410px) 
    and (max-width: 420px)
    and (-webkit-device-pixel-ratio: 3.5) {
    :root {
        --btn-font-size: 14px;
        --btn-padding-v: 12px;
        --btn-padding-h: 24px;
        --btn-top-offset: -2px;
    }
}

/* ============================================
   XIAOMI / REDMI SERIES
   ============================================ */

/* Xiaomi/Redmi devices (geralmente 393px ou 411px) */
@media screen 
    and (min-width: 390px) 
    and (max-width: 415px)
    and (-webkit-device-pixel-ratio: 2.75) {
    :root {
        --btn-font-size: 13px;
        --btn-padding-v: 12px;
        --btn-padding-h: 22px;
    }
}

/* ============================================
   ONEPLUS SERIES
   ============================================ */

/* OnePlus devices (geralmente 412px) */
@media screen 
    and (min-width: 410px) 
    and (max-width: 420px)
    and (-webkit-device-pixel-ratio: 2.625) {
    :root {
        --btn-font-size: 13px;
        --btn-padding-v: 12px;
        --btn-padding-h: 24px;
    }
}

/* ============================================
   FALLBACKS POR TAMANHO DE TELA
   ============================================ */

/* Mobile Extra Small (< 360px) */
@media screen and (max-width: 359px) {
    :root {
        --btn-font-size: 11px;
        --btn-padding-v: 10px;
        --btn-padding-h: 16px;
        --btn-min-height: 40px;
    }
    
    .zero001 img {
        max-width: 90px !important;
    }
    
    nav.saldkaslkdsad22222 ul {
        gap: 8px !important;
        font-size: 10px !important;
    }
}

/* Mobile Small (360px - 374px) */
@media screen and (min-width: 360px) and (max-width: 374px) {
    :root {
        --btn-font-size: 12px;
        --btn-padding-v: 11px;
        --btn-padding-h: 18px;
    }
    
    .zero001 img {
        max-width: 100px !important;
    }
}

/* Mobile Medium (375px - 399px) */
@media screen and (min-width: 375px) and (max-width: 399px) {
    :root {
        --btn-font-size: 12px;
        --btn-padding-v: 11px;
        --btn-padding-h: 20px;
    }
    
    .zero001 img {
        max-width: 110px !important;
    }
}

/* Mobile Large (400px - 430px) */
@media screen and (min-width: 400px) and (max-width: 430px) {
    :root {
        --btn-font-size: 13px;
        --btn-padding-v: 12px;
        --btn-padding-h: 22px;
    }
    
    .zero001 img {
        max-width: 120px !important;
    }
}

/* Mobile XL (431px - 480px) */
@media screen and (min-width: 431px) and (max-width: 480px) {
    :root {
        --btn-font-size: 14px;
        --btn-padding-v: 12px;
        --btn-padding-h: 24px;
    }
    
    .zero001 img {
        max-width: 130px !important;
    }
}

/* ============================================
   LANDSCAPE MODE - MOBILE
   ============================================ */
@media screen and (max-width: 896px) and (orientation: landscape) {
    
    header.padrotramanho .container {
        flex-direction: row !important;
        justify-content: space-between !important;
    }
    
    .zero001 {
        width: auto !important;
        margin-bottom: 0 !important;
    }
    
    .zero002 {
        width: auto !important;
        text-align: right !important;
    }
    
    #mostrarBtn,
    .button.prefer-responsive {
        float: right !important;
        margin: 0 !important;
    }
}

@media screen and (max-height: 450px) and (orientation: landscape) {
    :root {
        --btn-font-size: 11px;
        --btn-padding-v: 8px;
        --btn-padding-h: 16px;
        --btn-min-height: 36px;
    }
    
    header.padrotramanho {
        padding: 8px 15px !important;
        min-height: 50px;
    }
    
    .zero001 img {
        max-width: 80px !important;
    }
}

/* ============================================
   SAFARI iOS SPECIFIC FIXES
   ============================================ */
@supports (-webkit-touch-callout: none) {
    
    /* Fix para a barra de navegação do Safari */
    body {
        min-height: -webkit-fill-available;
    }
    
    /* Fix para botões no Safari iOS */
    #mostrarBtn,
    .button.prefer-responsive {
        -webkit-appearance: none !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    /* Previne zoom em inputs */
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    #mostrarBtn,
    .button.prefer-responsive {
        box-shadow: 0 2px 12px rgba(0, 140, 21, 0.5) !important;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    #mostrarBtn,
    .button.prefer-responsive {
        transition: none !important;
    }
    
    #mostrarBtn:active,
    .button.prefer-responsive:active {
        transform: none !important;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
    #mostrarBtn,
    .button.prefer-responsive {
        border: 2px solid #ffffff !important;
        font-weight: 900 !important;
    }
}

/* ============================================
   NAVEGAÇÃO MOBILE MELHORADA
   ============================================ */
@media screen and (max-width: 767px) {
    
    nav.saldkaslkdsad22222 {
        padding: 10px 5px !important;
    }
    
    nav.saldkaslkdsad22222 ul {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 12px 20px !important;
        font-size: 12px !important;
    }
    
    nav.saldkaslkdsad22222 ul li {
        white-space: nowrap;
    }
}

@media screen and (max-width: 400px) {
    nav.saldkaslkdsad22222 ul {
        gap: 8px 15px !important;
        font-size: 11px !important;
    }
}

/* ============================================
   MODAL LOGIN MOBILE
   ============================================ */
@media screen and (max-width: 767px) {
    
    .container-login-vr {
        width: 95% !important;
        max-width: 380px !important;
        padding: 0 10px !important;
    }
    
    .login-article {
        border-radius: 12px !important;
    }
    
    .login-header {
        padding: 18px 20px !important;
    }
    
    .login-header h1 {
        font-size: 1.3rem !important;
    }
    
    .login-content {
        padding: 20px !important;
    }
    
    .login-form input[type="text"],
    .login-form input[type="password"] {
        padding: 14px 15px !important;
        font-size: 16px !important; /* Previne zoom no iOS */
    }
    
    /* reCAPTCHA responsivo */
    .g-recaptcha-container {
        width: 100% !important;
        max-width: 304px !important;
        margin: 0 auto !important;
    }
    
    .login-form .button.btn-block {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 15px !important;
    }
}

/* ============================================
   FOOTER MOBILE
   ============================================ */
@media screen and (max-width: 767px) {
    
    .footer-container {
        padding: 30px 15px !important;
    }
    
    .footer-logo {
        max-width: 120px !important;
    }
    
    .footer-text {
        font-size: 12px !important;
        padding: 0 15px 25px !important;
    }
}

/* ============================================
   BLOCOS DE CONTEÚDO MOBILE
   ============================================ */
@media screen and (max-width: 767px) {
    
    .aksldkasld {
        padding: 20px 10px !important;
    }
    
    .dklsdk1.blocos-container {
        padding: 20px 15px !important;
        gap: 20px !important;
    }
    
    .bloco1 {
        width: 100% !important;
        text-align: center !important;
    }
    
    .bloco-img {
        max-height: 80px !important;
        margin: 0 auto !important;
    }
    
    .bloco-img-small {
        max-height: 25px !important;
        margin: 0 auto !important;
    }
}

/* ============================================
   COOKIE MODAL MOBILE
   ============================================ */
@media screen and (max-width: 767px) {
    
    .cookie-modal,
    .dsldksakldsd {
        width: 95% !important;
        max-width: none !important;
        bottom: 10px !important;
        padding: 15px !important;
        border-radius: 10px !important;
    }
    
    .cookie-content {
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px !important;
    }
    
    .cookie-text {
        min-width: auto !important;
    }
    
    .cookie-text p {
        font-size: 13px !important;
    }
    
    .cookie-btn {
        width: 100% !important;
    }
    
    .cookie-btn button {
        width: 100% !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
}

/* ============================================
   PUSH NOTIFICATION MODAL MOBILE
   ============================================ */
@media screen and (max-width: 767px) {
    
    #vrPushModal {
        width: 95% !important;
        max-width: none !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        bottom: 15px !important;
    }
}

/* ============================================
   UTILITÁRIOS MOBILE
   ============================================ */
@media screen and (max-width: 767px) {
    
    .hide-on-mobile {
        display: none !important;
    }
    
    .show-on-mobile {
        display: block !important;
    }
    
    .text-center-mobile {
        text-align: center !important;
    }
    
    .full-width-mobile {
        width: 100% !important;
    }
}

/* ============================================
   DETECTION DE DISPOSITIVO VIA USER-AGENT
   (Fallback usando CSS Feature Queries)
   ============================================ */

/* iOS Detection */
@supports (-webkit-overflow-scrolling: touch) {
    /* Estilos específicos para iOS */
    #mostrarBtn {
        -webkit-transform: translate3d(0, 0, 0);
    }
}

/* Android Chrome Detection */
@supports (overflow: -webkit-paged-x) {
    /* Estilos específicos para Android Chrome */
}

/* Samsung Internet Detection */
@supports (-webkit-appearance: none) and (not (-ms-ime-align: auto)) {
    /* Estilos específicos para Samsung Internet */
}
