/**
 * Estilos para el sistema de rastreo moderno de pedidos
 * Shortcode: [rt_order_tracking_modern]
 * Version: 1.0
 */

/* Variables CSS */
:root {
    --rt-primary: #00B3A6;
    --rt-primary-hover: #009688;
    --rt-primary-active: #00897B;
    --rt-surface: #ffffff;
    --rt-background: #f8fafc;
    --rt-border: #e2e8f0;
    --rt-text-primary: #1e293b;
    --rt-text-secondary: #64748b;
    --rt-text-tertiary: #94a3b8;
    --rt-success: #10b981;
    --rt-warning: #f59e0b;
    --rt-error: #ef4444;
    --rt-radius: 16px;
    --rt-radius-lg: 20px;
    --rt-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --rt-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --rt-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Contenedor principal */
.rt-modern-tracking-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header */
.rt-modern-header {
    max-width: 1000px;
    margin: 0 auto 30px;
    background: var(--rt-surface);
    border-radius: var(--rt-radius);
    padding: 24px 32px;
    box-shadow: var(--rt-shadow-md);
    border: 1px solid var(--rt-border);
}

.rt-modern-page-title {
    margin: 0 0 8px 0;
    color: var(--rt-text-primary);
    font-size: 28px;
    font-weight: 700;
}

.rt-modern-order-number {
    margin: 0;
    color: var(--rt-text-secondary);
    font-size: 16px;
}

/* Sección de búsqueda */
.rt-modern-search-section {
    max-width: 600px;
    margin: 0 auto;
}

.rt-modern-search-card {
    background: var(--rt-surface);
    border-radius: var(--rt-radius-lg);
    padding: 40px;
    box-shadow: var(--rt-shadow-lg);
    border: 1px solid var(--rt-border);
}

.rt-modern-title {
    margin: 0 0 12px 0;
    color: var(--rt-text-primary);
    font-size: 26px;
    font-weight: 700;
    text-align: center;
}

.rt-modern-subtitle {
    margin: 0 0 32px 0;
    color: var(--rt-text-secondary);
    font-size: 15px;
    text-align: center;
    line-height: 1.6;
}

.rt-modern-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.rt-modern-form-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--rt-text-primary);
    font-size: 14px;
    font-weight: 600;
}

.rt-modern-form-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--rt-border);
    border-radius: 10px;
    font-size: 15px;
    color: var(--rt-text-primary);
    transition: all 0.2s;
    box-sizing: border-box;
}

.rt-modern-form-field input:focus {
    outline: none;
    border-color: var(--rt-primary);
    box-shadow: 0 0 0 3px rgba(0, 179, 166, 0.1);
}

.rt-modern-btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--rt-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(0, 179, 166, 0.3);
}

.rt-modern-btn-primary:hover {
    background: var(--rt-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 179, 166, 0.4);
}

.rt-modern-btn-primary:active {
    background: var(--rt-primary-active);
    transform: translateY(0);
}

/* Contenido */
.rt-modern-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cards */
.rt-modern-card {
    background: var(--rt-surface);
    border-radius: var(--rt-radius-lg);
    padding: 32px;
    box-shadow: var(--rt-shadow-md);
    border: 1px solid var(--rt-border);
    transition: box-shadow 0.3s;
}

.rt-modern-card:hover {
    box-shadow: var(--rt-shadow-lg);
}

/* Card de rastreo en paquetería */
.rt-tracking-carrier-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.rt-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(0, 179, 166, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rt-primary);
}

.rt-card-content {
    flex: 1;
}

.rt-card-title {
    margin: 0 0 8px 0;
    color: var(--rt-text-primary);
    font-size: 20px;
    font-weight: 600;
}

.rt-card-description {
    margin: 0 0 20px 0;
    color: var(--rt-text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.rt-tracking-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.rt-tracking-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--rt-border);
    border-radius: 10px;
    font-size: 15px;
    color: var(--rt-text-primary);
    transition: all 0.2s;
}

.rt-tracking-input:focus {
    outline: none;
    border-color: var(--rt-primary);
    box-shadow: 0 0 0 3px rgba(0, 179, 166, 0.1);
}

.rt-tracking-btn {
    padding: 12px 24px;
    background: var(--rt-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 179, 166, 0.25);
}

.rt-tracking-btn:hover {
    background: var(--rt-primary-hover);
    box-shadow: 0 4px 12px rgba(0, 179, 166, 0.35);
}

