/* Definição de variáveis globais */
.plugin-rastreamento-wrapper {
    --progress-color: #2E4E39;
    --grey-color: #d1d1d1;
    --text-color: #333;
    --light-text-color: #777;
}

/* --- FORMULÁRIO INICIAL --- */
.rp-container { max-width: 900px; margin: 40px auto; font-family: Arial, sans-serif; border: 1px solid #e0e0e0; padding: 30px; border-radius: 8px; background-color: #f9f9f9; }
.rp-form-wrapper { display: flex; align-items: flex-start; gap: 40px; }
.rp-form-box { flex: 1; }
.rp-form-group { margin-bottom: 20px; }
.rp-form-group label { display: block; margin-bottom: 8px; font-weight: bold; color: #333; }
.rp-form-group input { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.rp-button { padding: 15px; background-color: var(--progress-color); color: white; border: none; border-radius: 4px; font-size: 1.1em; cursor: pointer; transition: background-color 0.3s; }
.rp-button:hover { background-color: #1a3020; }
.rp-button-wrapper { display: flex; }
.rp-divider { display: flex; align-items: center; justify-content: center; font-size: 1.2em; color: #888; height: 150px; flex-shrink: 0; }
.rp-error { color: #D8000C; background-color: #FFD2D2; border: 1px solid; margin: 10px 0px; padding: 15px; border-radius: 4px; text-align: center; }

/* --- PÁGINA DE RESULTADOS --- */
.rp-results-wrapper { max-width: 900px; margin: 40px auto; font-family: Arial, sans-serif; }
.rp-timeline { display: flex; justify-content: space-between; align-items: flex-start; padding: 0 10px; }
.rp-timeline-step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.rp-timeline-icon { height: 30px; margin-bottom: 10px; display: flex; align-items: left; justify-content: left; width: 100%; }
.rp-timeline-icon-svg { width: 28px; height: 28px; background-color: var(--grey-color); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; transition: background-color 0.4s ease; }
.rp-timeline-track { display: flex; width: 100%; align-items: center; }
.rp-timeline-dot { width: 14px; height: 14px; border-radius: 50%; background-color: var(--grey-color); flex-shrink: 0; z-index: 2; transition: all 0.4s ease; border: 2px solid var(--grey-color); box-sizing: border-box; }
.rp-timeline-connector { height: 3px; width: 100%; background-color: var(--grey-color); flex-grow: 1; transition: background-color 0.4s ease; position: relative; overflow: hidden; }
.rp-timeline-step:last-child .rp-timeline-connector { background-color: transparent; }
.rp-timeline-label { margin-top: 10px; width: 100%; text-align: left; }
.rp-timeline-label strong { font-size: 14px; color: var(--light-text-color); display: block; }
.rp-timeline-label span { font-size: 12px; color: var(--light-text-color); }
.rp-timeline-step.completed .rp-timeline-dot, .rp-timeline-step.completed .rp-timeline-icon-svg { background-color: var(--progress-color); }
.rp-timeline-step.completed .rp-timeline-dot { border-color: var(--progress-color); }
.rp-timeline-step.completed .rp-timeline-label strong, .rp-timeline-step.completed .rp-timeline-label span { color: var(--text-color); }
.rp-timeline-step.active .rp-timeline-dot { transform: scale(1.2); background-color: #fff; border-color: var(--progress-color); }
.rp-timeline-step.active .rp-timeline-icon-svg { background-color: var(--progress-color); }
.rp-timeline-step.active .rp-timeline-label strong, .rp-timeline-step.active .rp-timeline-label span { color: var(--text-color); }

/* Animação da Barra de Progresso */
.rp-timeline-connector::before { content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 100%; background-color: var(--progress-color); transform: scaleX(0); transform-origin: left; transition: transform 0.6s ease-in-out; }
.rp-timeline-step.completed .rp-timeline-connector::before { transform: scaleX(1); }

.rp-details-grid { display: flex; margin-top: 50px; gap: 40px; }
.rp-main-details { flex: 2; }
.rp-main-details h3 { font-size: 22px; margin-bottom: 15px; color: var(--progress-color); }
.rp-main-details p { color: var(--light-text-color); line-height: 1.6; }
.rp-sidebar { flex: 1; display: flex; flex-direction: column; gap: 30px; }
.rp-sidebar-block { background-color: transparent; padding: 0; border: none; }
.rp-sidebar-block h4 { margin-top: 0; margin-bottom: 8px; font-size: 16px; font-style: normal; font-weight: 600; line-height: 24px; }
.rp-carrier-block { display: flex; align-items: flex-start; gap: 15px; }
.rp-carrier-logo img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.rp-carrier-info p, .rp-carrier-info h4 { margin: 0; line-height: 1.5; }
.rp-tracking-code { font-weight: bold; color: var(--progress-color); text-decoration: none; display: block; margin-top: 4px; }
.rp-product-item { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.rp-product-item:last-child { margin-bottom: 0; }
.rp-product-image img { width: 60px; height: 60px; border-radius: 4px; border: 1px solid #e0e0e0; object-fit: cover; }
.rp-product-info p { margin: 0; font-size: 14px; font-weight: bold; }
.rp-product-info span { font-size: 12px; color: var(--light-text-color); }
.rp-carrier-logo { align-self: center; }

/* --- HISTÓRICO DE RASTREAMENTO --- */
.rp-tracking-history { margin-top: 50px; padding-top: 30px; border-top: 1px solid #e0e0e0; }
.rp-tracking-history h3 { font-size: 20px; margin-bottom: 25px; color: var(--progress-color); font-weight: 600; }
.rp-tracking-timeline { position: relative; padding-left: 30px; }
.rp-tracking-timeline::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 3px; background: linear-gradient(to bottom, var(--progress-color) 0%, var(--progress-color) 20%, #e0e0e0 20%, #e0e0e0 100%); }
.rp-tracking-event { position: relative; margin-bottom: 30px; padding-left: 35px; }
.rp-tracking-event:last-child { margin-bottom: 0; }
.rp-tracking-dot { position: absolute; left: 0; top: 8px; width: 18px; height: 18px; border-radius: 50%; background-color: var(--progress-color); border: 4px solid #fff; box-shadow: 0 0 0 2px var(--progress-color); z-index: 1; }
.rp-tracking-event:first-child .rp-tracking-dot { background-color: #fff; box-shadow: 0 0 0 3px var(--progress-color); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.rp-tracking-content { background-color: #f9f9f9; padding: 18px; border-radius: 10px; border-left: 4px solid var(--progress-color); box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: all 0.3s ease; }
.rp-tracking-content:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.1); transform: translateX(2px); }
.rp-tracking-header { margin-bottom: 8px; }
.rp-tracking-date { display: inline-block; font-size: 13px; color: var(--light-text-color); font-weight: 600; background-color: #fff; padding: 4px 10px; border-radius: 4px; }
.rp-tracking-status { display: block; font-size: 16px; color: var(--progress-color); margin-bottom: 8px; font-weight: 700; line-height: 1.4; }
.rp-tracking-description { margin: 8px 0; font-size: 14px; line-height: 1.6; color: var(--text-color); }
.rp-tracking-location { display: inline-block; font-size: 12px; color: var(--light-text-color); margin-top: 8px; padding: 4px 8px; background-color: #fff; border-radius: 4px; font-style: normal; }

/* ================================================= */
/* --- SEÇÃO DE RESPONSIVIDADE ATUALIZADA --- */
/* ================================================= */
@media (max-width: 768px) {
    /* AJUSTE NO FORMULÁRIO */
    .plugin-rastreamento-wrapper .rp-form-wrapper,
    .rp-form-layout-vertical .rp-form-wrapper {
        flex-direction: column; /* Força o empilhamento vertical */
        align-items: stretch; /* Faz os filhos ocuparem toda a largura */
        gap: 0;
    }

    .plugin-rastreamento-wrapper .rp-divider,
    .rp-form-layout-vertical .rp-divider {
        height: auto; /* Remove a altura fixa */
        padding: 25px 0; /* Adiciona espaçamento vertical */
        width: 100%;
        justify-content: center; /* Garante a centralização */
    }

    /* AJUSTE NA PÁGINA DE RESULTADOS */
    .plugin-rastreamento-wrapper .rp-details-grid {
        flex-direction: column;
    }
    .plugin-rastreamento-wrapper .rp-timeline-label strong {
        font-size: 11px;
    }
    .plugin-rastreamento-wrapper .rp-timeline-label span {
        font-size: 10px;
    }
}