/* General styles */
.omnilife-price-list-container {
    margin: 20px 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    width: 100%;
    overflow-x: auto;
    color: #333;
}

/* List header */
.omnilife-list-header {
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2c3e50;
}

.list-title {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px 0;
    text-align: left;
    text-transform: uppercase;
}

.list-vigencia {
    color: #6c757d;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    text-align: left;
    font-style: italic;
}

/* Search form */
.omnilife-search-form {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.search-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
    align-items: center;
}

.search-fields input[type="text"] {
    flex-grow: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.3s;
}

.search-fields input[type="text"]:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.search-button, .reset-button, .print-button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
    min-width: 100px;
}

.search-button {
    background-color: #2c3e50;
    color: white;
}

.search-button:hover {
    background-color: #1a252f;
    transform: translateY(-2px);
}

.reset-button {
    background-color: #6c757d;
    color: white;
}

.reset-button:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.print-button {
    background-color: #28a745;
    color: white;
}

.print-button:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

/* Print actions */
.print-actions {
    margin: 20px 0;
    text-align: right;
}

/* Category filter */
.category-filter {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-filter label {
    font-weight: 600;
    color: #495057;
    min-width: 150px;
}

.category-filter select {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    color: #495057;
    transition: border-color 0.3s;
}

.category-filter select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Percentage buttons */
.percentage-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0 0;
    flex-wrap: wrap;
}

.percentage-button {
    padding: 10px 15px;
    border: 2px solid #2c3e50;
    border-radius: 6px;
    background-color: #fff;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    min-width: 70px;
    text-align: center;
}

.percentage-button:hover {
    background-color: #f8f9fa;
}

.percentage-button.active {
    background-color: #2c3e50;
    color: white;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.2);
}

/* Products table */
.omnilife-table-container {
    overflow-x: auto;
    width: 100%;
    margin-top: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border-radius: 8px;
    background: #fff;
}

.omnilife-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.omnilife-price-table th, 
.omnilife-price-table td {
    padding: 14px 16px;
    border: 1px solid #e1e1e1;
}

/* Column alignment */
.omnilife-price-table th:first-child,
.omnilife-price-table td:first-child,
.omnilife-price-table th:nth-child(3),
.omnilife-price-table td:nth-child(3),
.omnilife-price-table th:nth-child(4),
.omnilife-price-table td:nth-child(4),
.omnilife-price-table th:nth-child(5),
.omnilife-price-table td:nth-child(5),
.omnilife-price-table th:nth-child(6),
.omnilife-price-table td:nth-child(6) {
    text-align: center;
}

/* Quantity input */
.product-qty {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    width: 60px;
}

.product-qty:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Table header */
.omnilife-price-table th {
    background-color: #2c3e50;
    color: #fff !important;
    font-weight: 600;
    position: sticky;
    top: 0;
    white-space: nowrap;
}

/* Alternating rows */
.omnilife-price-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Row hover */
.omnilife-price-table tr:hover {
    background-color: #e9ecef;
}

/* Values */
.percentage-value, .suggested-price {
    font-weight: 600;
    color: #2c3e50;
}

