/* ===================================
   Estilos Premium para Página de Tracking
   =================================== */

.tracking-container {
    max-width: 800px;
    margin: 120px auto 60px;
    padding: 0 20px;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tracking-header {
    text-align: center;
    margin-bottom: 50px;
}

.icon-circle {
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary);
    font-size: 1.8rem;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.15);
}

.tracking-header h1 {
    font-size: 2.2rem;
    color: #1e293b;
    margin-bottom: 12px;
    font-weight: 800;
}

.tracking-header p {
    color: #64748b;
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Sección de búsqueda */
.search-section {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 15px;
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 20px;
    color: #94a3b8;
    font-size: 1.1rem;
}

.input-wrapper input {
    width: 100%;
    padding: 18px 20px 18px 50px;
    font-size: 1.05rem;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    transition: all 0.3s;
    background: white;
    font-family: 'Outfit', sans-serif;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.search-box button {
    padding: 18px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.search-box button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}

.search-footer {
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Acciones rápidas */
.quick-actions {
    text-align: center;
    margin-bottom: 40px;
}

.btn-new-order {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: #1e293b;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-shadow: 0 10px 25px rgba(30, 41, 59, 0.15);
}

.btn-new-order:hover {
    transform: scale(1.05);
    background: #0f172a;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* Tarjeta de pedido */
.pedido-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.03);
    padding: 35px;
    margin-bottom: 30px;
    border: 1px solid #f1f5f9;
    transition: transform 0.3s;
}

.pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.pedido-title-group h3 {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0;
    font-weight: 700;
}

.pedido-fecha {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}

.estado-badge {
    padding: 8px 18px;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pedido-info {
    margin-bottom: 30px;
}

.info-group {
    display: flex;
    gap: 30px;
}

.proforma-status-msg {
    margin-top: 15px;
    padding: 12px 18px;
    background: #f0fdf4;
    color: var(--primary);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid #dcfce7;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Timeline */
.timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin: 40px 0;
    padding: 0 10px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #f1f5f9;
    z-index: 0;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    min-width: 60px;
}

.step-icon {
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.1rem;
    margin-bottom: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.timeline-step.active .step-icon {
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
    color: white;
}

.timeline-step.current .step-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
}

.step-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-step.active .step-label {
    color: #1e293b;
}

/* Fotos Galería */
.fotos-galeria {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #f1f5f9;
}

.fotos-galeria h4 {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 20px;
}

.fotos-galeria h4 i {
    color: var(--primary);
    margin-right: 8px;
}

.fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
}

.foto-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.foto-item:hover {
    transform: scale(1.05);
}

.foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-final {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #22c55e;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Historial */
.historial {
    margin: 30px 0;
}

.historial h4 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
}

.historial h4 i {
    color: var(--primary);
    margin-right: 8px;
}

.historial-item {
    padding: 15px;
    background: #f8f8f8;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary);
}

.historial-fecha {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 5px;
}

.historial-estado {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 5px;
}

.historial-comentario {
    color: #666;
    font-size: 0.95rem;
    font-style: italic;
}

/* Acciones */
.pedido-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: #25d366;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.btn-whatsapp:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp i {
    font-size: 1.3rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .tracking-header h1 {
        font-size: 2rem;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box button {
        width: 100%;
    }

    .pedido-header {
        flex-direction: column;
        gap: 15px;
    }

    .timeline {
        padding: 0 10px;
    }

    .step-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .fotos-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Responsive */
@media (max-width: 640px) {
    .tracking-container { margin-top: 100px; padding: 0 15px; }
    .tracking-header h1 { font-size: 1.8rem; }
    .search-box { flex-direction: column; }
    .search-box button { width: 100%; justify-content: center; }
    .info-group { gap: 10px; flex-direction: column; }
    .timeline::before { left: 30px; right: 30px; }
    .step-icon { width: 38px; height: 38px; font-size: 0.9rem; }
}