/**
 * Lexton Vehicle Products - Estilos
 */

/* Wrapper principal */
.lexton-vehicle-search-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.lexton-search-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #1e3a8a;
    text-align: center;
}

/* Formulario de búsqueda */
.lexton-search-form {
    background: #f8fafc;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lexton-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .lexton-form-row {
        grid-template-columns: 1fr;
    }
}

.lexton-form-field {
    display: flex;
    flex-direction: column;
}

.lexton-form-field label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
    font-size: 14px;
}

.lexton-select {
    padding: 12px 16px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    font-size: 16px;
    background-color: #fff;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.lexton-select:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.lexton-select:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Botones */
.lexton-form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.lexton-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lexton-btn-primary {
    background: #1e3a8a;
    color: #fff;
}

.lexton-btn-primary:hover:not(:disabled) {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.lexton-btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.lexton-btn-secondary {
    background: #64748b;
    color: #fff;
}

.lexton-btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

/* Información del vehículo */
.lexton-vehicle-info {
    background: #dbeafe;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #1e3a8a;
}

.lexton-vehicle-info h3 {
    margin: 0 0 15px 0;
    color: #1e3a8a;
    font-size: 18px;
}

.lexton-vehicle-info-content {
    color: #1e40af;
    font-weight: 500;
    font-size: 16px;
}

/* Loader */
.lexton-loader {
    text-align: center;
    padding: 50px;
}

.lexton-spinner {
    border: 4px solid #e2e8f0;
    border-top: 4px solid #1e3a8a;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: lexton-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes lexton-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lexton-loader p {
    color: #64748b;
    font-size: 16px;
}

/* Mensajes de error */
.lexton-error {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
    padding: 15px 20px;
    border-radius: 6px;
    color: #991b1b;
    margin-bottom: 20px;
}

/* Resultados */
.lexton-results {
    margin-top: 30px;
}

.lexton-category-section {
    margin-bottom: 40px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lexton-category-header {
    background: #1e3a8a;
    color: #fff;
    padding: 20px 25px;
    font-size: 22px;
    font-weight: 600;
}

.lexton-products-grid {
    padding: 25px;
}

.lexton-product-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    background: #fff;
}

.lexton-product-item:hover {
    border-color: #1e3a8a;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.1);
    transform: translateY(-2px);
}

.lexton-product-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lexton-product-ref {
    font-weight: 700;
    color: #1e3a8a;
    font-size: 16px;
}

.lexton-product-description {
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
}

.lexton-product-quantity {
    color: #64748b;
    font-size: 13px;
}

.lexton-product-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
    min-width: 150px;
}

.lexton-product-price {
    font-size: 24px;
    font-weight: 700;
    color: #1e3a8a;
}

.lexton-add-to-cart {
    background: #16a34a;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.lexton-add-to-cart:hover {
    background: #15803d;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.lexton-add-to-cart:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.lexton-add-to-cart.loading {
    position: relative;
    color: transparent;
}

.lexton-add-to-cart.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: lexton-spin 0.6s linear infinite;
}

/* Mensaje de éxito */
.lexton-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #16a34a;
    color: #fff;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: lexton-slide-in 0.3s ease;
}

@keyframes lexton-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .lexton-vehicle-search-wrapper {
        padding: 15px;
    }
    
    .lexton-search-form {
        padding: 20px;
    }
    
    .lexton-product-item {
        grid-template-columns: 1fr;
    }
    
    .lexton-product-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .lexton-form-actions {
        flex-direction: column;
    }
    
    .lexton-btn {
        width: 100%;
    }
}

/* Sin resultados */
.lexton-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.lexton-no-results svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.lexton-no-results h3 {
    font-size: 22px;
    color: #334155;
    margin-bottom: 10px;
}

.lexton-no-results p {
    font-size: 16px;
}
