/**
 * CSS Responsivo Global - Sistema dominios-ao
 * Garante que o site seja 100% responsivo em todos os dispositivos
 * Otimizado para parecer um aplicativo mobile
 */

/* ============================================
   CONFIGURAÇÕES GLOBAIS PARA MOBILE
   ============================================ */

/* Prevenir scroll lateral em mobile */
html,
body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
}

/* Prevenir zoom em inputs em iOS */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
    font-size: 16px !important;
    /* Previne zoom automático no iOS */
}

@media screen and (max-width: 768px) {

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Touch targets maiores em mobile */
@media (max-width: 768px) {

    button,
    .btn,
    a.btn,
    .nav-link,
    .dropdown-item {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Prevenir seleção de texto acidental em mobile */
@media (max-width: 768px) {
    body {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    /* Permitir seleção em inputs e textareas */
    input,
    textarea,
    [contenteditable="true"] {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
}

/* ============================================
   NAVBAR RESPONSIVA
   ============================================ */

@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: #ffffff !important;
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border: 1px solid #dee2e6;
    }

    .navbar-nav {
        gap: 0.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
        transition: all 0.3s;
        color: #212529 !important;
    }

    .navbar-nav .nav-link:hover {
        background-color: #f8f9fa;
        color: #007bff !important;
    }

    .navbar-nav .nav-link.active {
        background-color: #e7f3ff;
        color: #007bff !important;
    }

    .navbar-nav .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem !important;
    }

    .logo-header {
        height: 35px !important;
        max-width: 120px !important;
    }

    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 1rem;
    }
}

/* ============================================
   CONTAINERS E LAYOUTS
   ============================================ */

@media (max-width: 1200px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ============================================
   CARDS RESPONSIVOS
   ============================================ */

@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .card-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .card-body {
        padding: 0.75rem;
    }
}

/* ============================================
   TABELAS RESPONSIVAS
   ============================================ */

@media (max-width: 991.98px) {
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: 0.5rem;
    }

    .table {
        font-size: 0.875rem;
        min-width: 600px;
        /* Força scroll horizontal se necessário */
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .table {
        font-size: 0.8rem;
        min-width: 500px;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.375rem;
    }

    /* Esconder colunas menos importantes em mobile */
    .table .d-md-table-cell {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .table {
        font-size: 0.75rem;
        min-width: 400px;
    }

    .table th,
    .table td {
        padding: 0.4rem 0.25rem;
    }

    /* Esconder mais colunas em telas muito pequenas */
    .table .d-sm-table-cell {
        display: none !important;
    }
}

/* ============================================
   FORMULÁRIOS RESPONSIVOS
   ============================================ */

@media (max-width: 768px) {
    .form-label {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

    .form-control,
    .form-select {
        font-size: 16px;
        /* Previne zoom no iOS */
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
    }

    .input-group {
        flex-wrap: wrap;
    }

    .input-group-text {
        width: 100%;
        border-radius: 0.5rem 0.5rem 0 0 !important;
        margin-bottom: -1px;
    }

    .input-group .form-control {
        border-radius: 0 0 0.5rem 0.5rem !important;
        border-top: none;
    }

    .form-check {
        margin-bottom: 0.75rem;
    }

    .form-check-label {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {

    .form-control,
    .form-select {
        padding: 0.625rem 0.875rem;
        font-size: 16px;
    }

    .form-label {
        font-size: 0.85rem;
    }
}

/* ============================================
   BOTÕES RESPONSIVOS
   ============================================ */

@media (max-width: 768px) {
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        border-radius: 0.5rem;
        min-height: 44px;
    }

    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-height: 38px;
    }

    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        min-height: 50px;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    .btn-group .btn {
        flex: 1 1 auto;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
        border-radius: 0.5rem !important;
        margin-bottom: 0.5rem;
    }

    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* ============================================
   MODAIS RESPONSIVOS
   ============================================ */

@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: 0.75rem;
    }

    .modal-header {
        padding: 1rem;
        border-bottom: 1px solid #dee2e6;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        padding: 1rem;
        border-top: 1px solid #dee2e6;
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
        display: flex;
        align-items: stretch;
    }

    .modal-content {
        height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   GRID SYSTEM RESPONSIVO
   ============================================ */

/* Garantir que colunas empilhem corretamente */
@media (max-width: 991.98px) {
    .row>[class*="col-lg"] {
        margin-bottom: 1rem;
    }
}

@media (max-width: 767.98px) {
    .row>[class*="col-md"] {
        margin-bottom: 1rem;
    }

    /* Forçar coluna única em mobile */
    .row>[class*="col-"]:not(.col-12):not(.col-sm-12) {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .row>[class*="col-"] {
        margin-bottom: 1rem;
    }
}

/* ============================================
   TIPOGRAFIA RESPONSIVA
   ============================================ */

@media (max-width: 768px) {

    h1,
    .h1 {
        font-size: 1.75rem;
    }

    h2,
    .h2 {
        font-size: 1.5rem;
    }

    h3,
    .h3 {
        font-size: 1.25rem;
    }

    h4,
    .h4 {
        font-size: 1.1rem;
    }

    h5,
    .h5 {
        font-size: 1rem;
    }

    h6,
    .h6 {
        font-size: 0.95rem;
    }

    .display-1 {
        font-size: 2.5rem;
    }

    .display-2 {
        font-size: 2rem;
    }

    .display-3 {
        font-size: 1.75rem;
    }

    .display-4 {
        font-size: 1.5rem;
    }

    p,
    .lead {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

@media (max-width: 576px) {

    h1,
    .h1 {
        font-size: 1.5rem;
    }

    h2,
    .h2 {
        font-size: 1.25rem;
    }

    h3,
    .h3 {
        font-size: 1.1rem;
    }

    .display-1 {
        font-size: 2rem;
    }

    .display-2 {
        font-size: 1.75rem;
    }

    .display-3 {
        font-size: 1.5rem;
    }

    .display-4 {
        font-size: 1.25rem;
    }
}

/* ============================================
   IMAGENS RESPONSIVAS
   ============================================ */

img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .img-fluid {
        width: 100%;
        height: auto;
    }
}

/* ============================================
   UTILITÁRIOS MOBILE
   ============================================ */

/* Safe area para dispositivos com notch */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    .navbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Melhorar scroll em mobile */
@media (max-width: 768px) {
    * {
        -webkit-overflow-scrolling: touch;
    }

    body {
        overflow-x: hidden;
    }
}

/* Melhorar scroll em mobile */
@media (max-width: 768px) {
    html {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    body {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    main,
    .main-content {
        min-height: 100vh;
    }
}

/* ============================================
   ESPAÇAMENTOS RESPONSIVOS
   ============================================ */

@media (max-width: 768px) {
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .py-4 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .my-5 {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }

    .my-4 {
        margin-top: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }

    .mb-5 {
        margin-bottom: 2rem !important;
    }

    .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    .mt-5 {
        margin-top: 2rem !important;
    }

    .mt-4 {
        margin-top: 1.5rem !important;
    }
}

@media (max-width: 576px) {
    .py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .my-5 {
        margin-top: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }

    .my-4 {
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }
}

/* ============================================
   ALERTS E NOTIFICAÇÕES RESPONSIVAS
   ============================================ */

@media (max-width: 768px) {
    .alert {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
    }

    .alert-dismissible .btn-close {
        padding: 0.5rem;
    }
}

/* ============================================
   BADGES RESPONSIVOS
   ============================================ */

@media (max-width: 576px) {
    .badge {
        font-size: 0.75rem;
        padding: 0.35em 0.6em;
    }
}

/* ============================================
   DROPDOWN RESPONSIVO
   ============================================ */

@media (max-width: 768px) {
    .dropdown-menu {
        width: 100%;
        max-width: 100%;
        border-radius: 0.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* ============================================
   PÁGINAS ESPECÍFICAS
   ============================================ */

/* Index/Homepage */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0 !important;
    }

    .hero-title {
        font-size: 2rem !important;
    }

    .hero-subtitle {
        font-size: 1rem !important;
    }

    .company-logo {
        max-width: 120px;
        max-height: 60px;
    }
}

/* Email/Hosting/Domain pages */
@media (max-width: 768px) {
    .pricing-card {
        margin-bottom: 1.5rem;
    }

    .pricing-card .card-body {
        padding: 1.5rem 1rem;
    }

    .pricing-price {
        font-size: 2rem;
    }
}

/* Cart page */
/* ==========================================================================
   CART & PAYMENT PAGES (RESPONSIVE OVERRIDES)
   ========================================================================== */

@media (max-width: 768px) {

    /* Cart Table Stacking */
    .table-modern thead {
        display: none !important;
        /* Hide headers on mobile */
    }

    .table-modern,
    .table-modern tbody,
    .table-modern tr,
    .table-modern td {
        display: block !important;
        width: 100% !important;
    }

    .table-modern tr {
        margin-bottom: 2rem !important;
        border: 1px solid #f0f0f0 !important;
        border-radius: 16px !important;
        padding: 1.25rem !important;
        background: #fff !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
    }

    .table-modern td {
        text-align: left !important;
        padding: 0.75rem 0 !important;
        border: none !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .table-modern td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #888;
        font-size: 0.75rem;
        text-transform: uppercase;
        margin-right: 1rem;
    }

    .table-modern td:first-child {
        border-bottom: 1px solid #f8f9fa !important;
        margin-bottom: 1rem !important;
        padding-bottom: 1rem !important;
        display: block !important;
    }

    .table-modern td:first-child::before {
        display: none !important;
    }

    .table-modern td:last-child {
        justify-content: center !important;
        margin-top: 1rem !important;
        padding-top: 1rem !important;
        border-top: 1px dashed #eee !important;
    }

    /* Checkout Totals */
    .card-footer .d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: center !important;
    }

    .card-footer .btn-lg {
        width: 100% !important;
        margin-top: 1rem !important;
    }
}

/* ============================================
   PERFORMANCE E OTIMIZAÇÕES MOBILE
   ============================================ */
@media (max-width: 768px) {

    *,
    *::before,
    *::after {
        animation-duration: 0.3s !important;
        animation-delay: 0s !important;
        transition-duration: 0.2s !important;
    }
}

@media (max-width: 768px) {
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    body {
        text-rendering: optimizeLegibility;
    }
}

/* ============================================
   ACESSIBILIDADE MOBILE
   ============================================ */
@media (max-width: 768px) {

    /* Melhorar foco visível sem poluir o design */
    *:focus {
        outline: 2px solid var(--brand-primary, #673de6) !important;
        outline-offset: 1px;
    }

    /* Áreas de toque maiores */
    .btn,
    .nav-link-menu,
    .form-control,
    .form-select {
        min-height: 48px;
    }
}