/**
 * Melhorias de Responsividade Mobile
 * ComparaMercado.online - Fase 1
 */

/* ============================================
   MOBILE FIRST - Base Styles
   ============================================ */

@media (max-width: 768px) {
    
    /* Container principal */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* ============================================
       TABELA DE COMPARAÇÃO - MODO CARD
       ============================================ */
    
    /* Esconde tabela tradicional em mobile */
    .table-responsive table {
        display: none;
    }
    
    /* Cards de produtos */
    .produto-card-mobile {
        display: block !important;
        background: white;
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    .produto-card-mobile:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    }
    
    /* Cabeçalho do card */
    .produto-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 2px solid #f0f0f0;
    }
    
    .produto-nome-mobile {
        font-size: 1.1rem;
        font-weight: 600;
        color: #333;
        flex: 1;
        margin-right: 10px;
    }
    
    .produto-acoes-mobile {
        display: flex;
        gap: 8px;
    }
    
    .btn-acao-mobile {
        padding: 8px 12px;
        font-size: 0.9rem;
        border-radius: 8px;
        border: none;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .btn-lista-mobile {
        background: #28a745;
        color: white;
    }
    
    .btn-watch-mobile {
        background: #ffc107;
        color: #333;
    }
    
    /* Preços por mercado */
    .mercado-preco-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        margin-bottom: 8px;
        background: #f8f9fa;
        border-radius: 8px;
        border-left: 4px solid #dee2e6;
    }
    
    .mercado-preco-item.melhor-preco {
        background: #d4edda;
        border-left-color: #28a745;
    }
    
    .mercado-nome-mobile {
        font-size: 0.95rem;
        font-weight: 500;
        color: #555;
    }
    
    .mercado-preco-mobile {
        font-size: 1.2rem;
        font-weight: 700;
        color: #333;
    }
    
    .melhor-preco .mercado-preco-mobile {
        color: #28a745;
    }
    
    .badge-melhor-mobile {
        display: inline-block;
        background: #28a745;
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.7rem;
        margin-left: 8px;
    }
    
    /* ============================================
       FILTROS MOBILE
       ============================================ */
    
    .filtros-mobile {
        position: sticky;
        top: 0;
        z-index: 100;
        background: white;
        padding: 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .btn-filtro-mobile {
        width: 100%;
        padding: 12px;
        background: #80a3ff;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .filtros-collapse {
        margin-top: 10px;
        padding: 15px;
        background: #f8f9fa;
        border-radius: 8px;
    }
    
    .filtro-group-mobile {
        margin-bottom: 15px;
    }
    
    .filtro-label-mobile {
        display: block;
        font-weight: 600;
        margin-bottom: 8px;
        color: #333;
    }
    
    .filtro-input-mobile {
        width: 100%;
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 6px;
        font-size: 1rem;
    }
    
    /* ============================================
       BUSCA MOBILE
       ============================================ */
    
    .busca-mobile {
        position: relative;
        margin-bottom: 15px;
    }
    
    .busca-input-mobile {
        width: 100%;
        padding: 12px 40px 12px 15px;
        border: 2px solid #80a3ff;
        border-radius: 25px;
        font-size: 1rem;
    }
    
    .busca-icon-mobile {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: #80a3ff;
        font-size: 1.2rem;
    }
    
    /* ============================================
       PAGINAÇÃO MOBILE
       ============================================ */
    
    .pagination-mobile {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin: 20px 0;
    }
    
    .pagination-mobile .page-link {
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 0.9rem;
    }
    
    /* ============================================
       LOADING SKELETON
       ============================================ */
    
    .skeleton-card-mobile {
        background: white;
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .skeleton-line {
        height: 20px;
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .skeleton-line.title {
        height: 24px;
        width: 80%;
    }
    
    .skeleton-line.price {
        height: 30px;
        width: 40%;
    }
    
    @keyframes loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
    
    /* ============================================
       MODAL CEP MOBILE
       ============================================ */
    
    .cep-modal-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 20px 20px 0 0;
        padding: 20px;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .cep-modal-mobile.active {
        transform: translateY(0);
    }
    
    .cep-input-group-mobile {
        display: flex;
        gap: 10px;
        margin-top: 15px;
    }
    
    .cep-input-mobile {
        flex: 1;
        padding: 12px;
        border: 2px solid #80a3ff;
        border-radius: 8px;
        font-size: 1rem;
    }
    
    .btn-cep-mobile {
        padding: 12px 20px;
        background: #f2ac44;
        color: white;
        border: none;
        border-radius: 8px;
        font-weight: 600;
    }
    
    /* ============================================
       TOAST NOTIFICATIONS
       ============================================ */
    
    .toast-mobile {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: #333;
        color: white;
        padding: 12px 20px;
        border-radius: 25px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        z-index: 9999;
        animation: slideUp 0.3s ease;
    }
    
    .toast-mobile.success {
        background: #28a745;
    }
    
    .toast-mobile.error {
        background: #dc3545;
    }
    
    @keyframes slideUp {
        from {
            transform: translateX(-50%) translateY(100px);
            opacity: 0;
        }
        to {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
        }
    }
    
    /* ============================================
       BOTÕES FLUTUANTES
       ============================================ */
    
    .fab-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 999;
    }
    
    .fab-button {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: #80a3ff;
        color: white;
        border: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        font-size: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s;
    }
    
    .fab-button:active {
        transform: scale(0.9);
    }
    
    /* ============================================
       HEADER MOBILE
       ============================================ */
    
    .header-mobile {
        position: sticky;
        top: 0;
        z-index: 100;
        background: #80a3ff;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .header-title-mobile {
        font-size: 1.3rem;
        font-weight: 700;
        color: white;
        margin: 0;
    }
    
    /* ============================================
       MELHORIAS GERAIS
       ============================================ */
    
    /* Aumenta área de toque */
    button, a, input[type="checkbox"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Melhora legibilidade */
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* Remove hover effects em touch devices */
    @media (hover: none) {
        .btn:hover {
            transform: none;
        }
    }
}

/* ============================================
   TABLET (768px - 1024px)
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    .produto-card-mobile {
        display: none;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table th, .table td {
        font-size: 0.9rem;
        padding: 10px;
    }
}

/* ============================================
   DESKTOP (> 1024px)
   ============================================ */

@media (min-width: 1025px) {
    .produto-card-mobile,
    .filtros-mobile,
    .fab-container {
        display: none !important;
    }
}

/* Made with Bob */