/* Footer styles */
.omnilife-price-footer {
    margin-top: 0;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    border-top: 2px solid #2c3e50;
    padding: 15px;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.footer-row:last-child {
    margin-bottom: 0;
}

.footer-col {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.profit-row .footer-col {
    flex: 100%;
    background-color: #f1f8e9;
    border: 1px solid #d4edda;
}

.footer-label {
    display: block;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 5px;
    font-size: 14px;
}

.footer-value {
    display: block;
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
}

#total-profit {
    color: #28a745;
}

/* Messages */
.no-results {
    padding: 25px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.loading {
    padding: 25px;
    text-align: center;
    color: #0073aa;
    font-weight: 600;
}

.error {
    padding: 25px;
    text-align: center;
    color: #dc3545;
    font-weight: 600;
}

/* Sorting header styles */
.sortable-header {
    cursor: pointer;
    position: relative;
    padding-right: 20px !important;
}

.sortable-header:hover {
    background-color: #34495e !important;
}

.sortable-header:after {
    content: "↓";
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.5;
}

.sortable-header.asc:after {
    content: "↑";
    opacity: 1;
}

.sortable-header.desc:after {
    content: "↓";
    opacity: 1;
}

/* Points column styling */
.product-points {
    white-space: nowrap;
    text-align: center;
}

/* Estilo do cabeçalho ordenado */
.sortable-header.sorted {
   /* background-color: #e1f5fe !important;*/
}

/* Botão de limpar ordenação */
.sort-clear {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #f44336;
    font-size: 16px;
    font-weight: bold;
    margin-left: 5px;
    padding: 0 5px;
}

.sort-clear:hover {
    color: #d32f2f;
    background-color: #ffebee;
    border-radius: 50%;
}

/* Ajuste para a seta de ordenação quando o botão × está visível */
.sortable-header.sorted:after {
    right: 20px;
}

/* ========== PRINT STYLES ========== */
@media print {
    .omnilife-search-form, 
    .percentage-buttons,
    .print-actions,
    .sort-clear {
        display: none !important;
    }
    
    .omnilife-price-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
    }
    
    .omnilife-price-table th, 
    .omnilife-price-table td {
        padding: 8px 10px;
        border: 1px solid #ddd;
    }
    
    .omnilife-price-table th {
        background-color: #f2f2f2 !important;
        color: #000 !important;
    }
    
    .omnilife-price-footer {
        page-break-inside: avoid;
    }
    
    /* Hide rows with quantity 0 */
    .omnilife-price-table tbody tr {
        display: table-row;
    }
    
    .omnilife-price-table tbody tr[data-qty="0"] {
        display: none;
    }
    
    @page {
        size: A4;
        margin: 1cm;
    }
    
    body {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .print-header {
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #2c3e50;
        padding-bottom: 10px;
    }
    
    .print-header h2 {
        margin: 0;
        font-size: 18px;
    }
    
    .print-header p {
        margin: 5px 0 0;
        font-size: 14px;
    }
}

/* ========== RESPONSIVENESS ========== */
@media (max-width: 992px) {
    .list-title {
        font-size: 22px;
    }
    
    .list-vigencia {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .omnilife-list-header {
        margin-bottom: 20px;
    }
    
    .list-title {
        font-size: 20px;
    }
    
    .search-fields {
        flex-direction: column;
    }
    
    .search-fields input[type="text"],
    .search-button,
    .reset-button {
        width: 100%;
    }
    
    .category-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .category-filter label {
        margin-bottom: 5px;
    }
    
    .omnilife-price-table th,
    .omnilife-price-table td {
        padding: 12px 10px;
    }
    
    .footer-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-col {
        min-width: 100%;
    }
}

@media (max-width: 576px) {
    .omnilife-price-table {
        display: block;
    }
    
    .omnilife-price-table thead {
        display: none;
    }
    
    .omnilife-price-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 6px;
    }
    
    .omnilife-price-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        border-bottom: 1px solid #eee;
        padding: 12px 15px;
        text-align: right !important;
    }
    
    .omnilife-price-table td:before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 10px;
        color: #2c3e50;
    }
    
    .omnilife-price-table td:last-child {
        border-bottom: none;
    }
    
    /* Mobile labels */
    .omnilife-price-table td:nth-child(1):before { content: "Código: "; }
    .omnilife-price-table td:nth-child(2):before { content: "Descrição: "; }
    .omnilife-price-table td:nth-child(3):before { content: "Pontos: "; }
    .omnilife-price-table td:nth-child(4):before { content: "Qtd: "; }
    .omnilife-price-table td:nth-child(5):before { content: "Valor: "; }
    .omnilife-price-table td:nth-child(6):before { content: "Sugerido: "; }
    
    /* Adjust quantity input for mobile */
    .product-qty {
        width: 50px;
    }
    
    .list-title {
        font-size: 18px;
    }
    
    .list-vigencia {
        font-size: 14px;
    }
    
    .percentage-buttons {
        gap: 8px;
    }
    
    .percentage-button {
        padding: 8px 5px;
        font-size: 13px;
    }
}

/* Modal de totais fixo */
.omnilife-totals-modal {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #2c3e50;
    color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: none;
    min-width: 200px;
    text-align: center;
    transition: all 0.3s ease;
}

.omnilife-totals-modal.active {
    display: block;
    animation: fadeInUp 0.3s;
}

.omnilife-totals-modal h4 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
}

.omnilife-totals-modal .total-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
}

.omnilife-totals-modal .total-item:last-child {
    margin-bottom: 0;
}

.omnilife-totals-modal .total-label {
    font-weight: 600;
}

.omnilife-totals-modal .total-value {
    font-weight: bold;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .omnilife-totals-modal {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}

.omnilife-print-container {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 20px;
    color: #333;
}

.omnilife-print-container .print-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #2c3e50;
    padding-bottom: 10px;
}

.omnilife-print-container .print-header h2 {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.omnilife-print-container .print-header p {
    margin: 5px 0 0;
    font-size: 14px;
    color: #666;
}

.omnilife-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.omnilife-print-table th,
.omnilife-print-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.omnilife-print-table th {
    background-color: #f2f2f2;
    color: #333;
}

.omnilife-print-table tr:nth-child(even) {
    background-color: #f9f9f9;
}
