/* ==========================================================================
   SIMULADORES HANUTHAI — SISTEMA RESPONSIVO UNIFICADO (APP-LIKE)
   Afeta todos os simuladores: Fight Shorts, Fast, Legging, Moletom, Top
   Motor: Preview Estático no Topo + Opções com Rolagem Suave Abaixo
   ========================================================================== */

@media (max-width: 768px) {

    /* --- 1. CABEÇALHO CLEAN & MINIMALISTA COM TRAVAMENTO DE TELA --- */
    html,
    body.page-shorts {
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        position: relative !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #000000 !important;
    }

    body.page-shorts {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Ocultar elementos desnecessários e pesados que poluem o visual no mobile */
    body.page-shorts #hnt-test-banner-root,
    body.page-shorts .hnt-test-banner,
    body.page-shorts .hnt-test-floating-badge,
    body.page-shorts .sim-social-proof-bar,
    body.page-shorts .sim-breadcrumb-wrapper,
    body.page-shorts .top-ticker-bar,
    body.page-shorts #dynamic-top-ticker-bar,
    body.page-shorts #fast-welcome-banner,
    body.page-shorts .hnt-footer,
    body.page-shorts footer {
        display: none !important;
    }

        /* Header principal compacto e limpo */
    body.page-shorts .premium-header {
        flex: 0 0 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        padding: 0 10px !important;
        position: relative !important;
        top: 0 !important;
        z-index: 1000 !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.page-shorts .header-left {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex: 0 1 auto !important;
        min-width: 0 !important;
    }

    body.page-shorts .premium-header .header-center,
    body.page-shorts .mobile-menu-container {
        display: none !important;
    }

    body.page-shorts .header-right {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex: 0 0 auto !important;
    }

    
    /* Ocultar botões de exportação admin pesados no header mobile para não colidir */
    body.page-shorts .admin-actions-container {
        display: none !important;
    }

    /* Ajustar widget de autenticação no mobile */
    body.page-shorts #auth-widget-container {
        gap: 4px !important;
    }

    body.page-shorts .auth-user-trigger {
        padding: 3px 8px !important;
        font-size: 0.72rem !important;
        max-width: 90px !important;
    }

    body.page-shorts .auth-user-name {
        max-width: 50px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.page-shorts .header-left {
        flex: 0 0 auto !important;
    }

    body.page-shorts .header-right {
        flex: 0 0 auto !important;
    }

    body.page-shorts .top-corner-actions {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    body.page-shorts .top-cart-btn .btn-text {
        display: none !important;
    }

    body.page-shorts .top-cart-btn {
        padding: 5px 8px !important;
    }

    body.page-shorts .auth-btn {
        padding: 4px 8px !important;
        font-size: 0.70rem !important;
    }

    body.page-shorts .brand-logo-standard .logo-emblem {
        height: 24px !important;
    }

    body.page-shorts .brand-logo-standard .logo-text {
        height: 16px !important;
    }

    body.page-shorts .nav-drawer-btn {
        padding: 5px 8px !important;
        font-size: 0.72rem !important;
        white-space: nowrap !important;
    }

    /* Menu Gaveta Lateral (Offcanvas) deve ficar sempre fora do fluxo da tela até ser ativado */
    .nav-drawer-backdrop {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: rgba(0, 0, 0, 0.8) !important;
        z-index: 99998 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease, visibility 0.3s ease !important;
    }

    .nav-drawer-backdrop.active {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .nav-drawer-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 320px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #0a0a0e !important;
        z-index: 99999 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .nav-drawer-panel:not(.active) {
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateX(-100%) !important;
    }

    .nav-drawer-panel.active {
        transform: translateX(0) !important;
    }

    /* --- 2. CONTAINER PRINCIPAL: SPLIT SCREEN FIXO E EQUILIBRADO --- */
    body.page-shorts .app-container {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 0% !important;
        min-height: 0 !important;
        height: calc(100vh - 44px) !important;
        height: calc(100dvh - 44px) !important;
        max-height: calc(100dvh - 44px) !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        grid-template-columns: none !important;
        grid-template-rows: none !important;
    }

    /* --- 3. ÁREA VISUAL DO SIMULADOR (PREVIEW): ESTÁTICA NO TOPO --- */
    body.page-shorts .simulator-area {
        flex: 0 0 clamp(180px, 32vh, 235px) !important;
        height: clamp(180px, 32vh, 235px) !important;
        min-height: 175px !important;
        max-height: 245px !important;
        width: 100% !important;
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 50 !important;
        overflow: hidden !important;
        background: #000 url('../../DataFilesBasic/Audiovisual/Ringue/RingHNT2.webp?v=4') no-repeat center bottom !important;
        background-size: cover !important;
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 2px solid rgba(212, 175, 55, 0.45) !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.9) !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.page-shorts .simulator-viewport {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    body.page-shorts .zoom-container {
        width: 100% !important;
        height: 100% !important;
        max-width: min(85vw, 225px) !important;
        max-height: min(85vw, 225px) !important;
        aspect-ratio: 1 / 1 !important;
        margin: 0 auto !important;
    }

    /* Controles de Visão dentro da área do simulador */
    body.page-shorts .view-switch-floating-bar {
        top: 6px !important;
        padding: 2px 6px !important;
        gap: 5px !important;
        z-index: 90 !important;
    }

    body.page-shorts .view-indicator-pill {
        padding: 2px 8px !important;
        font-size: 0.68rem !important;
        letter-spacing: 0.5px !important;
    }

    body.page-shorts .view-arrow-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.68rem !important;
    }

    body.page-shorts .view-mode-watermark {
        bottom: 6px !important;
        left: 8px !important;
        font-size: 0.62rem !important;
        padding: 2px 6px !important;
        z-index: 90 !important;
    }

    body.page-shorts .zoom-controls {
        bottom: 6px !important;
        right: 8px !important;
        gap: 4px !important;
        z-index: 90 !important;
    }

    body.page-shorts .zoom-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem !important;
    }

    /* No Mobile: Oculta o cadeado (desnecessário e confuso) e destaca o botão de centralização */
    body.page-shorts #lock-interaction,
    body.page-shorts .lock-btn {
        display: none !important;
    }

    body.page-shorts #recenter-view,
    body.page-shorts .recenter-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(14, 16, 22, 0.92) !important;
        border: 1.5px solid rgba(212, 175, 55, 0.7) !important;
        color: #F6E27A !important;
        font-size: 1.15rem !important;
        line-height: 1 !important;
        border-radius: 6px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    }

    body.page-shorts #recenter-view:active,
    body.page-shorts .recenter-btn:active {
        background: #D4AF37 !important;
        color: #000 !important;
        transform: scale(0.92) !important;
    }

    /* --- 4. ÁREA DE OPÇÕES/CUSTOMIZAÇÃO: ROLAGEM INDEPENDENTE --- */
    body.page-shorts .controls-area {
        flex: 1 1 0% !important;
        min-height: 0 !important;
        height: auto !important;
        width: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: contain !important;
        touch-action: pan-y !important;
        padding: 10px 12px 35px 12px !important;
        box-sizing: border-box !important;
        background: #000000 !important;
        border-radius: 0 !important;
    }

    /* Bloco de Preço Compacto */
    body.page-shorts .price-header {
        margin-bottom: 8px !important;
        padding-bottom: 6px !important;
        display: flex !important;
        align-items: baseline !important;
        justify-content: space-between !important;
    }

    body.page-shorts .price-header #price-display,
    body.page-shorts .price-value {
        font-size: 1.45rem !important;
        line-height: 1.1 !important;
    }

    /* Banner WhatsApp DTF compacto */
    body.page-shorts #sim-dtf-banner {
        margin: 0 0 10px 0 !important;
        padding: 6px 10px !important;
        font-size: 0.72rem !important;
        line-height: 1.3 !important;
    }

    /* --- 5. PREVENÇÃO DE CORTES EM BOTÕES E CONTROLES --- */

    /* Botões superiores de ação (Carrinho & Limpar) */
    body.page-shorts .btn-cart,
    body.page-shorts .btn-clear,
    body.page-shorts button[id*="cart"],
    body.page-shorts button[id*="clear"] {
        white-space: nowrap !important;
        padding: 8px 10px !important;
        font-size: clamp(0.70rem, 2.4vw, 0.78rem) !important;
        min-height: 40px !important;
        line-height: 1.15 !important;
        letter-spacing: 0.2px !important;
        box-sizing: border-box !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Barra de Alternância de Visão (Frente / Costas) nos controles */
    body.page-shorts .simulator-view-switcher-bar {
        padding: 3px !important;
        gap: 6px !important;
        margin-bottom: 10px !important;
    }

    body.page-shorts .view-switch-btn {
        padding: 8px 6px !important;
        font-size: clamp(0.70rem, 2.4vw, 0.78rem) !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
        letter-spacing: 0.3px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Barra de Progresso dos Passos (1 Grade, 2 Centro, 3 Laterais...) */
    body.page-shorts .step-progress-container {
        height: 48px !important;
        margin-bottom: 18px !important;
        padding: 0 6px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        overflow-x: visible !important;
        position: relative !important;
    }

    body.page-shorts .step-node {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        font-size: 0.72rem !important;
        flex-shrink: 0 !important;
        position: relative !important;
    }

    /* Ocultar labels de passos inativos no mobile para evitar sobreposição de textos */
    body.page-shorts .step-node .step-node-label {
        display: none !important;
    }

    /* Exibir label com destaque apenas no passo ativo */
    body.page-shorts .step-node.active .step-node-label {
        display: block !important;
        position: absolute !important;
        bottom: -18px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        white-space: nowrap !important;
        font-size: 0.65rem !important;
        font-weight: 800 !important;
        color: #D4AF37 !important;
        background: rgba(0, 0, 0, 0.88) !important;
        padding: 1px 7px !important;
        border-radius: 4px !important;
        border: 1px solid rgba(212, 175, 55, 0.5) !important;
        z-index: 10 !important;
        letter-spacing: 0.3px !important;
    }

    /* Acordeões dos Passos */
    body.page-shorts .step-accordion-header {
        padding: 12px 14px !important;
        min-height: 44px !important;
    }

    body.page-shorts .step-accordion-title {
        font-size: 0.82rem !important;
    }

    /* Botões de Ação do Resumo Inferior */
    body.page-shorts #summary-action-bar {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
        margin-top: 15px !important;
    }

    body.page-shorts #summary-action-bar button {
        width: 100% !important;
        flex: none !important;
        min-height: 44px !important;
        font-size: 0.82rem !important;
        font-weight: 800 !important;
        padding: 10px 14px !important;
        white-space: nowrap !important;
    }
}

/* Extra small (≤ 400px — telas ultra compactas tipo iPhone SE 375px) */
@media (max-width: 400px) {
    body.page-shorts .simulator-area {
        flex: 0 0 clamp(170px, 30vh, 220px) !important;
        height: clamp(170px, 30vh, 220px) !important;
        min-height: 165px !important;
        max-height: 230px !important;
    }

    body.page-shorts .zoom-container {
        max-width: min(85vw, 210px) !important;
        max-height: min(85vw, 210px) !important;
    }

    body.page-shorts .step-accordion-title {
        font-size: 0.76rem !important;
    }

    body.page-shorts .btn-cart,
    body.page-shorts .btn-clear {
        font-size: 0.70rem !important;
        padding: 7px 6px !important;
    }
}

/* Suporte para celular em orientação horizontal (Landscape) */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    body.page-shorts .app-container {
        flex-direction: row !important;
        grid-template-columns: 1fr 1fr !important;
    }

    body.page-shorts .simulator-area {
        flex: 1 1 50% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-bottom: none !important;
        border-right: 2px solid rgba(212, 175, 55, 0.4) !important;
    }

    body.page-shorts .controls-area {
        flex: 1 1 50% !important;
        height: 100% !important;
    }
}

/* ==========================================================================
   TABLET & TELAS INTERMEDIÁRIAS (769px a 1024px) - Experiência Fluida & Sem Cortes
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    html,
    body.page-shorts {
        height: 100% !important;
        height: 100dvh !important;
        overflow: hidden !important;
    }

    body.page-shorts .app-container {
        display: grid !important;
        grid-template-columns: minmax(0, 52fr) minmax(340px, 48fr) !important;
        gap: 12px !important;
        padding: 6px 10px !important;
        height: calc(100vh - 52px) !important;
        height: calc(100dvh - 52px) !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    body.page-shorts .simulator-area {
        height: 100% !important;
        min-height: 0 !important;
        max-height: 100% !important;
        width: 100% !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    body.page-shorts .controls-area {
        height: 100% !important;
        max-height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-right: 4px !important;
    }

    body.page-shorts .header-center .header-env-title {
        max-width: 220px !important;
        font-size: 0.82rem !important;
    }
}

