/*
 * B2B TradeLink - Estilos Padronizados
 * Arquivo CSS centralizado para formulários, tabelas e componentes
 * Versão: 1.0
 */

/* ============================================
   HEADER DAS PÁGINAS
   ============================================ */

.items-header,
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0;
}

.items-header h4,
.page-header h4 {
    font-size: 1.5rem;
    color: #333;
    margin: 0;
}

.items-header h4 a,
.page-header h4 a {
    color: #333;
    text-decoration: none;
}

.items-header h4 a:hover,
.page-header h4 a:hover {
    color: #dc3545;
    text-decoration: underline;
}

/* ============================================
   BOTÕES PRINCIPAIS
   ============================================ */

.btn-add-item,
.btn-primary-action {
    background-color: #dc3545;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-add-item:hover,
.btn-primary-action:hover {
    background-color: #c82333;
    color: white;
    text-decoration: none;
}

.btn-add-item i,
.btn-primary-action i {
    font-size: 14px;
}

/* ============================================
   TABELAS PADRONIZADAS
   ============================================ */

.table-items,
.table-standard {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    width: 100%;
}

.table-items thead,
.table-standard thead {
    background-color: #495057;
}

.table-items thead th,
.table-standard thead th {
    color: white;
    font-weight: 500;
    padding: 15px;
    border: none;
}

.table-items tbody tr,
.table-standard tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.table-items tbody tr:nth-child(even),
.table-standard tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.table-items tbody tr:hover,
.table-standard tbody tr:hover {
    background-color: #f1f3f5;
}

.table-items tbody td,
.table-standard tbody td {
    padding: 15px;
    vertical-align: middle;
}

/* ============================================
   BOTÕES DE AÇÃO (PEQUENOS COM ÍCONES)
   ============================================ */

.btn-sm {
    padding: 8px 12px;
    font-size: 0.875rem;
    margin-right: 5px;
    min-width: 40px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-sm:hover {
    opacity: 0.85;
    text-decoration: none;
}

.btn-sm i {
    font-size: 16px;
    display: inline-block;
    line-height: 1;
}

/* Garantir que ícones apareçam e tenham cor visível */
.table-items tbody td .btn i,
.table-standard tbody td .btn i {
    pointer-events: none;
    color: white;
}

/* Espaçamento entre botões */
.table-items tbody td .btn,
.table-standard tbody td .btn {
    margin-right: 3px;
}

/* Cores dos botões de ação */
.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #117a8b;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    display: block;
}

.form-group label.required:after {
    content: " *";
    color: #dc3545;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* ============================================
   SEÇÕES DE FORMULÁRIO
   ============================================ */

.b2b-form-section {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.b2b-form-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

/* ============================================
   AÇÕES DE FORMULÁRIO
   ============================================ */

.b2b-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 0;
    margin-top: 20px;
}

.b2b-btn-back {
    background-color: #6c757d;
    color: white;
    padding: 10px 24px;
    border-radius: 5px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.b2b-btn-back:hover {
    background-color: #5a6268;
    color: white;
    text-decoration: none;
}

.b2b-btn-continue {
    background-color: #dc3545;
    color: white;
    padding: 10px 24px;
    border-radius: 5px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.b2b-btn-continue:hover {
    background-color: #c82333;
    color: white;
    text-decoration: none;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 768px) {

    .items-header,
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .btn-add-item,
    .btn-primary-action {
        width: 100%;
        justify-content: center;
    }

    .table-items tbody td .btn,
    .table-standard tbody td .btn {
        margin-bottom: 5px;
    }

    .b2b-form-actions {
        flex-direction: column;
    }

    .b2b-btn-back,
    .b2b-btn-continue {
        width: 100%;
    }
}

/* ============================================
   UTILIDADES
   ============================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mt-5 {
    margin-top: 3rem;
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 1rem;
}

.p-4 {
    padding: 1.5rem;
}

.p-5 {
    padding: 3rem;
}

/* ============================================
   SHARE BUTTONS & VIEW COUNTER (HOMEPAGE)
   ============================================ */

/* View Counter Styles */
.b2b-card-views {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    padding: 6px 0;
}

.b2b-card-views i {
    font-size: 16px;
    color: #999;
}

/* Share Buttons Styles */
.b2b-card-share {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E0E0E0;
}

.b2b-share-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #F5F5F5;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.b2b-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.b2b-share-btn[data-platform="facebook"]:hover {
    background: #3B5998;
    color: white;
}

.b2b-share-btn[data-platform="twitter"]:hover {
    background: #1DA1F2;
    color: white;
}

.b2b-share-btn[data-platform="linkedin"]:hover {
    background: #0077B5;
    color: white;
}

.b2b-share-btn[data-platform="whatsapp"]:hover {
    background: #25D366;
    color: white;
}

.b2b-share-btn[data-platform="copy"]:hover {
    background: #666;
    color: white;
}

/* Card Footer Adjustments */
.b2b-card-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

/* Responsive Share Buttons */
@media (max-width: 768px) {
    .b2b-card-share {
        justify-content: center;
    }

    .b2b-share-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* ============================================
   ESTILOS ADICIONAIS PARA TABELAS MODERNAS & AVATARES
   ============================================ */

.b2b-modern-table thead th {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.8px;
    font-weight: 700;
    border-bottom: 2px solid #dee2e6 !important;
    padding: 12px 15px !important;
}

.b2b-modern-table tbody tr:hover {
    background-color: #fff9f9 !important;
}

.b2b-modern-table td {
    vertical-align: middle !important;
}

.avatar-xs {
    height: 35px;
    width: 35px;
}

.avatar-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 16px;
}

.bg-soft-primary {
    background-color: rgba(220, 53, 69, 0.1) !important;
    /* Usando tom vermelho B2B */
    color: #dc3545 !important;
}

.fs-13 {
    font-size: 13px !important;
}

.ls-pagination {
    margin-top: 20px;
}