/* ==========================================================================
   ELETRO ERP - MÓDULO DE MERCADORIAS (FRENTE DE CAIXA)
   Vanilla CSS - Layout Integrado de Duas Colunas (Grid & Painel Lateral)
   ========================================================================== */

/* Layout Grid Principal */
.mercadorias-grid-layout {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 20px;
    align-items: start;
}

.mercadorias-col-main {
    min-width: 0; /* Impede transbordamento de tabelas flexiveis */
}

.mercadorias-col-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Painel Lateral - Seções */
.side-panel-section {
    padding: 20px;
}

/* Grid de Cargas Logísticas (Painel Lateral) */
.entregas-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.entrega-card {
    background: var(--card-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.entrega-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #d1d5db;
}

/* Cabeçalho do Card (Accordion) */
.entrega-header {
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.entrega-info-dest {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.entrega-dest-nome {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.entrega-transp {
    font-size: 0.72rem;
    color: var(--text-light);
}

.entrega-status-badge-container {
    display: flex;
    align-items: center;
}

/* Badges de Status compactos */
.status-badge {
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge.preparacao {
    background-color: #f3f4f6;
    color: #4b5563;
}

.status-badge.despachado {
    background-color: #eff6ff;
    color: #2563eb;
}

.status-badge.transito {
    background-color: #fef3c7;
    color: #d97706;
}

.status-badge.entregue {
    background-color: #ecfdf5;
    color: #059669;
}

.status-badge.atrasado {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Bolinha Pulsante de Status Ativo */
.status-dot-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
    position: relative;
}

.status-dot-pulse::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.8); opacity: 0; }
}

.entrega-chevron {
    font-size: 1.2rem;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.entrega-card.expanded .entrega-chevron {
    transform: rotate(180deg);
}

/* Corpo do Card (Accordion/Sanfona) */
.entrega-body {
    display: none;
    padding: 16px;
    border-top: 1px dashed var(--border-subtle);
    background-color: #fafbfc;
}

.entrega-card.expanded .entrega-body {
    display: block;
}

/* Layout de Detalhes Logísticos */
.logistica-details-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-wrapper {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 16px;
}

.timeline-title, .products-list-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

/* Timeline Vertical Compacta */
.delivery-timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    padding-left: 14px;
}

.delivery-timeline::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background-color: var(--border-subtle);
    z-index: 1;
}

.timeline-item {
    position: relative;
    padding-left: 16px;
    z-index: 2;
}

.timeline-node {
    position: absolute;
    left: -16px;
    top: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #d1d5db;
    border: 2px solid var(--card-white);
    box-shadow: 0 0 0 2px #d1d5db;
    z-index: 3;
}

.timeline-item.active .timeline-node {
    background-color: var(--primary-red);
    box-shadow: 0 0 0 2px var(--primary-red), 0 0 6px var(--primary-red);
}

.timeline-item.completed .timeline-node {
    background-color: #10b981;
    box-shadow: 0 0 0 2px #10b981;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.timeline-step-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-dark);
}

.timeline-item.completed .timeline-step-title {
    color: #059669;
}

.timeline-item.active .timeline-step-title {
    color: var(--primary-red);
}

.timeline-step-desc {
    font-size: 0.68rem;
    color: var(--text-light);
}

.timeline-step-date {
    font-size: 0.62rem;
    color: #9ca3af;
    margin-top: 1px;
}

/* Tabela de Produtos Compacta */
.entrega-products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.entrega-products-table th {
    text-align: left;
    padding: 6px 8px;
    font-weight: 700;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-subtle);
}

.entrega-products-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-dark);
}

.entrega-products-table tr:last-child td {
    border-bottom: none;
}

.prod-img-cell {
    width: 36px;
    padding: 2px !important;
}

.prod-img-wrapper {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid var(--border-subtle);
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.prod-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.prod-img-placeholder {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Cards de Recursos Futuros (Minimalismo Puro) */
.future-resources-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.future-resource-card {
    background-color: var(--color-slate-50, #f8fafc);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 10px);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.future-resource-card:hover {
    opacity: 0.95;
}

.future-resource-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.future-resource-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.future-resource-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
}

.future-resource-desc {
    font-size: 0.7rem;
    color: var(--text-light);
}

.future-resource-badge {
    background-color: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 9999px;
    white-space: nowrap;
}

/* Responsividade do Grid */
@media (max-width: 1024px) {
    .mercadorias-grid-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Botões quadrados com cantos arredondados de controle de lista (Resolução de conflito oval/geometria) */
.btn-round-control {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    border-radius: 10px !important; /* Cantos arredondados (quadrado suave) */
    padding: 0 !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

/* Botão Adicionar Item (Vermelho Primário) */
#btn-open-add-list-modal.btn-round-control {
    background-color: var(--primary-red, #DB0038) !important;
    border: none !important;
}
#btn-open-add-list-modal.btn-round-control i {
    color: white !important;
}

/* Botão Impressora/PDF (Cinza minimalista sem hover verde) */
#btn-print-list.btn-round-control {
    background-color: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}
#btn-print-list.btn-round-control:hover {
    background-color: #e2e8f0 !important;
}
#btn-print-list.btn-round-control i {
    color: #475569 !important;
}

.btn-round-control:hover {
    transform: scale(1.05);
}

.btn-round-control i {
    font-size: 1.2rem !important;
    margin: 0 !important;
}
