/* DW DOCA B2B Frontend v4.0.0 - Design Robusto e Interativo */

/* ============================================================================
   BOX PRINCIPAL DE DESCONTOS
   ============================================================================ */
.dw-box {
    background: linear-gradient(135deg, #f8f9fa, #fff);
    border: 2px solid #000;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.dw-box:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.dw-box h3 {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 700;
    color: #000;
    border-bottom: 3px solid #000;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================================================
   DESCONTO PERSONALIZADO
   ============================================================================ */
.dw-personal-discount {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    animation: fadeInDown 0.5s ease;
}

.dw-personal-discount strong {
    font-size: 18px;
    font-weight: 800;
}

/* ============================================================================
   TABELA DE DESCONTOS
   ============================================================================ */
.dw-box table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.dw-box thead {
    background: #000;
    color: #fff;
}

.dw-box th {
    padding: 12px;
    font-weight: 600;
    text-align: left;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dw-box td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.dw-box tbody tr {
    transition: all 0.2s ease;
}

.dw-box tbody tr:hover {
    background: #f8f9fa;
}

/* Linha ativa (desconto aplicado) */
.dw-box tbody tr.active-discount {
    background: linear-gradient(90deg, #e8f5e9, #fff);
    border-left: 4px solid #2e7d32;
    font-weight: 600;
    animation: slideInLeft 0.3s ease;
}

.dw-box tbody tr.active-discount td {
    color: #2e7d32;
}

/* ============================================================================
   CALCULADORA DE PREÇOS
   ============================================================================ */
.dw-calc {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #2e7d32;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.dw-calc > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.dw-calc > div:last-child {
    border-bottom: none;
}

.dw-calc span {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.dw-calc strong {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    transition: all 0.3s ease;
}

.dw-calc .p-disc,
.dw-calc .t-disc {
    color: #2e7d32 !important;
    font-size: 20px !important;
}

.dw-calc .p-disc.has-discount,
.dw-calc .t-disc.has-discount {
    animation: priceUpdate 0.5s ease;
}

.dw-calc .p-saved {
    color: #2e7d32 !important;
    font-size: 18px !important;
    font-weight: 800 !important;
}

.dw-calc .p-saved.animated-pulse {
    animation: pulse 1s ease infinite;
}

.dw-calc .p-saved.saving-flash {
    animation: saveFlash 1s ease;
}

/* ============================================================================
   PRÓXIMO TIER - DICA INTELIGENTE
   ============================================================================ */
.next-tier-notice {
    background: linear-gradient(135deg, #e3f2fd, #fff);
    border: 2px solid #1976d2;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 15px 0;
    color: #1565c0;
    font-size: 14px;
    line-height: 1.6;
    animation: slideInUp 0.4s ease;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1);
}

.next-tier-notice strong {
    font-weight: 700;
    color: #0d47a1;
}

/* ============================================================================
   BOTÕES DE QUANTIDADE (+/-)
   ============================================================================ */
.qty-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #000;
    background: #fff;
    color: #000;
    font-size: 20px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #000;
    color: #fff;
    transform: scale(1.1);
}

.qty-btn:active {
    transform: scale(0.95);
}

input.qty {
    width: 60px !important;
    text-align: center;
    font-size: 16px !important;
    font-weight: 700;
    border: 2px solid #ddd !important;
    border-radius: 6px !important;
    padding: 8px !important;
}

/* ============================================================================
   FORMULÁRIOS DE REGISTRO
   ============================================================================ */
.dw-register,
.dw-status {
    max-width: 600px;
    margin: 30px auto;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.dw-register h3,
.dw-status h3 {
    margin: 0 0 20px;
    font-size: 22px;
    color: #000;
    border-bottom: 3px solid #000;
    padding-bottom: 10px;
}

.dw-register label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.dw-register input,
.dw-register select,
.dw-register textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    margin-bottom: 15px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.dw-register input:focus,
.dw-register select:focus,
.dw-register textarea:focus {
    border-color: #000;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.row-2 {
    display: flex;
    gap: 15px;
}

.row-2 > div {
    flex: 1;
}

.btn-submit {
    width: 100%;
    background: #000;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-submit:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-submit:active {
    transform: translateY(0);
}

/* ============================================================================
   MENSAGENS DE FEEDBACK
   ============================================================================ */
.dw-error {
    background: #ffebee;
    border-left: 4px solid #c62828;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    animation: shake 0.5s ease;
}

.dw-error ul {
    margin: 0;
    padding-left: 20px;
}

.dw-error li {
    color: #c62828;
    margin: 5px 0;
}

.dw-success {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    color: #2e7d32;
    font-weight: 600;
    animation: fadeInDown 0.5s ease;
}

/* ============================================================================
   BADGES DE STATUS
   ============================================================================ */
.status-ok {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
}

.status-pending {
    display: inline-block;
    background: #fff8e1;
    color: #b36b00;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
}

.points {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

/* ============================================================================
   TIER BADGES (NÍVEIS)
   ============================================================================ */
.tier-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: help;
    transition: all 0.3s ease;
    position: relative;
}

.tier-badge:hover {
    transform: scale(1.05);
}

.tier-badge.iniciante {
    background: linear-gradient(135deg, #e0e0e0, #bdbdbd);
    color: #424242;
}

.tier-badge.bronze {
    background: linear-gradient(135deg, #cd7f32, #b8792c);
    color: #fff;
}

.tier-badge.prata {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    color: #424242;
}

.tier-badge.ouro {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
}

.tier-badge.platina {
    background: linear-gradient(135deg, #e5e4e2, #d3d3d3);
    color: #424242;
}

.tier-badge.diamante {
    background: linear-gradient(135deg, #b9f2ff, #89cff0);
    color: #01579b;
}

.tier-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    margin-bottom: 10px;
    animation: fadeInDown 0.3s ease;
}

.tier-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #000;
}

/* ============================================================================
   WIDGET DE MENSAGENS
   ============================================================================ */
.dw-messages-widget {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.dw-message-item {
    padding: 15px;
    border-left: 4px solid #1976d2;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.dw-message-item:hover {
    background: #e3f2fd;
}

.dw-message-item.unread {
    border-left-color: #ff9800;
    background: #fff3e0;
    font-weight: 600;
}

.dw-message-item.priority-high {
    border-left-color: #c62828;
    background: #ffebee;
}

/* ============================================================================
   BOTÃO DE COTAÇÃO RÁPIDA
   ============================================================================ */
.request-quote-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.request-quote-btn:hover {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

/* ============================================================================
   ANIMAÇÕES
   ============================================================================ */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes priceUpdate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        color: #2e7d32;
    }
    100% {
        transform: scale(1);
    }
}

@keyframes saveFlash {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: rgba(46, 125, 50, 0.2);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* ============================================================================
   RESPONSIVIDADE
   ============================================================================ */
@media (max-width: 768px) {
    .dw-box {
        padding: 20px 16px;
    }
    
    .dw-calc > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .dw-calc strong {
        font-size: 16px;
    }
    
    .row-2 {
        flex-direction: column;
        gap: 0;
    }
    
    .dw-box table {
        font-size: 13px;
    }
    
    .dw-box th,
    .dw-box td {
        padding: 8px;
    }
    
    .next-tier-notice {
        font-size: 13px;
        padding: 12px 15px;
    }
}

@media (max-width: 600px) {
    .dw-box table {
        display: block;
        overflow-x: auto;
    }
    
    .dw-register,
    .dw-status {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .qty-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    input.qty {
        width: 50px !important;
    }
}

/* ============================================================================
   MODO ESCURO (Opcional - preparado para futura implementação)
   ============================================================================ */
@media (prefers-color-scheme: dark) {
    .dw-box {
        background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
        border-color: #444;
    }
    
    .dw-box h3 {
        color: #fff;
        border-color: #444;
    }
    
    .dw-box table {
        background: #2a2a2a;
    }
    
    .dw-box thead {
        background: #333;
    }
    
    .dw-box td {
        border-color: #444;
        color: #e0e0e0;
    }
    
    .dw-calc {
        background: #2a2a2a;
        border-color: #2e7d32;
    }
    
    .dw-calc span,
    .dw-calc strong {
        color: #e0e0e0;
    }
}
