/* ========================================
   Zebretin Rastreio - Pagina de Acompanhamento
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f5f0eb;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #4A2C1F;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.zr-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* Logo */
.zr-logo {
    text-align: center;
    margin-bottom: 32px;
}

.zr-logo-img {
    max-width: 180px;
    height: auto;
}

/* Saudacao */
.zr-greeting {
    text-align: center;
    color: #8B7355;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

/* Card principal */
.zr-card {
    background: white;
    border-radius: 20px;
    padding: 36px;
    box-shadow: 0 4px 30px rgba(74, 44, 31, 0.07);
    margin-bottom: 20px;
    animation: zr-fadeIn 0.4s ease;
}

@keyframes zr-fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== FORMULARIO DE BUSCA ===== */

.zr-title {
    font-size: 28px;
    font-weight: 700;
    color: #4A2C1F;
    margin: 0 0 8px 0;
    text-align: center;
    letter-spacing: -0.02em;
}

.zr-subtitle {
    color: #8B7355;
    text-align: center;
    margin: 0 0 32px 0;
    font-size: 15px;
}

.zr-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.zr-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4A2C1F;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.zr-input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5d5c7;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    color: #4A2C1F;
    background: #faf8f5;
    transition: all 0.25s ease;
}

.zr-input-group input::placeholder {
    color: #bfac98;
}

.zr-input-group input:focus {
    outline: none;
    border-color: #C9A66B;
    background: white;
    box-shadow: 0 0 0 4px rgba(201, 166, 107, 0.12);
}

.zr-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #4A2C1F 0%, #6B4423 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    letter-spacing: -0.01em;
}

.zr-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 44, 31, 0.25);
}

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

/* Erro */
.zr-error {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* ===== RESULTADO - HEADER ===== */

.zr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f5f0eb;
}

.zr-order-num {
    font-size: 22px;
    font-weight: 700;
    color: #4A2C1F;
    letter-spacing: -0.02em;
}