.rt-tracking-hint {
    margin: 0;
    color: var(--rt-text-tertiary);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Sección de productos */
.rt-products-section {
    margin-bottom: 32px;
}

.rt-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.rt-section-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rt-section-title-group h2 {
    margin: 0;
    color: var(--rt-text-primary);
    font-size: 20px;
    font-weight: 600;
}

.rt-section-title-group svg {
    color: var(--rt-text-tertiary);
}

.rt-quick-actions {
    display: flex;
    gap: 8px;
}

.rt-action-btn {
    padding: 10px 16px;
    background: rgba(0, 179, 166, 0.05);
    color: var(--rt-primary);
    border: 1px solid rgba(0, 179, 166, 0.2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rt-action-btn:hover {
    background: rgba(0, 179, 166, 0.1);
}

.rt-action-secondary {
    background: var(--rt-background);
    color: var(--rt-text-secondary);
    border-color: var(--rt-border);
}

.rt-action-secondary:hover {
    background: #f1f5f9;
}

.rt-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.rt-product-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--rt-background);
    border-radius: 12px;
    border: 1px solid var(--rt-border);
    transition: all 0.2s;
}

.rt-product-item:hover {
    border-color: rgba(0, 179, 166, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rt-product-image {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--rt-border);
}

.rt-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rt-product-details {
    flex: 1;
    min-width: 0;
}

.rt-product-name {
    margin: 0 0 4px 0;
    color: var(--rt-text-primary);
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rt-product-qty {
    margin: 0 0 4px 0;
    color: var(--rt-text-tertiary);
    font-size: 12px;
}

.rt-product-price {
    margin: 0;
    color: var(--rt-primary);
    font-size: 14px;
    font-weight: 700;
}

/* Divisor */
.rt-section-divider {
    height: 1px;
    background: var(--rt-border);
    margin: 32px 0;
}

/* Estado del envío */
.rt-shipment-status-section {
    margin-bottom: 32px;
}

.rt-section-title-simple {
    margin: 0 0 24px 0;
    color: var(--rt-text-primary);
    font-size: 20px;
    font-weight: 600;
}

/* Timeline moderna */
.rt-modern-timeline {
    position: relative;
}

.rt-timeline-item {
    position: relative;
    padding-bottom: 40px;
}

.rt-timeline-item:last-child {
    padding-bottom: 0;
}

.rt-timeline-item:last-child .rt-timeline-connector {
    display: none;
}

.rt-timeline-connector {
    position: absolute;
    left: 24px;
    top: 48px;
    width: 2px;
    height: calc(100% + 8px);
    background: var(--rt-border);
    z-index: 0;
}

.rt-timeline-connector.active {
    background: var(--rt-primary);
}

.rt-timeline-content-wrapper {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.rt-timeline-icon {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1;
}

.rt-timeline-icon.rt-status-completed {
    background: var(--rt-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 179, 166, 0.3);
}

.rt-timeline-icon.rt-status-current {
    background: white;
    color: var(--rt-primary);
    border: 4px solid var(--rt-primary);
    box-shadow: 0 4px 12px rgba(0, 179, 166, 0.2);
}

.rt-timeline-icon.rt-status-pending {
    background: var(--rt-background);
    color: var(--rt-text-tertiary);
    border: 2px solid var(--rt-border);
}

.rt-pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 179, 166, 0.2);
    animation: rt-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    transform: scale(1.5);
}

@keyframes rt-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1.5);
    }
    50% {
        opacity: 0;
        transform: scale(1.9);
    }
}

.rt-timeline-info {
    flex: 1;
    padding-top: 4px;
}

.rt-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.rt-timeline-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.rt-timeline-title.rt-status-completed,
.rt-timeline-title.rt-status-current {
    color: var(--rt-text-primary);
}

.rt-timeline-title.rt-status-pending {
    color: var(--rt-text-tertiary);
}

.rt-timeline-date {
    font-size: 14px;
}

.rt-timeline-date.rt-status-completed {
    color: var(--rt-primary);
}

.rt-timeline-date.rt-status-current {
    color: var(--rt-primary);
}

.rt-timeline-date.rt-status-pending {
    color: var(--rt-text-tertiary);
}

.rt-current-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 179, 166, 0.1);
    border-radius: 20px;
    margin-top: 8px;
}

.rt-pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--rt-primary);
    border-radius: 50%;
    animation: rt-pulse-dot 1.5s ease-in-out infinite;
}

@keyframes rt-pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.rt-current-badge span {
    color: var(--rt-primary);
    font-size: 12px;
    font-weight: 600;
}

/* Información adicional */
.rt-additional-info {
    background: var(--rt-background);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--rt-border);
}

.rt-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.rt-info-item {
    display: flex;
    flex-direction: column;
}

.rt-info-label {
    margin: 0 0 12px 0;
    color: var(--rt-text-tertiary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rt-info-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rt-info-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rt-primary);
    box-shadow: var(--rt-shadow);
    border: 1px solid var(--rt-border);
}

.rt-info-value {
    margin: 0;
    color: var(--rt-text-primary);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.rt-info-address .rt-info-content {
    align-items: flex-start;
}

.rt-info-address-text {
    flex: 1;
}

.rt-info-subtext {
    margin: 4px 0 0 0;
    color: var(--rt-text-tertiary);
    font-size: 12px;
}

/* Error */
.rt-modern-error {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border: 2px solid #fee;
    border-left: 6px solid var(--rt-error);
    border-radius: var(--rt-radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--rt-shadow-md);
}

.rt-error-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.rt-error-content h3 {
    margin: 0 0 8px 0;
    color: var(--rt-error);
    font-size: 18px;
    font-weight: 600;
}

.rt-error-content p {
    margin: 0;
    color: var(--rt-text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .rt-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .rt-modern-tracking-page {
        padding: 20px 16px;
    }
    
    .rt-modern-card {
        padding: 24px 20px;
    }
    
    .rt-modern-header {
        padding: 20px 24px;
    }
    
    .rt-modern-form-grid {
        grid-template-columns: 1fr;
    }
    
    .rt-tracking-input-group {
        flex-direction: column;
    }
    
    .rt-tracking-carrier-card {
        flex-direction: column;
    }
    
    .rt-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .rt-quick-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .rt-action-btn {
        flex: 1;
    }
}
