
/* --- ESTILOS GERAIS (DESKTOP) --- */
.shipping-title {
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: bold;
    color: #000;
}

/* --- ESTILOS GERAIS --- */

.shipping-grid { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.shipping-card {
    background: #fff; 
    border: 1px solid #e9ecef; 
    border-radius: 6px;
    padding: 10px; 
    text-align: center; 
    cursor: pointer;
    transition: all 0.3s ease; 
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    min-height: 60px; 
    flex: 1 1 calc(25% - 10px);
    min-width: 140px; 
    box-sizing: border-box;
    font-size: 13px;

}
.shipping-card.active {
    border: 2px solid #27ae60 !important;
    background-color: #f0fff4 !important;
    box-shadow: 0 0 8px rgba(39, 174, 96, 0.4);
    transition: all 0.2s ease;
}

/* --- AJUSTE DINÂMICO DO COMBO (SELECT2) --- */
.select2-container .select2-selection--single {
    /* Permite que a altura cresça conforme o conteúdo */
    height: auto !important; 
    min-height: 38px !important; /* Altura mínima padrão do Bootstrap */
    display: flex !important;
    align-items: center !important;
    padding: 6px 0 !important; /* Espaço interno superior e inferior */
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    /* Força a quebra de linha e ajusta o respiro do texto */
    white-space: normal !important; 
    word-wrap: break-word !important; 
    line-height: 1.5 !important; /* Melhora a leitura entre linhas */
    padding-left: 12px !important;
    padding-right: 30px !important; /* Evita que o texto fique sob a seta */
    color: #444 !important;
}

/* Centraliza a seta do combo verticalmente, independente da altura do texto */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    display: flex !important;
    align-items: center !important;
    right: 5px !important;
}
/* --- AJUSTES MOBILE (Telas até 768px) --- */
@media (max-width: 768px) {
    
    /* 1. Reset da Estrutura da Tabela */
    [name="fieldList_Produtos"] thead { display: none !important; }
    
    [name="fieldList_Produtos"] table, 
    [name="fieldList_Produtos"] tbody, 
    [name="fieldList_Produtos"] tfoot, 
    [name="fieldList_Produtos"] tr,
    [name="fieldList_Produtos"] td {
        display: block !important;
        width: 100% !important;
    }

    /* 2. Estilização das Linhas de Dados (Body) */
    [name="fieldList_Produtos"] tbody tr {
        margin-bottom: 20px;
        padding: 12px;
        background: #fff;
        border: 1px solid #ddd !important;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    /* 3. Injeção de Cabeçalhos (Apenas no Body) */
    [name="fieldList_Produtos"] tbody td:nth-child(4)::before { content: "Produto"; }
    [name="fieldList_Produtos"] tbody td:nth-child(5)::before { content: "Valor Unitário"; }
    [name="fieldList_Produtos"] tbody td:nth-child(6)::before { content: "Desconto"; }
    [name="fieldList_Produtos"] tbody td:nth-child(7)::before { content: "Valor Total"; }

    [name="fieldList_Produtos"] tbody td::before {
        display: block; font-weight: bold; font-size: 11px;
        color: #777; margin-bottom: 3px; text-transform: uppercase;
    }

    /* 4. RODAPÉ (TFOOT) - ONDE ESTÃO OS TOTAIS */
    [name="fieldList_Produtos"] tfoot tr {
        background: #f9f9f9;
        padding: 10px;
        border-top: 2px solid #27ae60 !important;
        margin-top: 10px;
    }

    /* Esconde células vazias do rodapé no mobile */
    [name="fieldList_Produtos"] tfoot td:empty {
        display: none !important;
    }

    /* Estiliza a célula que contém o valor da soma */
    [name="fieldList_Produtos"] tfoot td {
        text-align: right !important;
        font-weight: bold;
        font-size: 16px;
        color: #27ae60;
        padding: 8px 0 !important;
    }

    /* Esconde campos ocultos técnicos */
    [name="fieldList_Produtos"] tbody td:nth-child(1),
    [name="fieldList_Produtos"] tbody td:nth-child(2),
    [name="fieldList_Produtos"] tbody td:nth-child(3) {
        display: none !important;
    }
}