.zr-badge {
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.zr-badge.transito { background: #FFF8E7; color: #b8942d; }
.zr-badge.entregue { background: #E8F5E9; color: #2E7D32; }
.zr-badge.atrasado { background: #FFF3E0; color: #E65100; }
.zr-badge.devolvido { background: #F3E5F5; color: #7B1FA2; }

/* ===== INDICADOR DE ETAPAS ===== */

.zr-steps {
    display: flex;
    align-items: flex-start;
    margin-bottom: 28px;
}

.zr-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.zr-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e5d5c7;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

/* Etapa concluida */
.zr-step.done .zr-step-circle {
    background: #C9A66B;
    border-color: #C9A66B;
}

/* Etapa ativa */
.zr-step.active .zr-step-circle {
    border-color: #C9A66B;
    background: #FFF8E7;
    animation: zr-step-pulse 2s infinite;
}

@keyframes zr-step-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 166, 107, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(201, 166, 107, 0); }
}

.zr-step-dot {
    width: 12px;
    height: 12px;
    background: #C9A66B;
    border-radius: 50%;
}

/* Label da etapa */
.zr-step-label {
    font-size: 11px;
    font-weight: 600;
    color: #bfac98;
    margin-top: 8px;
    text-align: center;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.zr-step.done .zr-step-label {
    color: #C9A66B;
}

.zr-step.active .zr-step-label {
    color: #4A2C1F;
    font-weight: 700;
}

/* Linha entre etapas */
.zr-step-line {
    flex: 1;
    height: 3px;
    background: #e5d5c7;
    margin-top: 16px; /* metade da altura do circulo (36/2 - 3/2) */
    border-radius: 2px;
    min-width: 20px;
    transition: background 0.3s ease;
}

.zr-step-line.filled {
    background: #C9A66B;
}

/* ===== CARD DE ENTREGA ===== */

.zr-delivery {
    background: linear-gradient(135deg, #4A2C1F 0%, #5c3a22 50%, #6B4423 100%);
    padding: 28px;
    border-radius: 16px;
    color: white;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.zr-delivery-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.zr-delivery-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.zr-delivery-date {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.zr-delivery-weekday {
    font-size: 14px;
    opacity: 0.75;
    margin-top: 4px;
    font-weight: 500;
}

.zr-delivery-icon {
    opacity: 0.15;
    flex-shrink: 0;
}

.zr-delivery-address {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    opacity: 0.85;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    line-height: 1.5;
}

.zr-delivery-address svg {
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.7;
}

/* ===== ALERTA DE ATRASO ===== */

.zr-delay-alert {
    background: #FFF3E0;
    border-left: 4px solid #E65100;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    color: #bf4400;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.5;
}

.zr-delay-alert svg {
    flex-shrink: 0;
}

/* ===== INFO DO PRODUTO ===== */

.zr-product-info {
    background: #faf8f5;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.zr-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #4A2C1F;
}

.zr-product-details {
    font-size: 13px;
    color: #8B7355;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.zr-product-detail {
    white-space: nowrap;
}

/* ===== TIMELINE ===== */

.zr-timeline-title {
    font-size: 17px;
    font-weight: 700;
    color: #4A2C1F;
    margin: 0 0 24px 0;
    letter-spacing: -0.01em;
}

.zr-timeline {
    position: relative;
    padding-left: 56px;
}

/* Linha da timeline - parte pendente (cinza) */
.zr-timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #e5d5c7;
    border-radius: 2px;
}

/* Evento */
.zr-event {
    position: relative;
    margin-bottom: 32px;
    padding: 4px 0;
}

.zr-event:last-child {
    margin-bottom: 0;
}

/* Icone do evento */
.zr-event-icon {
    position: absolute;
    left: -47px;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e5d5c7;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.3s ease;
}

/* Status: concluido */
.zr-event.done .zr-event-icon {
    border-color: #C9A66B;
    background: #C9A66B;
}

.zr-event.done .zr-event-icon::after {
    content: '\2713';
    color: white;
    font-size: 17px;
    font-weight: 700;
}

/* Status: ativo */
.zr-event.active {
    background: #faf6ef;
    margin-left: -16px;
    margin-right: -16px;
    padding: 16px;
    border-radius: 14px;
}

.zr-event.active .zr-event-icon {
    left: -31px;
    border-color: #C9A66B;
    background: #FFF8E7;
    animation: zr-pulse 2s infinite;
}

.zr-event.active .zr-event-icon::after {
    content: '';
    width: 14px;
    height: 14px;
    background: #C9A66B;
    border-radius: 50%;
}

@keyframes zr-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 166, 107, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(201, 166, 107, 0); }
}

/* Status: atraso */
.zr-event.status-atraso .zr-event-icon {
    border-color: #E65100;
    background: #FFF3E0;
}

.zr-event.status-atraso .zr-event-icon::after {
    content: '!';
    color: #E65100;
    font-size: 18px;
    font-weight: 900;
}

.zr-event.status-atraso .zr-event-desc { color: #E65100; }

/* Status: saiu para entrega */
.zr-event.status-saiu_entrega .zr-event-icon {
    border-color: #2E7D32;
    background: #E8F5E9;
}

.zr-event.status-saiu_entrega .zr-event-icon::after {
    content: '\279C';
    color: #2E7D32;
    font-size: 17px;
    font-weight: 700;
}

/* Status: tentativa falha */
.zr-event.status-tentativa_falha .zr-event-icon {
    border-color: #C62828;
    background: #FFEBEE;
}

.zr-event.status-tentativa_falha .zr-event-icon::after {
    content: '\2717';
    color: #C62828;
    font-size: 17px;
    font-weight: 700;
}

.zr-event.status-tentativa_falha .zr-event-desc { color: #C62828; }

/* Status: devolvido */
.zr-event.status-devolvido .zr-event-icon {
    border-color: #7B1FA2;
    background: #F3E5F5;
}

.zr-event.status-devolvido .zr-event-icon::after {
    content: '\21A9';
    color: #7B1FA2;
    font-size: 17px;
    font-weight: 700;
}

.zr-event.status-devolvido .zr-event-desc { color: #7B1FA2; }

/* Textos do evento */
.zr-event-desc {
    font-size: 15px;
    font-weight: 600;
    color: #4A2C1F;
    margin-bottom: 4px;
    line-height: 1.4;
}

.zr-event-location {
    font-size: 13px;
    color: #8B7355;
    margin-bottom: 3px;
}

.zr-event-date {
    font-size: 13px;
    color: #A89B8C;
}

.zr-event-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    background: #FFF8E7;
    color: #b8942d;
    margin-top: 8px;
    letter-spacing: 0.01em;
}

/* ===== LINK VOLTAR ===== */

.zr-back {
    text-align: center;
    margin-top: 24px;
}

.zr-back a {
    display: inline-block;
    color: #4A2C1F;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 14px 28px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 2px 12px rgba(74, 44, 31, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.zr-back a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(74, 44, 31, 0.14);
}

/* ===== RESPONSIVO ===== */

@media (max-width: 640px) {
    .zr-container {
        padding: 24px 16px 48px;
    }

    .zr-card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .zr-form-grid {
        grid-template-columns: 1fr;
    }

    .zr-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .zr-order-num {
        font-size: 20px;
    }

    .zr-delivery {
        padding: 22px 20px;
    }

    .zr-delivery-date {
        font-size: 26px;
    }

    .zr-delivery-icon {
        display: none;
    }

    .zr-step-circle {
        width: 30px;
        height: 30px;
    }

    .zr-step-circle svg {
        width: 12px;
        height: 12px;
    }

    .zr-step-dot {
        width: 10px;
        height: 10px;
    }

    .zr-step-label {
        font-size: 10px;
    }

    .zr-step-line {
        margin-top: 13px;
        min-width: 12px;
    }

    .zr-product-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .zr-timeline {
        padding-left: 50px;
    }

    .zr-event.active {
        margin-left: -12px;
        margin-right: -12px;
        padding: 14px 12px;
    }

    .zr-event.active .zr-event-icon {
        left: -27px;
    }
}
